From 20e15ec4cce122753dafc7c13ad8ed3ce17c624d Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 5 Mar 2007 02:41:29 +0000 Subject: [PATCH] patches from NetBSD for LP64 problems. --- src/compress.c | 12 ++++++------ src/print.c | 8 ++++---- src/softmagic.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compress.c b/src/compress.c index 2c378e71..2ccbef6e 100644 --- a/src/compress.c +++ b/src/compress.c @@ -55,7 +55,7 @@ #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.50 2007/03/01 22:14:54 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.51 2007/03/05 02:41:29 christos Exp $") #endif private struct { @@ -170,12 +170,12 @@ sread(int fd, void *buf, size_t n, int canbepipe) goto nocheck; #ifdef FIONREAD - if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1) || (t == 0)) { + if ((canbepipe && (ioctl(fd, FIONREAD, &t) == -1)) || (t == 0)) { #ifdef FD_ZERO for (cnt = 0;; cnt++) { fd_set check; struct timeval tout = {0, 100 * 1000}; - int rv; + int selrv; FD_ZERO(&check); FD_SET(fd, &check); @@ -184,11 +184,11 @@ sread(int fd, void *buf, size_t n, int canbepipe) * Avoid soft deadlock: do not read if there * is nothing to read from sockets and pipes. */ - rv = select(fd + 1, &check, NULL, NULL, &tout); - if (rv == -1) { + selrv = select(fd + 1, &check, NULL, NULL, &tout); + if (selrv == -1) { if (errno == EINTR || errno == EAGAIN) continue; - } else if (rv == 0 && cnt >= 5) { + } else if (selrv == 0 && cnt >= 5) { return 0; } else break; diff --git a/src/print.c b/src/print.c index 6b019eba..d1d1ec10 100644 --- a/src/print.c +++ b/src/print.c @@ -41,7 +41,7 @@ #include #ifndef lint -FILE_RCSID("@(#)$File: print.c,v 1.58 2007/01/16 14:58:48 ljt Exp $") +FILE_RCSID("@(#)$File: print.c,v 1.59 2007/03/05 02:41:29 christos Exp $") #endif /* lint */ #define SZOF(a) (sizeof(a) / sizeof(a[0])) @@ -52,8 +52,8 @@ file_mdump(struct magic *m) { private const char optyp[] = { FILE_OPS }; - (void) fprintf(stderr, "[%zu", m->lineno); - (void) fprintf(stderr, ">>>>>>>> %d" + 8 - (m->cont_level & 7), + (void) fprintf(stderr, "[%u", m->lineno); + (void) fprintf(stderr, ">>>>>>>> %u" + 8 - (m->cont_level & 7), m->offset); if (m->flag & INDIR) { @@ -63,7 +63,7 @@ file_mdump(struct magic *m) file_names[m->in_type] : "*bad*"); if (m->in_op & FILE_OPINVERSE) (void) fputc('~', stderr); - (void) fprintf(stderr, "%c%d),", + (void) fprintf(stderr, "%c%u),", ((m->in_op & FILE_OPS_MASK) < SZOF(optyp)) ? optyp[m->in_op & FILE_OPS_MASK] : '?', m->in_offset); diff --git a/src/softmagic.c b/src/softmagic.c index a6b1bacd..f49cefc3 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -38,7 +38,7 @@ #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.96 2007/03/05 02:41:29 christos Exp $") #endif /* lint */ private int match(struct magic_set *, struct magic *, uint32_t, @@ -336,7 +336,7 @@ private int32_t mprint(struct magic_set *ms, struct magic *m) { uint64_t v; - int32_t t = 0; + int64_t t = 0; char buf[512]; union VALUETYPE *p = &ms->ms_value; -- 2.50.1