Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-03 11:37:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-03 11:37:38 +0400
commitd248f94cf8b3a715297f3e512d0b10c7d7b7a0c1 (patch)
tree71275d90db69d9f434d69bc0422486dd35830fca /source/blender/imbuf/intern
parentca6fa937d498691faf77fa58f7c6c4128ac05866 (diff)
add endian switch functions to replace macros SWITCH_INT/LONG/SHORT, with BLI_endian_switch_int32/int64/float/double...
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r--source/blender/imbuf/intern/indexer.c9
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c11
2 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 4108f0d89d7..702e9872a91 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -31,6 +31,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
+#include "BLI_endian_switch.h"
#include "BLI_string.h"
#include "BLI_path_util.h"
#include "BLI_fileops.h"
@@ -208,10 +209,10 @@ struct anim_index *IMB_indexer_open(const char *name)
if (((ENDIAN_ORDER == B_ENDIAN) != (header[8] == 'V'))) {
for (i = 0; i < idx->num_entries; i++) {
- SWITCH_INT(idx->entries[i].frameno);
- SWITCH_INT64(idx->entries[i].seek_pos);
- SWITCH_INT64(idx->entries[i].seek_pos_dts);
- SWITCH_INT64(idx->entries[i].pts);
+ BLI_endian_switch_int32(&idx->entries[i].frameno);
+ BLI_endian_switch_int64((int64_t *)&idx->entries[i].seek_pos);
+ BLI_endian_switch_int64((int64_t *)&idx->entries[i].seek_pos_dts);
+ BLI_endian_switch_int64((int64_t *)&idx->entries[i].pts);
}
}
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;