Skip to content
Snippets Groups Projects
Commit d71008ff authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

wasn't directly decrementing loop variable, use better names in swap_loop macro.

parent 9d65b220
Branches
Tags
1 merge request!294Buffered cell_split
...@@ -32,15 +32,16 @@ ...@@ -32,15 +32,16 @@
#include <altivec.h> #include <altivec.h>
#endif #endif
/* Macro for in-place swap of two values a and b of type t. */ /* Macro for in-place swap of two values a and b of type t. a and b are
#define swap_loop(t, a, b, c) \ assumed to be of type char* so that the pointer arithmetic works. */
while (c >= sizeof(t)) { \ #define swap_loop(type, a, b, count) \
register t temp = *(t *)a; \ while (count >= sizeof(type)) { \
*(t *)a = *(t *)b; \ register type temp = *(type *)a; \
*(t *)b = temp; \ *(type *)a = *(type *)b; \
a += sizeof(t); \ *(type *)b = temp; \
b += sizeof(t); \ a += sizeof(type); \
bytes -= sizeof(t); \ b += sizeof(type); \
count -= sizeof(type); \
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment