checkasm: Explicitly declare function prototypes
[ffmpeg.git] / tests / checkasm / bswapdsp.c
index 7b1566b..829ebaa 100644 (file)
 #include "checkasm.h"
 #include "libavcodec/bswapdsp.h"
 #include "libavutil/common.h"
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 
 #define BUF_SIZE 512
 
-#define randomize_buffers()\
-    do {\
-        int i;\
-        for (i = 0; i < BUF_SIZE; i += 4) {\
-            uint32_t r = rnd();\
-            AV_WN32A(src0+i, r);\
-            AV_WN32A(src1+i, r);\
-            r = rnd();\
-            AV_WN32A(dst0+i, r);\
-            AV_WN32A(dst1+i, r);\
-        }\
+#define randomize_buffers()                 \
+    do {                                    \
+        int i;                              \
+        for (i = 0; i < BUF_SIZE; i += 4) { \
+            uint32_t r = rnd();             \
+            AV_WN32A(src0 + i, r);          \
+            AV_WN32A(src1 + i, r);          \
+            r = rnd();                      \
+            AV_WN32A(dst0 + i, r);          \
+            AV_WN32A(dst1 + i, r);          \
+        }                                   \
     } while (0)
 
-#define check_bswap(type)\
-    do {\
-        int w;\
-        for (w = 0; w < BUF_SIZE/sizeof(type); w++) {\
-            int offset = (BUF_SIZE/sizeof(type) - w) & 15; /* Test various alignments */\
-            randomize_buffers();\
-            call_ref((type*)dst0+offset, (type*)src0+offset, w);\
-            call_new((type*)dst1+offset, (type*)src1+offset, w);\
-            if (memcmp(src0, src1, BUF_SIZE) || memcmp(dst0, dst1, BUF_SIZE))\
-                fail();\
-            bench_new((type*)dst1+offset, (type*)src1+offset, w);\
-        }\
+#define check_bswap(type)                                                                  \
+    do {                                                                                   \
+        int w;                                                                             \
+        declare_func(void, type *dst, const type *src, int w);                             \
+                                                                                           \
+        for (w = 0; w < BUF_SIZE / sizeof(type); w++) {                                    \
+            int offset = (BUF_SIZE / sizeof(type) - w) & 15; /* Test various alignments */ \
+            randomize_buffers();                                                           \
+            call_ref((type *)dst0 + offset, (type *)src0 + offset, w);                     \
+            call_new((type *)dst1 + offset, (type *)src1 + offset, w);                     \
+            if (memcmp(src0, src1, BUF_SIZE) || memcmp(dst0, dst1, BUF_SIZE))              \
+                fail();                                                                    \
+            bench_new((type *)dst1 + offset, (type *)src1 + offset, w);                    \
+        }                                                                                  \
     } while (0)
 
 void checkasm_check_bswapdsp(void)
 {
-    DECLARE_ALIGNED(16, uint8_t, src0)[BUF_SIZE];
-    DECLARE_ALIGNED(16, uint8_t, src1)[BUF_SIZE];
-    DECLARE_ALIGNED(16, uint8_t, dst0)[BUF_SIZE];
-    DECLARE_ALIGNED(16, uint8_t, dst1)[BUF_SIZE];
+    LOCAL_ALIGNED_16(uint8_t, src0, [BUF_SIZE]);
+    LOCAL_ALIGNED_16(uint8_t, src1, [BUF_SIZE]);
+    LOCAL_ALIGNED_16(uint8_t, dst0, [BUF_SIZE]);
+    LOCAL_ALIGNED_16(uint8_t, dst1, [BUF_SIZE]);
     BswapDSPContext h;
 
     ff_bswapdsp_init(&h);