base/regdump.h: Pass cooked register index to `REGDEF_GPX86_COMMON'.
[catacomb] / symm / mars-mktab.c
index 750f727..53ce0f7 100644 (file)
@@ -154,10 +154,10 @@ void sha_hash(sha_ctx *ctx, const void *buf, size_t sz)
 
   {
     uint32 _l = ((uint32) ((_bsz) & MASK32));
-    uint32 _h = ((_bsz & ~MASK32) >> 16) >> 16;
+    uint32 _h = ((_bsz & ~(size_t)MASK32) >> 16) >> 16;
     _bctx->nh += _h;
     _bctx->nl += _l;
-    if (_bctx->nl < _l || _bctx->nl & ~MASK32)
+    if (_bctx->nl < _l || _bctx->nl & ~(uint32)MASK32)
       _bctx->nh++;
   }
   if (_bctx->off + _bsz < SHA_BUFSZ) {
@@ -283,27 +283,24 @@ int main(void)
  * MARS tables [generated]\n\
  */\n\
 \n\
-#ifndef CATACOMB_MARS_TAB_H\n\
-#define CATACOMB_MARS_TAB_H\n\
+#include <mLib/bits.h>\n\
 ");
 
   fputs("\
 /* --- The S-box --- */\n\
 \n\
-#define MARS_S {                                                       \\\n\
+const uint32 mars_s[] = {\n\
   ", stdout);
   for (i = 0; i < 512; i++) {
     printf("0x%08lx", (unsigned long)s[i]);
     if (i == 511)
-      fputs("                  \\\n}\n\n", stdout);
+      fputs("\n};\n", stdout);
     else if (i % 4 == 3)
-      fputs(",                 \\\n  ", stdout);
+      fputs(",\n  ", stdout);
     else
       fputs(", ", stdout);
   }
 
-  puts("#endif");
-
   if (fclose(stdout)) {
     fprintf(stderr, "error writing data\n");
     exit(EXIT_FAILURE);