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: Remove (Apple-specific?) \p from strings
5 Modify the way that debug messages are sent to the user, by eliminating one
8 fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 48 ++++++++++++++++++------------------
9 fsck_hfs.tproj/dfalib/SBTree.c | 14 +++++------
10 2 files changed, 31 insertions(+), 31 deletions(-)
12 diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
13 index b812b14..37fb170 100644
14 --- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
15 +++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
16 @@ -223,7 +223,7 @@ OSStatus SearchTree (BTreeControlBlockPtr btreePtr,
20 -// Panic("\pSearchTree: curNodeNum is zero!");
21 + Panic("SearchTree: curNodeNum is zero!");
22 err = fsBTInvalidNodeErr;
25 @@ -433,7 +433,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
28 if ( DEBUG_BUILD && updateParent && newRoot )
29 - DebugStr("\p InsertLevel: New root from primary key, update from secondary key...");
30 + DebugStr("InsertLevel: New root from primary key, update from secondary key...");
33 //////////////////////// Update Parent(s) ///////////////////////////////
34 @@ -448,7 +448,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
38 - PanicIf ( (level == btreePtr->treeDepth), "\p InsertLevel: unfinished insert!?");
39 + PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
43 @@ -456,7 +456,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
44 index = treePathTable [level].index;
45 parentNodeNum = treePathTable [level].node;
47 - PanicIf ( parentNodeNum == 0, "\p InsertLevel: parent node is zero!?");
48 + PanicIf ( parentNodeNum == 0, "InsertLevel: parent node is zero!?");
50 err = GetNode (btreePtr, parentNodeNum, &parentNode); // released as target node in next level up
52 @@ -470,7 +470,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
54 //¥¥Êdebug: check if ptr == targetNodeNum
55 GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
56 - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p InsertLevel: parent ptr doesn't match target node!");
57 + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "InsertLevel: parent ptr doesn't match target node!");
59 // need to delete and re-insert this parent key/ptr
60 // we delete it here and it gets re-inserted in the
61 @@ -532,7 +532,7 @@ ErrorExit:
62 (void) ReleaseNode (btreePtr, targetNode);
63 (void) ReleaseNode (btreePtr, &siblingNode);
65 - Panic ("\p InsertLevel: an error occured!");
66 + Panic ("InsertLevel: an error occured!");
70 @@ -566,7 +566,7 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr,
74 - PanicIf ( targetNode->buffer == siblingNode->buffer, "\p InsertNode: targetNode == siblingNode, huh?");
75 + PanicIf ( targetNode->buffer == siblingNode->buffer, "InsertNode: targetNode == siblingNode, huh?");
77 leftNodeNum = ((NodeDescPtr) targetNode->buffer)->bLink;
78 rightNodeNum = ((NodeDescPtr) targetNode->buffer)->fLink;
79 @@ -606,7 +606,7 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr,
81 if ( leftNodeNum > 0 )
83 - PanicIf ( siblingNode->buffer != nil, "\p InsertNode: siblingNode already aquired!");
84 + PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
86 if ( siblingNode->buffer == nil )
88 @@ -614,7 +614,7 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr,
92 - PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "\p InsertNode, RotateLeft: invalid sibling link!" );
93 + PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "InsertNode, RotateLeft: invalid sibling link!" );
95 if ( !key->skipRotate ) // are rotates allowed?
97 @@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
99 targetNodeNum = treePathTable[level].node;
100 targetNodePtr = targetNode->buffer;
101 - PanicIf (targetNodePtr == nil, "\pDeleteTree: targetNode has nil buffer!");
102 + PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
104 DeleteRecord (btreePtr, targetNodePtr, index);
106 @@ -797,7 +797,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
108 //¥¥Êdebug: check if ptr == targetNodeNum
109 GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
110 - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p DeleteTree: parent ptr doesn't match targetNodeNum!!");
111 + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, " DeleteTree: parent ptr doesn't match targetNodeNum!!");
113 // need to delete and re-insert this parent key/ptr
114 DeleteRecord (btreePtr, parentNode.buffer, index);
115 @@ -1018,7 +1018,7 @@ static OSStatus RotateLeft (BTreeControlBlockPtr btreePtr,
116 keyPtr, keyLength, recPtr, recSize);
119 - Panic ("\pRotateLeft: InsertKeyRecord (left) returned false!");
120 + Panic ("RotateLeft: InsertKeyRecord (left) returned false!");
121 err = fsBTBadRotateErr;
124 @@ -1031,7 +1031,7 @@ static OSStatus RotateLeft (BTreeControlBlockPtr btreePtr,
125 didItFit = RotateRecordLeft (btreePtr, leftNode, rightNode);
128 - Panic ("\pRotateLeft: RotateRecordLeft returned false!");
129 + Panic ("RotateLeft: RotateRecordLeft returned false!");
130 err = fsBTBadRotateErr;
133 @@ -1048,7 +1048,7 @@ static OSStatus RotateLeft (BTreeControlBlockPtr btreePtr,
134 keyPtr, keyLength, recPtr, recSize);
137 - Panic ("\pRotateLeft: InsertKeyRecord (right) returned false!");
138 + Panic ("RotateLeft: InsertKeyRecord (right) returned false!");
139 err = fsBTBadRotateErr;
142 @@ -1117,7 +1117,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr,
143 right = rightNode->buffer;
144 left = leftNode->buffer;
146 - PanicIf ( right->bLink != 0 && left == 0, "\p SplitLeft: left sibling missing!?" );
147 + PanicIf ( right->bLink != 0 && left == 0, " SplitLeft: left sibling missing!?" );
149 //¥¥ type should be kLeafNode or kIndexNode
151 @@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeControlBlockPtr btreePtr,
155 - PanicIf (leftNode == nil, "\pAddNewRootNode: leftNode == nil");
156 - PanicIf (rightNode == nil, "\pAddNewRootNode: rightNode == nil");
157 + PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
158 + PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
161 /////////////////////// Initialize New Root Node ////////////////////////////
162 @@ -1264,7 +1264,7 @@ static OSStatus AddNewRootNode (BTreeControlBlockPtr btreePtr,
163 didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 0, keyPtr, keyLength,
164 (UInt8 *) &rightNode->bLink, 4 );
166 - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for left index record");
167 + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for left index record");
170 //////////////////// Insert Right Node Index Record /////////////////////////
171 @@ -1275,7 +1275,7 @@ static OSStatus AddNewRootNode (BTreeControlBlockPtr btreePtr,
172 didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 1, keyPtr, keyLength,
173 (UInt8 *) &leftNode->fLink, 4 );
175 - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for right index record");
176 + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for right index record");
180 @@ -1355,7 +1355,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr,
182 rightPtr = rightNodePtr->buffer;
184 - PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "\p SplitRight: right sibling missing!?" );
185 + PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "SplitRight: right sibling missing!?" );
187 //¥¥ type should be kLeafNode or kIndexNode
189 @@ -1557,7 +1557,7 @@ static OSStatus RotateRight (BTreeControlBlockPtr btreePtr,
190 keyPtr, keyLength, recPtr, recSize);
193 - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
194 + Panic ("RotateRight: InsertKeyRecord (left) returned false!");
195 err = fsBTBadRotateErr;
198 @@ -1572,7 +1572,7 @@ static OSStatus RotateRight (BTreeControlBlockPtr btreePtr,
199 didItFit = RotateRecordRight( btreePtr, leftNodePtr, rightNodePtr );
202 - Panic ("\pRotateRight: RotateRecordRight returned false!");
203 + Panic ("RotateRight: RotateRecordRight returned false!");
204 err = fsBTBadRotateErr;
207 @@ -1583,7 +1583,7 @@ static OSStatus RotateRight (BTreeControlBlockPtr btreePtr,
208 keyPtr, keyLength, recPtr, recSize);
211 - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
212 + Panic ("RotateRight: InsertKeyRecord (left) returned false!");
213 err = fsBTBadRotateErr;
216 @@ -1607,7 +1607,7 @@ static OSStatus RotateRight (BTreeControlBlockPtr btreePtr,
217 keyPtr, keyLength, recPtr, recSize);
220 - Panic ("\pRotateRight: InsertKeyRecord (right) returned false!");
221 + Panic ("RotateRight: InsertKeyRecord (right) returned false!");
222 err = fsBTBadRotateErr;
225 diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c
226 index cd81b13..eeb4e8c 100644
227 --- a/fsck_hfs.tproj/dfalib/SBTree.c
228 +++ b/fsck_hfs.tproj/dfalib/SBTree.c
229 @@ -103,7 +103,7 @@ OSErr SearchBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void* foundKey,
230 CopyMemory(&resultIterator->key, foundKey, CalcKeySize(btcb, &resultIterator->key)); //¥¥ warning, this could overflow user's buffer!!!
232 if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
233 - DebugStr("\pSearchBTreeRecord: bad record?");
234 + DebugStr("SearchBTreeRecord: bad record?");
238 @@ -211,7 +211,7 @@ OSErr GetBTreeRecord(SFCB *fcb, SInt16 selectionIndex, void* key, void* data, UI
239 CopyMemory(&iterator->key, key, CalcKeySize(btcb, &iterator->key)); //¥¥ warning, this could overflow user's buffer!!!
241 if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
242 - DebugStr("\pGetBTreeRecord: bad record?");
243 + DebugStr("GetBTreeRecord: bad record?");
247 @@ -243,7 +243,7 @@ OSErr InsertBTreeRecord(SFCB *fcb, const void* key, const void* data, UInt16 dat
248 CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //¥¥ should we range check against maxkeylen?
250 if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, dataSize) )
251 - DebugStr("\pInsertBTreeRecord: bad record?");
252 + DebugStr("InsertBTreeRecord: bad record?");
254 result = BTInsertRecord( fcb, &iterator, &btRecord, dataSize );
256 @@ -305,7 +305,7 @@ OSErr ReplaceBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void *newData,
257 CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //¥¥ should we range check against maxkeylen?
259 if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
260 - DebugStr("\pReplaceBTreeRecord: bad record?");
261 + DebugStr("ReplaceBTreeRecord: bad record?");
263 result = BTReplaceRecord( fcb, &iterator, &btRecord, dataSize );
265 @@ -344,7 +344,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
269 - DebugStr("\pSetEndOfForkProc: minEOF is smaller than current size!");
270 + DebugStr("SetEndOfForkProc: minEOF is smaller than current size!");
274 @@ -370,7 +370,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
275 // Make sure we got at least as much space as we needed
277 if (filePtr->fcbLogicalSize < minEOF) {
278 - Panic("\pSetEndOfForkProc: disk too full to extend B-tree file");
279 + Panic("SetEndOfForkProc: disk too full to extend B-tree file");
283 @@ -442,7 +442,7 @@ static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
284 if ( (keyLen < 6) || (keyLen > btcb->maxKeyLength) )
287 - DebugStr("\pCheckBTreeKey: bad key length!");
288 + DebugStr("CheckBTreeKey: bad key length!");
289 return fsBTInvalidKeyLengthErr;