diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:37:39 +0300 |
commit | b134434224254d4ac3fc73d023f2f6d914746690 (patch) | |
tree | b67d2c5aee982495d55848414c362665a37476b0 /source/blender/imbuf | |
parent | 3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff) |
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util_gpu.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 9fab450cc76..01372d5ed68 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -803,7 +803,7 @@ static void ffmpeg_postprocess(struct anim *anim) if (ENDIAN_ORDER == B_ENDIAN) { int *dstStride = anim->pFrameRGB->linesize; uint8_t **dst = anim->pFrameRGB->data; - int dstStride2[4] = {dstStride[0], 0, 0, 0}; + const int dstStride2[4] = {dstStride[0], 0, 0, 0}; uint8_t *dst2[4] = {dst[0], 0, 0, 0}; int x, y, h, w; unsigned char *bottom; @@ -849,7 +849,7 @@ static void ffmpeg_postprocess(struct anim *anim) else { int *dstStride = anim->pFrameRGB->linesize; uint8_t **dst = anim->pFrameRGB->data; - int dstStride2[4] = {-dstStride[0], 0, 0, 0}; + const int dstStride2[4] = {-dstStride[0], 0, 0, 0}; uint8_t *dst2[4] = {dst[0] + (anim->y - 1) * dstStride[0], 0, 0, 0}; sws_scale(anim->img_convert_ctx, diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index dc7a9594f4f..5d72066675b 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -306,8 +306,8 @@ static TIFF *imb_tiff_client_open(ImbTIFFMemFile *memFile, const unsigned char * #define IMB_TIFF_NCB 4 /* number of comparison bytes used */ int imb_is_a_tiff(const unsigned char *mem) { - char big_endian[IMB_TIFF_NCB] = {0x4d, 0x4d, 0x00, 0x2a}; - char lil_endian[IMB_TIFF_NCB] = {0x49, 0x49, 0x2a, 0x00}; + const char big_endian[IMB_TIFF_NCB] = {0x4d, 0x4d, 0x00, 0x2a}; + const char lil_endian[IMB_TIFF_NCB] = {0x49, 0x49, 0x2a, 0x00}; return ((memcmp(big_endian, mem, IMB_TIFF_NCB) == 0) || (memcmp(lil_endian, mem, IMB_TIFF_NCB) == 0)); diff --git a/source/blender/imbuf/intern/util_gpu.c b/source/blender/imbuf/intern/util_gpu.c index c52f671f59f..1a46572fb20 100644 --- a/source/blender/imbuf/intern/util_gpu.c +++ b/source/blender/imbuf/intern/util_gpu.c @@ -186,7 +186,7 @@ void IMB_update_gpu_texture_sub(GPUTexture *tex, bool use_premult) { const bool do_rescale = (ibuf->x != w || ibuf->y != h); - int size[2] = {w, h}; + const int size[2] = {w, h}; eGPUDataFormat data_format; eGPUTextureFormat tex_format; @@ -208,7 +208,7 @@ void IMB_update_gpu_texture_sub(GPUTexture *tex, GPUTexture *IMB_create_gpu_texture(ImBuf *ibuf, bool use_high_bitdepth, bool use_premult) { GPUTexture *tex = NULL; - int size[2] = {GPU_texture_size_with_limit(ibuf->x), GPU_texture_size_with_limit(ibuf->y)}; + const int size[2] = {GPU_texture_size_with_limit(ibuf->x), GPU_texture_size_with_limit(ibuf->y)}; bool do_rescale = (ibuf->x != size[0]) || (ibuf->y != size[1]); #ifdef WITH_DDS |