[Bf-blender-cvs] [64dadc542f4] fixed_width_integers: Replace integer with bool in Ghost API when only used as boolean.

Nicholas Rishel noreply at git.blender.org
Sun Jul 4 19:28:44 CEST 2021


Commit: 64dadc542f4608f4e5ee74b09d846ab467262831
Author: Nicholas Rishel
Date:   Wed Jun 16 12:47:11 2021 -0700
Branches: fixed_width_integers
https://developer.blender.org/rB64dadc542f4608f4e5ee74b09d846ab467262831

Replace integer with bool in Ghost API when only used as boolean.

===================================================================

M	intern/ghost/GHOST_C-api.h
M	intern/ghost/GHOST_IWindow.h
M	intern/ghost/intern/GHOST_C-api.cpp
M	intern/ghost/intern/GHOST_Window.h
M	intern/ghost/intern/GHOST_WindowWin32.cpp
M	intern/ghost/intern/GHOST_WindowWin32.h

===================================================================

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 7076748bbeb..fd5ddebac6c 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -366,7 +366,7 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
                                                  int sizey,
                                                  int hotX,
                                                  int hotY,
-                                                 uint8_t canInvertColor);
+                                                 bool canInvertColor);
 
 /**
  * Returns the visibility state of the cursor.
@@ -467,7 +467,7 @@ extern void GHOST_setNDOFDeadZone(float deadzone);
 /**
  * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
  */
-extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, int8_t canAccept);
+extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool canAccept);
 
 /**
  * Returns the event type.
@@ -667,7 +667,7 @@ extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
  * \return Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
-                                                   uint8_t isUnsavedChanges);
+                                                   bool isUnsavedChanges);
 
 /**
  * Sets the order of the window (bottom, top).
@@ -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 char *GHOST_getClipboard(int selection);
+extern char *GHOST_getClipboard(bool 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(char *buffer, int selection);
+extern void GHOST_putClipboard(char *buffer, bool selection);
 
 /**
  * Toggles console
@@ -961,7 +961,7 @@ extern void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
                            int32_t y,
                            int32_t w,
                            int32_t h,
-                           int complete);
+                           bool complete);
 /**
  * Disable the IME attached to the given window, i.e. prohibits any user-input
  * events from being dispatched to the IME.
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index 9ca39424f5e..64dc81b6afb 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -349,7 +349,7 @@ class GHOST_IWindow {
    * - false: Move the IME windows to the given position without finishing it.
    */
   virtual void beginIME(
-      int32_t x, int32_t y, int32_t w, int32_t h, int completed) = 0;
+      int32_t x, int32_t y, int32_t w, int32_t h, bool completed) = 0;
 
   /**
    * Disable the IME attached to the given window, i.e. prohibits any user-input
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index c1041463d7c..7d273d3409a 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -323,7 +323,7 @@ GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
                                           int sizey,
                                           int hotX,
                                           int hotY,
-                                          uint8_t canInvertColor)
+                                          bool canInvertColor)
 {
   GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
 
@@ -420,7 +420,7 @@ void GHOST_setNDOFDeadZone(float deadzone)
 }
 #endif
 
-void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, int8_t canAccept)
+void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool canAccept)
 {
   GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
 
@@ -615,7 +615,7 @@ GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, GHOST_TWind
 }
 
 GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
-                                            uint8_t isUnsavedChanges)
+                                            bool isUnsavedChanges)
 {
   GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
 
@@ -823,13 +823,13 @@ GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
   return result;
 }
 
-char *GHOST_getClipboard(int selection)
+char *GHOST_getClipboard(bool selection)
 {
   GHOST_ISystem *system = GHOST_ISystem::getSystem();
   return system->getClipboard(selection);
 }
 
-void GHOST_putClipboard(char *buffer, int selection)
+void GHOST_putClipboard(char *buffer, bool selection)
 {
   GHOST_ISystem *system = GHOST_ISystem::getSystem();
   system->putClipboard(buffer, selection);
@@ -874,7 +874,7 @@ void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
                     int32_t y,
                     int32_t w,
                     int32_t h,
-                    int complete)
+                    bool complete)
 {
   GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
   window->beginIME(x, y, w, h, complete);
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index a2ba5386feb..804574bbd16 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -299,7 +299,7 @@ class GHOST_Window : public GHOST_IWindow {
 
 #ifdef WITH_INPUT_IME
   virtual void beginIME(
-      int32_t x, int32_t y, int32_t w, int32_t h, int completed)
+      int32_t x, int32_t y, int32_t w, int32_t h, bool completed)
   {
     /* do nothing temporarily if not in windows */
   }
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 9616c0471e9..e031cad1f11 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -1116,9 +1116,9 @@ GHOST_TSuccess GHOST_WindowWin32::endProgressBar()
 
 #ifdef WITH_INPUT_IME
 void GHOST_WindowWin32::beginIME(
-    int32_t x, int32_t y, int32_t w, int32_t h, int completed)
+    int32_t x, int32_t y, int32_t w, int32_t h, bool completed)
 {
-  m_imeInput.BeginIME(m_hWnd, GHOST_Rect(x, y - h, x, y), (bool)completed);
+  m_imeInput.BeginIME(m_hWnd, GHOST_Rect(x, y - h, x, y), completed);
 }
 
 void GHOST_WindowWin32::endIME()
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index 7a466707a41..e6ff0ebec9c 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -323,7 +323,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
     return &m_imeInput;
   }
 
-  void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, int completed);
+  void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed);
 
   void endIME();
 #endif /* WITH_INPUT_IME */



More information about the Bf-blender-cvs mailing list