cherry-pick.FILE5_35-2-g8d68fb4f.lint-fixes.patch 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. @@ -297,9 +297,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. @@ -397,7 +397,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. @@ -369,7 +369,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