diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-25 01:08:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-25 01:08:29 +0300 |
commit | 72ede30d0f970fe7d6774ce0851e3aacc82e23d8 (patch) | |
tree | 67116106c9b27f1f6b00eff373004691c1e8f086 /source/blender/windowmanager/intern | |
parent | a38313c3bdf1a250fb7dc93fefd8f89e81965a1e (diff) |
Cleanup: pass const image data to IMB_ibImageFromMemory
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 8221dfdbaae..6f33bd62bcd 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1426,11 +1426,11 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar #ifndef WITH_HEADLESS if (U.dpi_fac > 1.0) { - ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_2x_png, + ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_splash_2x_png, datatoc_splash_2x_png_size, IB_rect, NULL, "<splash screen>"); } else { - ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_png, + ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_splash_png, datatoc_splash_png_size, IB_rect, NULL, "<splash screen>"); } diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index a8d75ac8fdb..e6c73bf3bf7 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -228,7 +228,7 @@ static void playanim_event_qual_update(void) typedef struct PlayAnimPict { struct PlayAnimPict *next, *prev; - char *mem; + uchar *mem; int size; const char *name; struct ImBuf *ibuf; @@ -380,7 +380,8 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf static void build_pict_list_ex(PlayState *ps, const char *first, int totframes, int fstep, int fontid) { - char *mem, filepath[FILE_MAX]; + char filepath[FILE_MAX]; + uchar *mem; // short val; PlayAnimPict *picture = NULL; struct ImBuf *ibuf = NULL; @@ -465,7 +466,7 @@ static void build_pict_list_ex(PlayState *ps, const char *first, int totframes, picture->IB_flags = IB_rect; if (fromdisk == false) { - mem = (char *)MEM_mallocN(size, "build pic list"); + mem = MEM_mallocN(size, "build pic list"); if (mem == NULL) { printf("Couldn't get memory\n"); close(file); @@ -497,7 +498,7 @@ static void build_pict_list_ex(PlayState *ps, const char *first, int totframes, if (ptottime > 1.0) { /* OCIO_TODO: support different input color space */ if (picture->mem) { - ibuf = IMB_ibImageFromMemory((unsigned char *)picture->mem, picture->size, + ibuf = IMB_ibImageFromMemory(picture->mem, picture->size, picture->IB_flags, NULL, picture->name); } else { @@ -1377,7 +1378,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) } else if (ps.picture->mem) { /* use correct colorspace here */ - ibuf = IMB_ibImageFromMemory((unsigned char *) ps.picture->mem, ps.picture->size, + ibuf = IMB_ibImageFromMemory(ps.picture->mem, ps.picture->size, ps.picture->IB_flags, NULL, ps.picture->name); } else { |