cherry-pick.FILE5_35-2-g8d68fb4f.lint-fixes.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Subject: Lint fixes
  2. Origin: FILE5_35-2-g8d68fb4f <https://github.com/file/file/commit/FILE5_35-2-g8d68fb4f>
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Fri Oct 19 00:26:26 2018 +0000
  5. --- a/src/apprentice.c
  6. +++ b/src/apprentice.c
  7. @@ -293,9 +293,9 @@
  8. private off_t
  9. maxoff_t(void) {
  10. - if (sizeof(off_t) == sizeof(int))
  11. + if (/*CONSTCOND*/sizeof(off_t) == sizeof(int))
  12. return CAST(off_t, INT_MAX);
  13. - if (sizeof(off_t) == sizeof(long))
  14. + if (/*CONSTCOND*/sizeof(off_t) == sizeof(long))
  15. return CAST(off_t, LONG_MAX);
  16. return 0x7fffffff;
  17. }
  18. --- a/src/compress.c
  19. +++ b/src/compress.c
  20. @@ -422,7 +422,7 @@
  21. #else
  22. {
  23. int te;
  24. - int ou = umask(0);
  25. + mode_t ou = umask(0);
  26. tfd = mkstemp(buf);
  27. (void)umask(ou);
  28. te = errno;
  29. --- a/src/file.h
  30. +++ b/src/file.h
  31. @@ -382,7 +382,7 @@
  32. #define CCAST(T, b) const_cast<T>(b)
  33. #else
  34. #define CAST(T, b) ((T)(b))
  35. -#define RCAST(T, b) ((T)(b))
  36. +#define RCAST(T, b) ((T)(void *)(b))
  37. #define CCAST(T, b) ((T)(uintptr_t)(b))
  38. #endif
  39. --- a/src/is_json.c
  40. +++ b/src/is_json.c
  41. @@ -44,7 +44,7 @@
  42. #define DPRINTF(a, b, c) \
  43. printf("%s [%.2x/%c] %.20s\n", (a), *(b), *(b), (const char *)(c))
  44. #else
  45. -#define DPRINTF(a, b, c) (void)0
  46. +#define DPRINTF(a, b, c) do { } while (/*CONSTCOND*/0)
  47. #endif
  48. #define JSON_ARRAY 0