You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
4.4 KiB

  1. From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
  2. Date: Thu, 24 Oct 2013 01:11:21 -0200
  3. Subject: Fix compilation on 64-bit arches
  4. ---
  5. fsck_hfs.tproj/dfalib/BTreePrivate.h | 5 ++++-
  6. fsck_hfs.tproj/dfalib/SControl.c | 8 ++++----
  7. fsck_hfs.tproj/dfalib/SVerify1.c | 14 +++++++-------
  8. fsck_hfs.tproj/dfalib/hfs_endian.c | 2 +-
  9. 4 files changed, 16 insertions(+), 13 deletions(-)
  10. --- a/fsck_hfs.tproj/dfalib/BTreePrivate.h
  11. +++ b/fsck_hfs.tproj/dfalib/BTreePrivate.h
  12. @@ -104,6 +104,9 @@ typedef enum {
  13. ///////////////////////////////////// Types /////////////////////////////////////
  14. +// Forward declaration from Scavenger.h
  15. +struct BTreeExtensionsRec;
  16. +
  17. typedef struct BTreeControlBlock { // fields specific to BTree CBs
  18. UInt8 keyCompareType; /* Key string Comparison Type */
  19. @@ -144,7 +147,7 @@ typedef struct BTreeControlBlock { /
  20. UInt32 numPossibleHints; // Looks like a formated hint
  21. UInt32 numValidHints; // Hint used to find correct record.
  22. - UInt32 refCon; // Used by DFA to point to private data.
  23. + struct BTreeExtensionsRec *refCon; // Used by DFA to point to private data.
  24. SFCB *fcbPtr; // fcb of btree file
  25. } BTreeControlBlock, *BTreeControlBlockPtr;
  26. --- a/fsck_hfs.tproj/dfalib/SControl.c
  27. +++ b/fsck_hfs.tproj/dfalib/SControl.c
  28. @@ -1034,7 +1034,7 @@ static int ScavTerm( SGlobPtr GPtr )
  29. btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
  30. if ( btcbP != nil)
  31. {
  32. - if( btcbP->refCon != (UInt32)nil )
  33. + if( btcbP->refCon != nil )
  34. {
  35. if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
  36. {
  37. @@ -1043,13 +1043,13 @@ static int ScavTerm( SGlobPtr GPtr )
  38. }
  39. DisposeMemory( (Ptr)btcbP->refCon );
  40. err = MemError();
  41. - btcbP->refCon = (UInt32)nil;
  42. + btcbP->refCon = nil;
  43. }
  44. fcbP = GPtr->calculatedCatalogFCB; // release catalog BTree bit map
  45. btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
  46. - if( btcbP->refCon != (UInt32)nil )
  47. + if( btcbP->refCon != nil )
  48. {
  49. if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
  50. {
  51. @@ -1058,7 +1058,7 @@ static int ScavTerm( SGlobPtr GPtr )
  52. }
  53. DisposeMemory( (Ptr)btcbP->refCon );
  54. err = MemError();
  55. - btcbP->refCon = (UInt32)nil;
  56. + btcbP->refCon = nil;
  57. }
  58. }
  59. }
  60. --- a/fsck_hfs.tproj/dfalib/SVerify1.c
  61. +++ b/fsck_hfs.tproj/dfalib/SVerify1.c
  62. @@ -789,8 +789,8 @@ OSErr CreateExtentsBTreeControlBlock( SG
  63. //
  64. // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
  65. //
  66. - btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  67. - if ( btcb->refCon == (UInt32) nil ) {
  68. + btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  69. + if ( btcb->refCon == nil ) {
  70. err = R_NoMem;
  71. goto exit;
  72. }
  73. @@ -1144,8 +1144,8 @@ OSErr CreateCatalogBTreeControlBlock( SG
  74. // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
  75. //
  76. - btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  77. - if ( btcb->refCon == (UInt32)nil ) {
  78. + btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  79. + if ( btcb->refCon == nil ) {
  80. err = R_NoMem;
  81. goto exit;
  82. }
  83. @@ -1779,8 +1779,8 @@ OSErr CreateAttributesBTreeControlBlock(
  84. //
  85. // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
  86. //
  87. - btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  88. - if ( btcb->refCon == (UInt32)nil ) {
  89. + btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  90. + if ( btcb->refCon == nil ) {
  91. err = R_NoMem;
  92. goto exit;
  93. }
  94. @@ -1793,7 +1793,7 @@ OSErr CreateAttributesBTreeControlBlock(
  95. }
  96. else
  97. {
  98. - if ( btcb->refCon == (UInt32)nil ) {
  99. + if ( btcb->refCon == nil ) {
  100. err = R_NoMem;
  101. goto exit;
  102. }
  103. --- a/fsck_hfs.tproj/dfalib/hfs_endian.c
  104. +++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
  105. @@ -437,7 +437,7 @@ hfs_swap_HFSPlusBTInternalNode (
  106. BTNodeDescriptor *srcDesc = src->buffer;
  107. UInt16 *srcOffs = (UInt16 *)((char *)src->buffer + (src->blockSize - (srcDesc->numRecords * sizeof (UInt16))));
  108. char *nextRecord; /* Points to start of record following current one */
  109. - UInt32 i;
  110. + int i;
  111. UInt32 j;
  112. if (fileID == kHFSExtentsFileID) {