[Bf-blender-cvs] [0c18f705e64] fixed_width_integers: Replace uint8* with char* in Ghost API when variable is a string.
Nicholas Rishel
noreply at git.blender.org
Fri Jul 2 02:09:25 CEST 2021
Commit: 0c18f705e64790200ca33601a89b62b9508143f1
Author: Nicholas Rishel
Date: Tue Jun 15 18:44:25 2021 -0700
Branches: fixed_width_integers
https://developer.blender.org/rB0c18f705e64790200ca33601a89b62b9508143f1
Replace uint8* with char* in Ghost API when variable is a string.
===================================================================
M intern/ghost/GHOST_C-api.h
M intern/ghost/GHOST_ISystem.h
M intern/ghost/GHOST_ISystemPaths.h
M intern/ghost/GHOST_Path-api.h
M intern/ghost/intern/GHOST_C-api.cpp
M intern/ghost/intern/GHOST_Path-api.cpp
M intern/ghost/intern/GHOST_System.h
M intern/ghost/intern/GHOST_SystemCocoa.h
M intern/ghost/intern/GHOST_SystemCocoa.mm
M intern/ghost/intern/GHOST_SystemNULL.h
M intern/ghost/intern/GHOST_SystemPaths.h
M intern/ghost/intern/GHOST_SystemPathsCocoa.h
M intern/ghost/intern/GHOST_SystemPathsCocoa.mm
M intern/ghost/intern/GHOST_SystemPathsUnix.cpp
M intern/ghost/intern/GHOST_SystemPathsUnix.h
M intern/ghost/intern/GHOST_SystemPathsWin32.cpp
M intern/ghost/intern/GHOST_SystemPathsWin32.h
M intern/ghost/intern/GHOST_SystemSDL.cpp
M intern/ghost/intern/GHOST_SystemSDL.h
M intern/ghost/intern/GHOST_SystemWayland.cpp
M intern/ghost/intern/GHOST_SystemWayland.h
M intern/ghost/intern/GHOST_SystemWin32.cpp
M intern/ghost/intern/GHOST_SystemWin32.h
M intern/ghost/intern/GHOST_SystemX11.cpp
M intern/ghost/intern/GHOST_SystemX11.h
M source/blender/blenkernel/intern/appdir.c
M source/blender/windowmanager/intern/wm_window.c
===================================================================
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 65f91ac0775..a5aa03fb3df 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -903,14 +903,14 @@ extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
* \param selection: Boolean to return the selection instead, X11 only feature.
* \return clipboard data
*/
-extern uint8_t *GHOST_getClipboard(int selection);
+extern char *GHOST_getClipboard(int selection);
/**
* Put data to the Clipboard
* \param buffer: the string buffer to set.
* \param selection: Set the selection instead, X11 only feature.
*/
-extern void GHOST_putClipboard(int8_t *buffer, int selection);
+extern void GHOST_putClipboard(char *buffer, int selection);
/**
* Toggles console
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 2bc6f6cf987..86737589e06 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -431,12 +431,12 @@ class GHOST_ISystem {
* \return "unsigned char" from X11 XA_CUT_BUFFER0 buffer
*
*/
- virtual uint8_t *getClipboard(bool selection) const = 0;
+ virtual char *getClipboard(bool selection) const = 0;
/**
* Put data to the Clipboard
*/
- virtual void putClipboard(int8_t *buffer, bool selection) const = 0;
+ virtual void putClipboard(char *buffer, bool selection) const = 0;
/***************************************************************************************
* System Message Box.
diff --git a/intern/ghost/GHOST_ISystemPaths.h b/intern/ghost/GHOST_ISystemPaths.h
index b568a2d07fe..8298f4b78e2 100644
--- a/intern/ghost/GHOST_ISystemPaths.h
+++ b/intern/ghost/GHOST_ISystemPaths.h
@@ -68,26 +68,26 @@ class GHOST_ISystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning.
* \return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/
- virtual const uint8_t *getSystemDir(int version, const char *versionstr) const = 0;
+ virtual const char *getSystemDir(int version, const char *versionstr) const = 0;
/**
* Determine the base dir in which user configuration is stored, including versioning.
* If needed, it will create the base directory.
* \return Unsigned char string pointing to user dir (eg ~/.blender/).
*/
- virtual const uint8_t *getUserDir(int version, const char *versionstr) const = 0;
+ virtual const char *getUserDir(int version, const char *versionstr) const = 0;
/**
* Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/
- virtual const uint8_t *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const = 0;
+ virtual const char *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const = 0;
/**
* Determine the directory of the current binary
* \return Unsigned char string pointing to the binary dir
*/
- virtual const uint8_t *getBinaryDir() const = 0;
+ virtual const char *getBinaryDir() const = 0;
/**
* Add the file to the operating system most recently used files
diff --git a/intern/ghost/GHOST_Path-api.h b/intern/ghost/GHOST_Path-api.h
index aae27d0a3d3..81df2e607eb 100644
--- a/intern/ghost/GHOST_Path-api.h
+++ b/intern/ghost/GHOST_Path-api.h
@@ -48,25 +48,25 @@ extern GHOST_TSuccess GHOST_DisposeSystemPaths(void);
* "unpack and run" path, then look for properly installed path, including versioning.
* \return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/
-extern const uint8_t *GHOST_getSystemDir(int version, const char *versionstr);
+extern const char *GHOST_getSystemDir(int version, const char *versionstr);
/**
* Determine the base dir in which user configuration is stored, including versioning.
* \return Unsigned char string pointing to user dir (eg ~).
*/
-extern const uint8_t *GHOST_getUserDir(int version, const char *versionstr);
+extern const char *GHOST_getUserDir(int version, const char *versionstr);
/**
* Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/
-extern const uint8_t *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type);
+extern const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type);
/**
* Determine the dir in which the binary file is found.
* \return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/).
*/
-extern const uint8_t *GHOST_getBinaryDir(void);
+extern const char *GHOST_getBinaryDir(void);
/**
* Add the file to the operating system most recently used files
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 0d32af36426..c1041463d7c 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -823,13 +823,13 @@ GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
return result;
}
-uint8_t *GHOST_getClipboard(int selection)
+char *GHOST_getClipboard(int selection)
{
GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->getClipboard(selection);
}
-void GHOST_putClipboard(int8_t *buffer, int selection)
+void GHOST_putClipboard(char *buffer, int selection)
{
GHOST_ISystem *system = GHOST_ISystem::getSystem();
system->putClipboard(buffer, selection);
diff --git a/intern/ghost/intern/GHOST_Path-api.cpp b/intern/ghost/intern/GHOST_Path-api.cpp
index 5ec42825bc2..4f4d1d5a1c8 100644
--- a/intern/ghost/intern/GHOST_Path-api.cpp
+++ b/intern/ghost/intern/GHOST_Path-api.cpp
@@ -38,25 +38,25 @@ GHOST_TSuccess GHOST_DisposeSystemPaths(void)
return GHOST_ISystemPaths::dispose();
}
-const uint8_t *GHOST_getSystemDir(int version, const char *versionstr)
+const char *GHOST_getSystemDir(int version, const char *versionstr)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getSystemDir(version, versionstr) : NULL;
}
-const uint8_t *GHOST_getUserDir(int version, const char *versionstr)
+const char *GHOST_getUserDir(int version, const char *versionstr)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getUserDir(version, versionstr) : NULL; /* shouldn't be NULL */
}
-const uint8_t *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
+const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getUserSpecialDir(type) : NULL; /* shouldn't be NULL */
}
-const uint8_t *GHOST_getBinaryDir()
+const char *GHOST_getBinaryDir()
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getBinaryDir() : NULL; /* shouldn't be NULL */
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 123aceb28b9..4c10ba814b3 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -308,14 +308,14 @@ class GHOST_System : public GHOST_ISystem {
* \return Returns the clipboard data
*
*/
- virtual uint8_t *getClipboard(bool selection) const = 0;
+ virtual char *getClipboard(bool selection) const = 0;
/**
* Put data to the Clipboard
* \param buffer: The buffer to copy to the clipboard.
* \param selection: The clipboard to copy too only used on X11.
*/
- virtual void putClipboard(int8_t *buffer, bool selection) const = 0;
+ virtual void putClipboard(char *buffer, bool selection) const = 0;
/**
* Show a system message box
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index 87d365743df..00567d51182 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -208,14 +208,14 @@ class GHOST_SystemCocoa : public GHOST_System {
* \param selection: Indicate which buffer to return.
* \return Returns the selected buffer
*/
- uint8_t *getClipboard(bool selection) const;
+ char *getClipboard(bool selection) const;
/**
* Puts buffer to system clipboard
* \param buffer: The buffer to be copied.
* \param selection: Indicates which buffer to copy too, only used on X11.
*/
- void putClipboard(int8_t *buffer, bool selection) const;
+ void putClipboard(char *buffer, bool selection) const;
/**
* Handles a window event. Called by GHOST_WindowCocoa window delegate
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 50ca8491d8b..b25c447b874 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1933,9 +1933,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
#pragma mark Clipboard get/set
-uint8_t *GHOST_SystemCocoa::getClipboard(bool selection) const
+char *GHOST_SystemCocoa::getClipboard(bool selection) const
{
- uint8_t *temp_buff;
+ char *temp_buff;
size_t pastedTextSize;
@autoreleasepool {
@@ -1950,14 +1950,14 @@ uint8_t *GHOST_SystemCocoa::getClipboard(bool selection) const
pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
- temp_buff = (uint8_t *)malloc(pastedTextSize + 1);
+ temp_buff = (char *)malloc(pastedTextSize + 1);
if (temp_buff == NULL) {
return NULL;
}
strncpy(
- (char *)temp_buff, [textPasted cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
+ temp_buff, [textPasted cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
@@ -1970,7 +1970,7 @@ uint8_t *GHOST_SystemCocoa::getClipboard(bool selection) const
}
}
-void GHOST_SystemCocoa::putClipboard(int8_t *buffer, bool selection) const
+void GHOST_SystemCocoa::putClipboard(char *buffer, bool selection) const
{
if (selection)
return; // for copying the selection, used on X11
diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h
index 92304bdeb9f..573b35a878c 100644
--- a/intern/ghost/intern/GHOST_System
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list