[Bf-blender-cvs] [35ca3c2f865] fixed_width_integers: Replace Ghost integral types with standard fixed width integers.
Nicholas Rishel
noreply at git.blender.org
Wed Jun 16 09:04:09 CEST 2021
Commit: 35ca3c2f865b4176690dc37d2ea25434b2eb56ab
Author: Nicholas Rishel
Date: Tue Jun 15 18:44:25 2021 -0700
Branches: fixed_width_integers
https://developer.blender.org/rB35ca3c2f865b4176690dc37d2ea25434b2eb56ab
Replace Ghost integral types with standard fixed width integers.
Use char* for putClipboard, which is more natural for handling characters.
Differential Revision: https://developer.blender.org/D11617
===================================================================
M intern/ghost/GHOST_C-api.h
M intern/ghost/GHOST_ISystem.h
M intern/ghost/intern/GHOST_C-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_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/windowmanager/intern/wm_window.c
===================================================================
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 65f91ac0775..bc99a098ad6 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -910,7 +910,7 @@ extern uint8_t *GHOST_getClipboard(int selection);
* \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..0172e1a2e2f 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -436,7 +436,7 @@ class GHOST_ISystem {
/**
* 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/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 0d32af36426..f83b624dfed 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -829,7 +829,7 @@ uint8_t *GHOST_getClipboard(int selection)
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_System.h b/intern/ghost/intern/GHOST_System.h
index b82968ef3c8..b3a7820451e 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -315,7 +315,7 @@ class GHOST_System : public GHOST_ISystem {
* \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..a15783e5e79 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -215,7 +215,7 @@ class GHOST_SystemCocoa : public GHOST_System {
* \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 cf3ff7a565a..8acdb075fa2 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1969,7 +1969,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..205b0486a34 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -56,7 +56,7 @@ class GHOST_SystemNULL : public GHOST_System {
{
return NULL;
}
- void putClipboard(int8_t *buffer, bool selection) const
+ void putClipboard(char *buffer, bool selection) const
{ /* nop */
}
uint64_t getMilliSeconds() const
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index 38b90e51d25..e679aa1c4a5 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -748,7 +748,7 @@ uint8_t *GHOST_SystemSDL::getClipboard(bool selection) const
return (uint8_t *)SDL_GetClipboardText();
}
-void GHOST_SystemSDL::putClipboard(int8_t *buffer, bool selection) const
+void GHOST_SystemSDL::putClipboard(char *buffer, bool selection) const
{
SDL_SetClipboardText(buffer);
}
diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h
index 967ed6a3fd0..203be87f27b 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.h
+++ b/intern/ghost/intern/GHOST_SystemSDL.h
@@ -58,7 +58,7 @@ class GHOST_SystemSDL : public GHOST_System {
uint8_t *getClipboard(bool selection) const;
- void putClipboard(int8_t *buffer, bool selection) const;
+ void putClipboard(char *buffer, bool selection) const;
uint64_t getMilliSeconds();
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 2a4ea08e11a..ed2c3453eb2 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1518,7 +1518,7 @@ uint8_t *GHOST_SystemWayland::getClipboard(bool /*selection*/) const
return clipboard;
}
-void GHOST_SystemWayland::putClipboard(int8_t *buffer, bool /*selection*/) const
+void GHOST_SystemWayland::putClipboard(char *buffer, bool /*selection*/) const
{
if (!d->data_device_manager || d->inputs.empty()) {
return;
diff --git a/intern/ghost/intern/GHOST_SystemWayland.h b/intern/ghost/intern/GHOST_SystemWayland.h
index 86f02211a0c..798e42fb4bd 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.h
+++ b/intern/ghost/intern/GHOST_SystemWayland.h
@@ -61,7 +61,7 @@ class GHOST_SystemWayland : public GHOST_System {
uint8_t *getClipboard(bool selection) const override;
- void putClipboard(int8_t *buffer, bool selection) const override;
+ void putClipboard(char *buffer, bool selection) const override;
uint8_t getNumDisplays() const override;
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 534e5d70685..8d454f36141 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1806,7 +1806,7 @@ uint8_t *GHOST_SystemWin32::getClipboard(bool selection) const
}
}
-void GHOST_SystemWin32::putClipboard(int8_t *buffer, bool selection) const
+void GHOST_SystemWin32::putClipboard(char *buffer, bool selection) const
{
if (selection) {
return;
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index cf229d108db..bdf94805c21 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -229,7 +229,7 @@ class GHOST_SystemWin32 : public GHOST_System {
* \param selection: Used by X11 only.
* \return No return.
*/
- void putClipboard(int8_t *buffer, bool selection) const;
+ void putClipboard(char *buffer, bool selection) const;
/**
* Show a system message box
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 05d1e955d1b..e95609d2c4b 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -2245,7 +2245,7 @@ uint8_t *GHOST_SystemX11::getClipboard(bool selection) const
return NULL;
}
-void GHOST_SystemX11::putClipboard(int8_t *buffer, bool selection) const
+void GHOST_SystemX11::putClipboard(char *buffer, bool selection) const
{
Window m_window, owner;
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 035733da513..97b1b286303 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -229,7 +229,7 @@ class GHOST_SystemX11 : public GHOST_System {
* \param buffer: The buffer to copy to the clipboard.
* \param selection: Set the selection into the clipboard, X11 only feature.
*/
- void putClipboard(int8_t *buffer, bool selection) const;
+ void putClipboard(char *buffer, bool selection) const;
/**
* Show a system message box
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index e4218468656..e12f0abf419 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1812,10 +1812,10 @@ void WM_clipboard_text_set(const char *buf, bool selection)
}
*p2 = '\0';
- GHOST_putClipboard((GHOST_TInt8 *)newbuf, selection);
+ GHOST_putClipboard(newbuf, selection);
MEM_freeN(newbuf);
#else
- GHOST_putClipboard((GHOST_TInt8 *)buf, selection);
+ GHOST_putClipboard(buf, selection);
#endif
}
}
More information about the Bf-blender-cvs
mailing list