]> granicus.if.org Git - file/commitdiff
more lint fixes
authorChristos Zoulas <christos@zoulas.com>
Fri, 19 Oct 2018 00:33:04 +0000 (00:33 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 19 Oct 2018 00:33:04 +0000 (00:33 +0000)
src/file.h
src/readelf.c
src/softmagic.c

index 190f3babd4618042e6ce513def0874b6782feac7..d26b25cc575451b159a66fc69cdfa7c93255299e 100644 (file)
@@ -27,7 +27,7 @@
  */
 /*
  * file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.200 2018/10/19 00:26:26 christos Exp $
+ * @(#)$File: file.h,v 1.201 2018/10/19 00:33:04 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)(void *)(b))
+#define RCAST(T, b)    ((T)(uintptr_t)(b))
 #define CCAST(T, b)    ((T)(uintptr_t)(b))
 #endif
 
index 0660b634968e2a17cea9e04fa67c3778fb7a46bb..4f4103a1d1aa57659999bbe21b7f1c31b0bfc473 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.155 2018/10/19 00:26:08 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.156 2018/10/19 00:33:04 christos Exp $")
 #endif
 
 #ifdef BUILTIN_ELF
@@ -786,7 +786,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                        pidoff = argoff + 81 + 2;
                        if (doff + pidoff + 4 <= size) {
                                if (file_printf(ms, ", pid=%u",
-                                   elf_getu32(swap, *RCAST(uint32 *, (nbuf +
+                                   elf_getu32(swap, *RCAST(uint32_t *, (nbuf +
                                    doff + pidoff)))) == -1)
                                        return 1;
                        }
index 9cdbe9afe9cec4cbca01319cc17107dfb7e8f453..c1ec262444a28b38d64a13431f99880210542fed 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.271 2018/10/15 16:29:16 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.272 2018/10/19 00:33:04 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1435,7 +1435,7 @@ msetoffset(struct magic_set *ms, struct magic *m, struct buffer *bb,
                if ((size_t)-m->offset > b->elen)
                        return -1;
                buffer_init(bb, -1, b->ebuf, b->elen);
-               ms->eoffset = ms->offset = b->elen + m->offset;
+               ms->eoffset = ms->offset = (int32_t)(b->elen + m->offset);
        } else {
                if (cont_level == 0) {
 normal: