From d248f94cf8b3a715297f3e512d0b10c7d7b7a0c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Sep 2012 07:37:38 +0000 Subject: add endian switch functions to replace macros SWITCH_INT/LONG/SHORT, with BLI_endian_switch_int32/int64/float/double... --- source/blender/imbuf/intern/thumbs_blend.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/imbuf/intern/thumbs_blend.c') diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c index afef2365de4..1a921c4844c 100644 --- a/source/blender/imbuf/intern/thumbs_blend.c +++ b/source/blender/imbuf/intern/thumbs_blend.c @@ -29,7 +29,10 @@ #include "zlib.h" +#include "MEM_guardedalloc.h" + #include "BLI_utildefines.h" +#include "BLI_endian_switch.h" #include "BLI_fileops.h" #include "BKE_utildefines.h" @@ -39,8 +42,6 @@ #include "IMB_imbuf.h" #include "IMB_thumbs.h" -#include "MEM_guardedalloc.h" - /* extracts the thumbnail from between the 'REND' and the 'GLOB' * chunks of the header, don't use typical blend loader because its too slow */ @@ -78,7 +79,7 @@ static ImBuf *loadblend_thumb(gzFile gzfile) while (gzread(gzfile, bhead, sizeof_bhead) == sizeof_bhead) { if (endian_switch) - SWITCH_INT(bhead[1]); /* length */ + BLI_endian_switch_int32(&bhead[1]); /* length */ if (bhead[0] == REND) { gzseek(gzfile, bhead[1], SEEK_CUR); /* skip to the next */ @@ -97,8 +98,8 @@ static ImBuf *loadblend_thumb(gzFile gzfile) return NULL; if (endian_switch) { - SWITCH_INT(size[0]); - SWITCH_INT(size[1]); + BLI_endian_switch_int32(&size[0]); + BLI_endian_switch_int32(&size[1]); } /* length */ bhead[1] -= sizeof(int) * 2; -- cgit v1.2.3