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