diff options
author | Nicholas Rishel <nicholas_rishel> | 2021-07-05 20:10:20 +0300 |
---|---|---|
committer | Nicholas Rishel <rishel.nick@gmail.com> | 2021-07-05 21:00:45 +0300 |
commit | f3ec0d8e58595ef5fae3e2e9c541150db3bd3f1e (patch) | |
tree | bd9d60ecdae0c3963983ceae9cc1a703d5393103 /source | |
parent | b66c21f8b0a73c9ad58eb3295b29fe4fadfc4bc8 (diff) |
Replace Ghost integrals with stdint fixed width integers.
Also replace integer with bool in Ghost API when only used as boolean,
and uint8* with char* in Ghost API when variable is a string.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D11617
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/appdir.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 8 |
4 files changed, 12 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c index 579f671e2b0..ebff6015df1 100644 --- a/source/blender/blenkernel/intern/appdir.c +++ b/source/blender/blenkernel/intern/appdir.c @@ -191,8 +191,7 @@ bool BKE_appdir_folder_documents(char *dir) { dir[0] = '\0'; - const char *documents_path = (const char *)GHOST_getUserSpecialDir( - GHOST_kUserSpecialDirDocuments); + const char *documents_path = GHOST_getUserSpecialDir(GHOST_kUserSpecialDirDocuments); /* Usual case: Ghost gave us the documents path. We're done here. */ if (documents_path && BLI_is_dir(documents_path)) { @@ -462,7 +461,7 @@ static bool get_path_user_ex(char *targetpath, } user_path[0] = '\0'; - user_base_path = (const char *)GHOST_getUserDir(version, blender_version_decimal(version)); + user_base_path = GHOST_getUserDir(version, blender_version_decimal(version)); if (user_base_path) { BLI_strncpy(user_path, user_base_path, FILE_MAX); } @@ -522,7 +521,7 @@ static bool get_path_system_ex(char *targetpath, } system_path[0] = '\0'; - system_base_path = (const char *)GHOST_getSystemDir(version, blender_version_decimal(version)); + system_base_path = GHOST_getSystemDir(version, blender_version_decimal(version)); if (system_base_path) { BLI_strncpy(system_path, system_base_path, FILE_MAX); } diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 3b78327872d..93b8495b309 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -124,14 +124,14 @@ static void window_set_custom_cursor( wmWindow *win, const uchar mask[16][2], const uchar bitmap[16][2], int hotx, int hoty) { GHOST_SetCustomCursorShape( - win->ghostwin, (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask, 16, 16, hotx, hoty, true); + win->ghostwin, (uint8_t *)bitmap, (uint8_t *)mask, 16, 16, hotx, hoty, true); } static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor) { GHOST_SetCustomCursorShape(win->ghostwin, - (GHOST_TUns8 *)cursor->bitmap, - (GHOST_TUns8 *)cursor->mask, + (uint8_t *)cursor->bitmap, + (uint8_t *)cursor->mask, 16, 16, cursor->hotx, diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 1f081d3b02e..fa21dbcb4bb 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -1357,7 +1357,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) static void playanim_window_open(const char *title, int posx, int posy, int sizex, int sizey) { GHOST_GLSettings glsettings = {0}; - GHOST_TUns32 scr_w, scr_h; + uint32_t scr_w, scr_h; GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &scr_w, &scr_h); @@ -1405,7 +1405,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) { struct ImBuf *ibuf = NULL; static char filepath[FILE_MAX]; /* abused to return dropped file path */ - GHOST_TUns32 maxwinx, maxwiny; + uint32_t maxwinx, maxwiny; int i; /* This was done to disambiguate the name for use under c++. */ int start_x = 0, start_y = 0; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 954976fddb6..1b08b8dad92 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -462,7 +462,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) /* Informs GHOST of unsaved changes, to set window modified visual indicator (macOS) * and to give hint of unsaved changes for a user warning mechanism in case of OS application * terminate request (e.g. OS Shortcut Alt+F4, Command+Q, (...), or session end). */ - GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8)!wm->file_saved); + GHOST_SetWindowModifiedState(win->ghostwin, (bool)!wm->file_saved); } } @@ -1722,7 +1722,7 @@ static char *wm_clipboard_text_get_ex(bool selection, int *r_len, bool firstline return NULL; } - char *buf = (char *)GHOST_getClipboard(selection); + char *buf = GHOST_getClipboard(selection); if (!buf) { *r_len = 0; return NULL; @@ -1809,10 +1809,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 } } |