~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/dispatch.c, etc.: Check that `rdrand' works.
[catacomb]
/
symm
/
blkc.h
diff --git
a/symm/blkc.h
b/symm/blkc.h
index
d6e3da0
..
ff631f0
100644
(file)
--- a/
symm/blkc.h
+++ b/
symm/blkc.h
@@
-174,7
+174,7
@@
unsigned _i; BLKC_W(w); unsigned long _x = x; \
for (_i = 0; _i < PRE##_BLKSZ / 4; _i++) { \
*_w++ = U32(_x); \
unsigned _i; BLKC_W(w); unsigned long _x = x; \
for (_i = 0; _i < PRE##_BLKSZ / 4; _i++) { \
*_w++ = U32(_x); \
- _x = ((_x & ~
MASK32) >> 16) >> 16;
\
+ _x = ((_x & ~
(unsigned long)MASK32) >> 16) >> 16;
\
} \
} while (0)
} \
} while (0)
@@
-182,7
+182,7
@@
unsigned _i; BLKC_W(w); unsigned long _x = x; _w += PRE##_BLKSZ / 4; \
for (_i = 0; _i < PRE##_BLKSZ / 4; _i++) { \
*--_w = U32(_x); \
unsigned _i; BLKC_W(w); unsigned long _x = x; _w += PRE##_BLKSZ / 4; \
for (_i = 0; _i < PRE##_BLKSZ / 4; _i++) { \
*--_w = U32(_x); \
- _x = ((_x & ~
MASK32) >> 16) >> 16;
\
+ _x = ((_x & ~
(unsigned long)MASK32) >> 16) >> 16;
\
} \
} while (0)
} \
} while (0)
@@
-260,7
+260,9
@@
#include <mLib/quis.h>
#include <mLib/testrig.h>
#include <mLib/quis.h>
#include <mLib/testrig.h>
-#define BLKC_VERIFY(PRE, pre) \
+#define BLKC_VERIFY(PRE, pre) BLKC_VERIFYX(PRE, pre, #pre)
+
+#define BLKC_VERIFYX(PRE, pre, name) \
\
static int pre##_verify(dstr *v) \
{ \
\
static int pre##_verify(dstr *v) \
{ \
@@
-316,26
+318,32
@@
static int pre##_verify(dstr *v) \
return (ok); \
}
return (ok); \
}
-#define BLKC_TEST(PRE, pre) \
+#define BLKC_TESTDEFS(PRE, pre) BLKC_TESTDEFSX(PRE, pre, #pre)
+
+#define BLKC_TESTDEFSX(PRE, pre, name) \
+ { name, pre##_verify, { &type_hex, &type_hex, &type_hex, 0 } },
+
+#define BLKC_TESTX(PRE, pre, name, fname) \
\
\
-BLKC_VERIFY
(PRE, pre)
\
+BLKC_VERIFY
X(PRE, pre, name)
\
\
static const test_chunk defs[] = { \
\
static const test_chunk defs[] = { \
-
{ #pre, pre##_verify, { &type_hex, &type_hex, &type_hex, 0 } },
\
+
BLKC_TESTDEFSX(PRE, pre, name)
\
{ 0, 0, { 0 } } \
}; \
\
int main(int argc, char *argv[]) \
{ \
{ 0, 0, { 0 } } \
}; \
\
int main(int argc, char *argv[]) \
{ \
- test_run(argc, argv, defs, SRCDIR"/t/"
#pre);
\
+ test_run(argc, argv, defs, SRCDIR"/t/"
fname);
\
return (0); \
}
#else
return (0); \
}
#else
-# define BLKC_VERIFY(PRE, pre)
-# define BLKC_TEST(PRE, pre)
+# define BLKC_TESTX(PRE, pre, name, fname)
#endif
#endif
+#define BLKC_TEST(PRE, pre) BLKC_TESTX(PRE, pre, #pre, #pre)
+
/*----- That's all, folks -------------------------------------------------*/
#ifdef __cplusplus
/*----- That's all, folks -------------------------------------------------*/
#ifdef __cplusplus