From: Christos Zoulas Date: Fri, 19 Oct 2018 00:26:26 +0000 (+0000) Subject: lint fixes X-Git-Tag: FILE5_36~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d68fb4f0577e6ad646ff12757fa3acdfde9a53d;p=file lint fixes --- diff --git a/src/apprentice.c b/src/apprentice.c index 2a8d4dce..edc411b1 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.281 2018/10/10 17:41:10 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.282 2018/10/19 00:26:26 christos Exp $") #endif /* lint */ #include "magic.h" @@ -293,9 +293,9 @@ get_type(const struct type_tbl_s *tbl, const char *l, const char **t) private off_t maxoff_t(void) { - if (sizeof(off_t) == sizeof(int)) + if (/*CONSTCOND*/sizeof(off_t) == sizeof(int)) return CAST(off_t, INT_MAX); - if (sizeof(off_t) == sizeof(long)) + if (/*CONSTCOND*/sizeof(off_t) == sizeof(long)) return CAST(off_t, LONG_MAX); return 0x7fffffff; } diff --git a/src/compress.c b/src/compress.c index d229219d..87e75727 100644 --- a/src/compress.c +++ b/src/compress.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.113 2018/10/15 16:29:16 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.114 2018/10/19 00:26:26 christos Exp $") #endif #include "magic.h" @@ -422,7 +422,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf, #else { int te; - int ou = umask(0); + mode_t ou = umask(0); tfd = mkstemp(buf); (void)umask(ou); te = errno; diff --git a/src/file.h b/src/file.h index ce2ff7d9..190f3bab 100644 --- a/src/file.h +++ b/src/file.h @@ -27,7 +27,7 @@ */ /* * file.h - definitions for file(1) program - * @(#)$File: file.h,v 1.199 2018/10/15 16:29:16 christos Exp $ + * @(#)$File: file.h,v 1.200 2018/10/19 00:26:26 christos Exp $ */ #ifndef __file_h__ @@ -382,7 +382,7 @@ struct mlist { #define CCAST(T, b) const_cast(b) #else #define CAST(T, b) ((T)(b)) -#define RCAST(T, b) ((T)(b)) +#define RCAST(T, b) ((T)(void *)(b)) #define CCAST(T, b) ((T)(uintptr_t)(b)) #endif diff --git a/src/is_json.c b/src/is_json.c index b2acc38e..a8a6eca7 100644 --- a/src/is_json.c +++ b/src/is_json.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: is_json.c,v 1.11 2018/10/15 16:29:16 christos Exp $") +FILE_RCSID("@(#)$File: is_json.c,v 1.12 2018/10/19 00:26:26 christos Exp $") #endif #include @@ -44,7 +44,7 @@ FILE_RCSID("@(#)$File: is_json.c,v 1.11 2018/10/15 16:29:16 christos Exp $") #define DPRINTF(a, b, c) \ printf("%s [%.2x/%c] %.20s\n", (a), *(b), *(b), (const char *)(c)) #else -#define DPRINTF(a, b, c) (void)0 +#define DPRINTF(a, b, c) do { } while (/*CONSTCOND*/0) #endif #define JSON_ARRAY 0