bsdsfv-1.18-64bit.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. Index: bsdsfv/bsdsfv.c
  2. ===================================================================
  3. --- bsdsfv.orig/bsdsfv.c
  4. +++ bsdsfv/bsdsfv.c
  5. @@ -59,10 +59,10 @@ typedef struct sfvtable {
  6. #include <sys/stat.h>
  7. #include <sys/mman.h>
  8. #include <dirent.h>
  9. +#include <inttypes.h>
  10. -
  11. -long
  12. -UpdateCRC(unsigned long CRC, const char *buffer, long count)
  13. +int32_t
  14. +UpdateCRC(uint32_t CRC, const char *buffer, int32_t count)
  15. {
  16. /*
  17. * Note: if you want to know how CRC32-checking works, I
  18. @@ -70,7 +70,7 @@ UpdateCRC(unsigned long CRC, const char
  19. * There is not much you can change in this function, so
  20. * if you need a CRC32-check yourself, feel free to rip.
  21. */
  22. - unsigned long CRCTABLE[] = {
  23. + uint32_t CRCTABLE[] = {
  24. 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
  25. 0x706af48f,
  26. 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e,
  27. @@ -175,13 +175,13 @@ UpdateCRC(unsigned long CRC, const char
  28. -long
  29. +int32_t
  30. GetFileCRC(char *filename)
  31. {
  32. - unsigned long crc = 0xffffffff;
  33. + uint32_t crc = 0xffffffff;
  34. FILE *f;
  35. - long totalread = 0;
  36. - long localread;
  37. + int32_t totalread = 0;
  38. + int32_t localread;
  39. /*
  40. * Note: different buffer sizes may result in noticable
  41. @@ -306,7 +306,7 @@ main(int argc, char *argv[])
  42. FILE *missingfile;
  43. DIR *dirp;
  44. struct dirent *dp;
  45. - long mycrc;
  46. + int32_t mycrc;
  47. int cnt;
  48. int dothisone;
  49. char cfname[FNAMELEN];
  50. @@ -487,8 +487,8 @@ main(int argc, char *argv[])
  51. printf("Adding file: %s ... ", cfname);
  52. fflush(stdout);
  53. mycrc = GetFileCRC(cfname);
  54. - printf("CRC = 0x%08lX\n", mycrc);
  55. - sprintf(sfvline, "%s %08lX", cfname, mycrc);
  56. + printf("CRC = 0x%08" PRIX32 "\n", mycrc);
  57. + sprintf(sfvline, "%s %08" PRIX32, cfname, mycrc);
  58. // uncomment next 2 lines to
  59. // convert filename to upper case, for whatever reason
  60. @@ -516,7 +516,7 @@ main(int argc, char *argv[])
  61. printf("Testing %s ... ", cfname);
  62. fflush(stdout);
  63. mycrc = GetFileCRC(cfname);
  64. - printf("local = 0x%08lX, listed = ", mycrc);
  65. + printf("local = 0x%08" PRIX32 ", listed = ", mycrc);
  66. fflush(stdout);
  67. sfvfile = fopen(sfvname, "rt");
  68. @@ -675,7 +675,7 @@ main(int argc, char *argv[])
  69. mycrc = GetFileCRC(dp->d_name);
  70. - printf("local = 0x%08lX ... ", mycrc);
  71. + printf("local = 0x%08" PRIX32 " ... ", mycrc);
  72. if (mycrc == sfvTable[cnt].crc) {
  73. printf("OK\n");