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
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(-)
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 {
18 ///////////////////////////////////// Types /////////////////////////////////////
20 +// Forward declaration from Scavenger.h
21 +struct BTreeExtensionsRec;
23 typedef struct BTreeControlBlock { // fields specific to BTree CBs
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.
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
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;
43 - if( btcbP->refCon != (UInt32)nil )
44 + if( btcbP->refCon != nil )
46 if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
48 @@ -1043,13 +1043,13 @@ static int ScavTerm( SGlobPtr GPtr )
50 DisposeMemory( (Ptr)btcbP->refCon );
52 - btcbP->refCon = (UInt32)nil;
53 + btcbP->refCon = nil;
56 fcbP = GPtr->calculatedCatalogFCB; // release catalog BTree bit map
57 btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
59 - if( btcbP->refCon != (UInt32)nil )
60 + if( btcbP->refCon != nil )
62 if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
64 @@ -1058,7 +1058,7 @@ static int ScavTerm( SGlobPtr GPtr )
66 DisposeMemory( (Ptr)btcbP->refCon );
68 - btcbP->refCon = (UInt32)nil;
69 + btcbP->refCon = nil;
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 )
79 // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
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 ) {
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.
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 ) {
99 @@ -1779,8 +1779,8 @@ OSErr CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
101 // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
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 ) {
110 @@ -1793,7 +1793,7 @@ OSErr CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
114 - if ( btcb->refCon == (UInt32)nil ) {
115 + if ( btcb->refCon == nil ) {
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 */
131 if (fileID == kHFSExtentsFileID) {