cherry-pick.FILE5_35-3-gc7d910ee.more-lint-fixes.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Subject: More lint fixes
  2. Origin: FILE5_35-3-gc7d910ee <https://github.com/file/file/commit/FILE5_35-3-gc7d910ee>
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Fri Oct 19 00:33:04 2018 +0000
  5. --- a/src/file.h
  6. +++ b/src/file.h
  7. @@ -382,7 +382,7 @@
  8. #define CCAST(T, b) const_cast<T>(b)
  9. #else
  10. #define CAST(T, b) ((T)(b))
  11. -#define RCAST(T, b) ((T)(void *)(b))
  12. +#define RCAST(T, b) ((T)(uintptr_t)(b))
  13. #define CCAST(T, b) ((T)(uintptr_t)(b))
  14. #endif
  15. --- a/src/readelf.c
  16. +++ b/src/readelf.c
  17. @@ -786,7 +786,7 @@
  18. pidoff = argoff + 81 + 2;
  19. if (doff + pidoff + 4 <= size) {
  20. if (file_printf(ms, ", pid=%u",
  21. - elf_getu32(swap, *RCAST(uint32 *, (nbuf +
  22. + elf_getu32(swap, *RCAST(uint32_t *, (nbuf +
  23. doff + pidoff)))) == -1)
  24. return 1;
  25. }
  26. --- a/src/softmagic.c
  27. +++ b/src/softmagic.c
  28. @@ -1435,7 +1435,7 @@
  29. if ((size_t)-m->offset > b->elen)
  30. return -1;
  31. buffer_init(bb, -1, b->ebuf, b->elen);
  32. - ms->eoffset = ms->offset = b->elen + m->offset;
  33. + ms->eoffset = ms->offset = (int32_t)(b->elen + m->offset);
  34. } else {
  35. if (cont_level == 0) {
  36. normal: