diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 16:52:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 18:07:59 +0300 |
commit | 2410797ab15d08e5138b8cf10d8f8246513935af (patch) | |
tree | 7b256ebb075babe33fc307c8b536c48b24bbd4ee /source/blender/imbuf/intern/targa.c | |
parent | 03d8907ca7564c88c9f5357be93a74adbc638665 (diff) |
ImBuf: cleanup, use const for memory passed in
Diffstat (limited to 'source/blender/imbuf/intern/targa.c')
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 40dcdc9d24a..617fdab0618 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -314,7 +314,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags) } -static int checktarga(TARGA *tga, unsigned char *mem) +static int checktarga(TARGA *tga, const unsigned char *mem) { tga->numid = mem[0]; tga->maptyp = mem[1]; @@ -350,7 +350,7 @@ static int checktarga(TARGA *tga, unsigned char *mem) return 1; } -int imb_is_a_targa(unsigned char *buf) +int imb_is_a_targa(const unsigned char *buf) { TARGA tga; @@ -372,9 +372,9 @@ static void complete_partial_load(struct ImBuf *ibuf, unsigned int *rect) } } -static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size, int psize) +static void decodetarga(struct ImBuf *ibuf, const unsigned char *mem, size_t mem_size, int psize) { - unsigned char *mem_end = mem + mem_size; + const unsigned char *mem_end = mem + mem_size; int count, col, size; unsigned int *rect; uchar *cp = (uchar *) &col; @@ -490,9 +490,9 @@ partial_load: complete_partial_load(ibuf, rect); } -static void ldtarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size, int psize) +static void ldtarga(struct ImBuf *ibuf, const unsigned char *mem, size_t mem_size, int psize) { - unsigned char *mem_end = mem + mem_size; + const unsigned char *mem_end = mem + mem_size; int col, size; unsigned int *rect; uchar *cp = (uchar *) &col; @@ -550,7 +550,7 @@ partial_load: } -ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags, char colorspace[IM_MAX_SPACE]) +ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char colorspace[IM_MAX_SPACE]) { TARGA tga; struct ImBuf *ibuf; |