]> granicus.if.org Git - file/commitdiff
cast to quad types to long long, so that we don't have to use the ugly PRI
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Nov 2006 20:16:43 +0000 (20:16 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Nov 2006 20:16:43 +0000 (20:16 +0000)
macros which might not exist on all machines.

src/print.c
src/softmagic.c

index e9cd7abb42c5a3f9529ecbb8268a5210f0146182..960469226f99f421ccebe6ec9842c341fbdb70e9 100644 (file)
@@ -41,7 +41,7 @@
 #include <time.h>
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: print.c,v 1.54 2006/10/31 19:37:17 christos Exp $")
+FILE_RCSID("@(#)$Id: print.c,v 1.55 2006/11/01 20:16:43 christos Exp $")
 #endif  /* lint */
 
 #define SZOF(a)        (sizeof(a) / sizeof(a[0]))
@@ -79,7 +79,8 @@ file_mdump(struct magic *m)
                else
                        fputc('?', stderr);
                if (FILE_STRING != m->type || FILE_PSTRING != m->type)
-                       (void) fprintf(stderr, "%.8llx", m->mask);
+                       (void) fprintf(stderr, "%.8llx",
+                           (unsigned long long)m->mask);
                else {
                        if (m->mask & STRING_IGNORE_LOWERCASE) 
                                (void) fputc(CHAR_IGNORE_LOWERCASE, stderr);
@@ -108,7 +109,8 @@ file_mdump(struct magic *m)
                case FILE_BEQUAD:
                case FILE_LEQUAD:
                case FILE_QUAD:
-                       (void) fprintf(stderr, "%lld", m->value.q);
+                       (void) fprintf(stderr, "%lld",
+                           (unsigned long long)m->value.q);
                        break;
                case FILE_PSTRING:
                case FILE_STRING:
index 894c05ce818926d34fd6462522b806581a77fb37..731e7d53b07e7373cd42a19bf951804cf77e815c 100644 (file)
@@ -39,7 +39,7 @@
 
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: softmagic.c,v 1.83 2006/10/31 19:37:17 christos Exp $")
+FILE_RCSID("@(#)$Id: softmagic.c,v 1.84 2006/11/01 20:16:43 christos Exp $")
 #endif /* lint */
 
 private int match(struct magic_set *, struct magic *, uint32_t,
@@ -1405,7 +1405,8 @@ magiccheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
        switch (m->reln) {
        case 'x':
                if ((ms->flags & MAGIC_DEBUG) != 0)
-                       (void) fprintf(stderr, "%llu == *any* = 1\n", v);
+                       (void) fprintf(stderr, "%llu == *any* = 1\n",
+                           (unsigned long long)v);
                matched = 1;
                break;
 
@@ -1413,14 +1414,16 @@ magiccheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
                matched = v != l;
                if ((ms->flags & MAGIC_DEBUG) != 0)
                        (void) fprintf(stderr, "%llu != %llu = %d\n",
-                                      v, l, matched);
+                           (unsigned long long)v, (unsigned long long)l,
+                           matched);
                break;
 
        case '=':
                matched = v == l;
                if ((ms->flags & MAGIC_DEBUG) != 0)
                        (void) fprintf(stderr, "%llu == %llu = %d\n",
-                                      v, l, matched);
+                           (unsigned long long)v, (unsigned long long)l,
+                           matched);
                break;
 
        case '>':
@@ -1428,13 +1431,14 @@ magiccheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
                        matched = v > l;
                        if ((ms->flags & MAGIC_DEBUG) != 0)
                                (void) fprintf(stderr, "%llu > %llu = %d\n",
-                                              v, l, matched);
+                                   (unsigned long long)v,
+                                   (unsigned long long)l, matched);
                }
                else {
                        matched = (int32_t) v > (int32_t) l;
                        if ((ms->flags & MAGIC_DEBUG) != 0)
                                (void) fprintf(stderr, "%lld > %lld = %d\n",
-                                              v, l, matched);
+                                   (long long)v, (long long)l, matched);
                }
                break;
 
@@ -1443,13 +1447,14 @@ magiccheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
                        matched = v < l;
                        if ((ms->flags & MAGIC_DEBUG) != 0)
                                (void) fprintf(stderr, "%llu < %llu = %d\n",
-                                              v, l, matched);
+                                   (unsigned long long)v,
+                                   (unsigned long long)l, matched);
                }
                else {
                        matched = (int32_t) v < (int32_t) l;
                        if ((ms->flags & MAGIC_DEBUG) != 0)
                                (void) fprintf(stderr, "%lld < %lld = %d\n",
-                                              v, l, matched);
+                                      (long long)v, (long long)l, matched);
                }
                break;
 
@@ -1457,14 +1462,16 @@ magiccheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
                matched = (v & l) == l;
                if ((ms->flags & MAGIC_DEBUG) != 0)
                        (void) fprintf(stderr, "((%llx & %llx) == %llx) = %d\n",
-                                      v, l, l, matched);
+                           (unsigned long long)v, (unsigned long long)l,
+                           (unsigned long long)l, matched);
                break;
 
        case '^':
                matched = (v & l) != l;
                if ((ms->flags & MAGIC_DEBUG) != 0)
                        (void) fprintf(stderr, "((%llx & %llx) != %llx) = %d\n",
-                                      v, l, l, matched);
+                           (unsigned long long)v, (unsigned long long)l,
+                           (unsigned long long)l, matched);
                break;
 
        default: