Make the magic type field explicitly unsigned and fix comparisons of this
value appropriately. Fixes warnings on systems where char is naturally unsigned.
This commit is contained in:
parent
f382e91b5e
commit
23309c9e22
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file.h,v 1.12 1998/09/20 15:27:16 christos Exp $ */
|
||||
/* $NetBSD: file.h,v 1.13 1998/09/30 18:51:13 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* file.h - definitions for file(1) program
|
||||
@ -48,12 +48,12 @@ struct magic {
|
||||
#define ADD 4 /* if '>&' appears, */
|
||||
short cont_level; /* level of ">" */
|
||||
struct {
|
||||
char type; /* byte short long */
|
||||
unsigned char type; /* byte short long */
|
||||
int32 offset; /* offset from indirection */
|
||||
} in;
|
||||
int32 offset; /* offset to magic number */
|
||||
unsigned char reln; /* relation (0=eq, '>'=gt, etc) */
|
||||
char type; /* int, short, long or string. */
|
||||
unsigned char type; /* int, short, long or string. */
|
||||
char vallen; /* length of string value, if any */
|
||||
#define BYTE 1
|
||||
#define SHORT 2
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: print.c,v 1.14 1998/09/20 15:27:16 christos Exp $ */
|
||||
/* $NetBSD: print.c,v 1.15 1998/09/30 18:51:13 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* print.c - debugging printout routines
|
||||
@ -45,7 +45,7 @@
|
||||
#if 0
|
||||
FILE_RCSID("@(#)Id: print.c,v 1.26 1998/06/27 13:57:23 christos Exp ")
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.14 1998/09/20 15:27:16 christos Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.15 1998/09/30 18:51:13 thorpej Exp $");
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
@ -65,15 +65,15 @@ struct magic *m;
|
||||
|
||||
if (m->flag & INDIR)
|
||||
(void) fprintf(stderr, "(%s,%d),",
|
||||
(m->in.type >= 0 && m->in.type < SZOF(typ)) ?
|
||||
typ[(unsigned char) m->in.type] :
|
||||
"*bad*",
|
||||
/* Note: in.type is unsigned */
|
||||
(m->in.type < SZOF(typ)) ?
|
||||
typ[m->in.type] : "*bad*",
|
||||
m->in.offset);
|
||||
|
||||
(void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
|
||||
(m->type >= 0 && m->type < SZOF(typ)) ?
|
||||
typ[(unsigned char) m->type] :
|
||||
"*bad*");
|
||||
/* Note: type is unsigned */
|
||||
(m->type < SZOF(typ)) ?
|
||||
typ[(unsigned char) m->type] : "*bad*");
|
||||
if (m->mask != ~((uint32)0))
|
||||
(void) fprintf(stderr, " & %.8x", m->mask);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user