]> granicus.if.org Git - file/commitdiff
lint fixes
authorChristos Zoulas <christos@zoulas.com>
Fri, 19 Oct 2018 00:26:26 +0000 (00:26 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 19 Oct 2018 00:26:26 +0000 (00:26 +0000)
src/apprentice.c
src/compress.c
src/file.h
src/is_json.c

index 2a8d4dce87b4e350af76276fac96d3fbbaf89db4..edc411b181d5a3752a257a29fe636999d5720ec0 100644 (file)
@@ -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;
 }
index d229219d2361a6a2093f0dba768bcca0870f4d42..87e757278fa5001c55c1128285b9dcc68f255e24 100644 (file)
@@ -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;
index ce2ff7d9970bed537a788aec2cd1955050c09b71..190f3babd4618042e6ce513def0874b6782feac7 100644 (file)
@@ -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<T>(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
 
index b2acc38e1ebb40174be22fa02bd37b51d19a60b1..a8a6eca79313c992b54b20b137c7c12d39eb20b2 100644 (file)
@@ -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 <string.h>
@@ -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