* updated wlroots (0.17.3 -> 0.18.1)
[t2sde.git] / package / filesystem / hfsplusutils / 0004-Fix-compilation-on-64-bit-arches.patch
blob57f6011084addcf572658861a3e1dcab227557d4
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
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(-)
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;
41 if ( btcbP != nil)
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 );
51 err = MemError();
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 );
67 err = MemError();
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 ) {
85 err = R_NoMem;
86 goto exit;
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 ) {
96 err = R_NoMem;
97 goto exit;
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 ) {
107 err = R_NoMem;
108 goto exit;
110 @@ -1793,7 +1793,7 @@ OSErr CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
112 else
114 - if ( btcb->refCon == (UInt32)nil ) {
115 + if ( btcb->refCon == nil ) {
116 err = R_NoMem;
117 goto exit;
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;
131 if (fileID == kHFSExtentsFileID) {