From: Christos Zoulas Date: Wed, 1 Nov 2006 20:16:43 +0000 (+0000) Subject: cast to quad types to long long, so that we don't have to use the ugly PRI X-Git-Tag: FILE4_19~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42a42d34c8d092437d99268412c8862cf700f6c8;p=file cast to quad types to long long, so that we don't have to use the ugly PRI macros which might not exist on all machines. --- diff --git a/src/print.c b/src/print.c index e9cd7abb..96046922 100644 --- a/src/print.c +++ b/src/print.c @@ -41,7 +41,7 @@ #include #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: diff --git a/src/softmagic.c b/src/softmagic.c index 894c05ce..731e7d53 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -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: