diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 22:33:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 22:33:04 +0300 |
commit | 968351d916312284f79952e350ca3c1ffad6f6d1 (patch) | |
tree | 6c2fee4f5decf06533a50931d3f5caed8f4c0e51 /source/blender/blenlib/intern/endian_switch.c | |
parent | 17ebbc06e2ea6324c27e0a10ae088c271b66d0cc (diff) |
Minor changes for more efficient endian switching
Diffstat (limited to 'source/blender/blenlib/intern/endian_switch.c')
-rw-r--r-- | source/blender/blenlib/intern/endian_switch.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/source/blender/blenlib/intern/endian_switch.c b/source/blender/blenlib/intern/endian_switch.c index 892d7396011..b1dcdffba01 100644 --- a/source/blender/blenlib/intern/endian_switch.c +++ b/source/blender/blenlib/intern/endian_switch.c @@ -32,9 +32,8 @@ void BLI_endian_switch_int16_array(short *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_int16(val--); + BLI_endian_switch_int16(val++); } } } @@ -43,9 +42,8 @@ void BLI_endian_switch_uint16_array(unsigned short *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_uint16(val--); + BLI_endian_switch_uint16(val++); } } } @@ -54,9 +52,8 @@ void BLI_endian_switch_int32_array(int *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_int32(val--); + BLI_endian_switch_int32(val++); } } } @@ -65,9 +62,8 @@ void BLI_endian_switch_uint32_array(unsigned int *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_uint32(val--); + BLI_endian_switch_uint32(val++); } } } @@ -76,9 +72,8 @@ void BLI_endian_switch_float_array(float *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_float(val--); + BLI_endian_switch_float(val++); } } } @@ -87,9 +82,8 @@ void BLI_endian_switch_int64_array(int64_t *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_int64(val--); + BLI_endian_switch_int64(val++); } } } @@ -98,9 +92,8 @@ void BLI_endian_switch_uint64_array(uint64_t *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_uint64(val--); + BLI_endian_switch_uint64(val++); } } } @@ -110,9 +103,8 @@ void BLI_endian_switch_double_array(double *val, const int size) { if (size > 0) { int i = size; - val = val + (size - 1); while (i--) { - BLI_endian_switch_double(val--); + BLI_endian_switch_double(val++); } } } |