b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 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 |
| 4 | |
| 5 | Modify the way that debug messages are sent to the user, by eliminating one |
| 6 | character of them. |
| 7 | --- |
| 8 | fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 48 ++++++++++++++++++------------------ |
| 9 | fsck_hfs.tproj/dfalib/SBTree.c | 14 +++++------ |
| 10 | 2 files changed, 31 insertions(+), 31 deletions(-) |
| 11 | |
| 12 | --- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c |
| 13 | +++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c |
| 14 | @@ -223,7 +223,7 @@ OSStatus SearchTree (BTreeControlBlockPt |
| 15 | // |
| 16 | if (curNodeNum == 0) |
| 17 | { |
| 18 | -// Panic("\pSearchTree: curNodeNum is zero!"); |
| 19 | + Panic("SearchTree: curNodeNum is zero!"); |
| 20 | err = fsBTInvalidNodeErr; |
| 21 | goto ErrorExit; |
| 22 | } |
| 23 | @@ -433,7 +433,7 @@ OSStatus InsertLevel (BTreeControlBlockP |
| 24 | M_ExitOnError (err); |
| 25 | |
| 26 | if ( DEBUG_BUILD && updateParent && newRoot ) |
| 27 | - DebugStr("\p InsertLevel: New root from primary key, update from secondary key..."); |
| 28 | + DebugStr("InsertLevel: New root from primary key, update from secondary key..."); |
| 29 | } |
| 30 | |
| 31 | //////////////////////// Update Parent(s) /////////////////////////////// |
| 32 | @@ -448,7 +448,7 @@ OSStatus InsertLevel (BTreeControlBlockP |
| 33 | |
| 34 | secondaryKey = nil; |
| 35 | |
| 36 | - PanicIf ( (level == btreePtr->treeDepth), "\p InsertLevel: unfinished insert!?"); |
| 37 | + PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?"); |
| 38 | |
| 39 | ++level; |
| 40 | |
| 41 | @@ -456,7 +456,7 @@ OSStatus InsertLevel (BTreeControlBlockP |
| 42 | index = treePathTable [level].index; |
| 43 | parentNodeNum = treePathTable [level].node; |
| 44 | |
| 45 | - PanicIf ( parentNodeNum == 0, "\p InsertLevel: parent node is zero!?"); |
| 46 | + PanicIf ( parentNodeNum == 0, "InsertLevel: parent node is zero!?"); |
| 47 | |
| 48 | err = GetNode (btreePtr, parentNodeNum, &parentNode); // released as target node in next level up |
| 49 | M_ExitOnError (err); |
| 50 | @@ -470,7 +470,7 @@ OSStatus InsertLevel (BTreeControlBlockP |
| 51 | { |
| 52 | //¥¥Êdebug: check if ptr == targetNodeNum |
| 53 | GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize); |
| 54 | - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p InsertLevel: parent ptr doesn't match target node!"); |
| 55 | + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "InsertLevel: parent ptr doesn't match target node!"); |
| 56 | |
| 57 | // need to delete and re-insert this parent key/ptr |
| 58 | // we delete it here and it gets re-inserted in the |
| 59 | @@ -532,7 +532,7 @@ ErrorExit: |
| 60 | (void) ReleaseNode (btreePtr, targetNode); |
| 61 | (void) ReleaseNode (btreePtr, &siblingNode); |
| 62 | |
| 63 | - Panic ("\p InsertLevel: an error occured!"); |
| 64 | + Panic ("InsertLevel: an error occured!"); |
| 65 | |
| 66 | return err; |
| 67 | |
| 68 | @@ -566,7 +566,7 @@ static OSErr InsertNode (BTreeControlBlo |
| 69 | |
| 70 | *rootSplit = false; |
| 71 | |
| 72 | - PanicIf ( targetNode->buffer == siblingNode->buffer, "\p InsertNode: targetNode == siblingNode, huh?"); |
| 73 | + PanicIf ( targetNode->buffer == siblingNode->buffer, "InsertNode: targetNode == siblingNode, huh?"); |
| 74 | |
| 75 | leftNodeNum = ((NodeDescPtr) targetNode->buffer)->bLink; |
| 76 | rightNodeNum = ((NodeDescPtr) targetNode->buffer)->fLink; |
| 77 | @@ -606,7 +606,7 @@ static OSErr InsertNode (BTreeControlBlo |
| 78 | |
| 79 | if ( leftNodeNum > 0 ) |
| 80 | { |
| 81 | - PanicIf ( siblingNode->buffer != nil, "\p InsertNode: siblingNode already aquired!"); |
| 82 | + PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!"); |
| 83 | |
| 84 | if ( siblingNode->buffer == nil ) |
| 85 | { |
| 86 | @@ -614,7 +614,7 @@ static OSErr InsertNode (BTreeControlBlo |
| 87 | M_ExitOnError (err); |
| 88 | } |
| 89 | |
| 90 | - PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "\p InsertNode, RotateLeft: invalid sibling link!" ); |
| 91 | + PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "InsertNode, RotateLeft: invalid sibling link!" ); |
| 92 | |
| 93 | if ( !key->skipRotate ) // are rotates allowed? |
| 94 | { |
| 95 | @@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlock |
| 96 | |
| 97 | targetNodeNum = treePathTable[level].node; |
| 98 | targetNodePtr = targetNode->buffer; |
| 99 | - PanicIf (targetNodePtr == nil, "\pDeleteTree: targetNode has nil buffer!"); |
| 100 | + PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!"); |
| 101 | |
| 102 | DeleteRecord (btreePtr, targetNodePtr, index); |
| 103 | |
| 104 | @@ -797,7 +797,7 @@ OSStatus DeleteTree (BTreeControlBlock |
| 105 | |
| 106 | //¥¥Êdebug: check if ptr == targetNodeNum |
| 107 | GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize); |
| 108 | - PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p DeleteTree: parent ptr doesn't match targetNodeNum!!"); |
| 109 | + PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, " DeleteTree: parent ptr doesn't match targetNodeNum!!"); |
| 110 | |
| 111 | // need to delete and re-insert this parent key/ptr |
| 112 | DeleteRecord (btreePtr, parentNode.buffer, index); |
| 113 | @@ -1018,7 +1018,7 @@ static OSStatus RotateLeft (BTreeContro |
| 114 | keyPtr, keyLength, recPtr, recSize); |
| 115 | if ( !didItFit ) |
| 116 | { |
| 117 | - Panic ("\pRotateLeft: InsertKeyRecord (left) returned false!"); |
| 118 | + Panic ("RotateLeft: InsertKeyRecord (left) returned false!"); |
| 119 | err = fsBTBadRotateErr; |
| 120 | goto ErrorExit; |
| 121 | } |
| 122 | @@ -1031,7 +1031,7 @@ static OSStatus RotateLeft (BTreeContro |
| 123 | didItFit = RotateRecordLeft (btreePtr, leftNode, rightNode); |
| 124 | if ( !didItFit ) |
| 125 | { |
| 126 | - Panic ("\pRotateLeft: RotateRecordLeft returned false!"); |
| 127 | + Panic ("RotateLeft: RotateRecordLeft returned false!"); |
| 128 | err = fsBTBadRotateErr; |
| 129 | goto ErrorExit; |
| 130 | } |
| 131 | @@ -1048,7 +1048,7 @@ static OSStatus RotateLeft (BTreeContro |
| 132 | keyPtr, keyLength, recPtr, recSize); |
| 133 | if ( !didItFit ) |
| 134 | { |
| 135 | - Panic ("\pRotateLeft: InsertKeyRecord (right) returned false!"); |
| 136 | + Panic ("RotateLeft: InsertKeyRecord (right) returned false!"); |
| 137 | err = fsBTBadRotateErr; |
| 138 | goto ErrorExit; |
| 139 | } |
| 140 | @@ -1117,7 +1117,7 @@ static OSStatus SplitLeft (BTreeControl |
| 141 | right = rightNode->buffer; |
| 142 | left = leftNode->buffer; |
| 143 | |
| 144 | - PanicIf ( right->bLink != 0 && left == 0, "\p SplitLeft: left sibling missing!?" ); |
| 145 | + PanicIf ( right->bLink != 0 && left == 0, " SplitLeft: left sibling missing!?" ); |
| 146 | |
| 147 | //¥¥ type should be kLeafNode or kIndexNode |
| 148 | |
| 149 | @@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeCon |
| 150 | Boolean didItFit; |
| 151 | UInt16 keyLength; |
| 152 | |
| 153 | - PanicIf (leftNode == nil, "\pAddNewRootNode: leftNode == nil"); |
| 154 | - PanicIf (rightNode == nil, "\pAddNewRootNode: rightNode == nil"); |
| 155 | + PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil"); |
| 156 | + PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil"); |
| 157 | |
| 158 | |
| 159 | /////////////////////// Initialize New Root Node //////////////////////////// |
| 160 | @@ -1264,7 +1264,7 @@ static OSStatus AddNewRootNode (BTreeCon |
| 161 | didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 0, keyPtr, keyLength, |
| 162 | (UInt8 *) &rightNode->bLink, 4 ); |
| 163 | |
| 164 | - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for left index record"); |
| 165 | + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for left index record"); |
| 166 | |
| 167 | |
| 168 | //////////////////// Insert Right Node Index Record ///////////////////////// |
| 169 | @@ -1275,7 +1275,7 @@ static OSStatus AddNewRootNode (BTreeCon |
| 170 | didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 1, keyPtr, keyLength, |
| 171 | (UInt8 *) &leftNode->fLink, 4 ); |
| 172 | |
| 173 | - PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for right index record"); |
| 174 | + PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for right index record"); |
| 175 | |
| 176 | |
| 177 | #if DEBUG_TREEOPS |
| 178 | @@ -1355,7 +1355,7 @@ static OSStatus SplitRight (BTreeContro |
| 179 | } |
| 180 | rightPtr = rightNodePtr->buffer; |
| 181 | |
| 182 | - PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "\p SplitRight: right sibling missing!?" ); |
| 183 | + PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "SplitRight: right sibling missing!?" ); |
| 184 | |
| 185 | //¥¥ type should be kLeafNode or kIndexNode |
| 186 | |
| 187 | @@ -1557,7 +1557,7 @@ static OSStatus RotateRight (BTreeContr |
| 188 | keyPtr, keyLength, recPtr, recSize); |
| 189 | if ( !didItFit ) |
| 190 | { |
| 191 | - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!"); |
| 192 | + Panic ("RotateRight: InsertKeyRecord (left) returned false!"); |
| 193 | err = fsBTBadRotateErr; |
| 194 | goto ErrorExit; |
| 195 | } |
| 196 | @@ -1572,7 +1572,7 @@ static OSStatus RotateRight (BTreeContr |
| 197 | didItFit = RotateRecordRight( btreePtr, leftNodePtr, rightNodePtr ); |
| 198 | if ( !didItFit ) |
| 199 | { |
| 200 | - Panic ("\pRotateRight: RotateRecordRight returned false!"); |
| 201 | + Panic ("RotateRight: RotateRecordRight returned false!"); |
| 202 | err = fsBTBadRotateErr; |
| 203 | goto ErrorExit; |
| 204 | } |
| 205 | @@ -1583,7 +1583,7 @@ static OSStatus RotateRight (BTreeContr |
| 206 | keyPtr, keyLength, recPtr, recSize); |
| 207 | if ( !didItFit ) |
| 208 | { |
| 209 | - Panic ("\pRotateRight: InsertKeyRecord (left) returned false!"); |
| 210 | + Panic ("RotateRight: InsertKeyRecord (left) returned false!"); |
| 211 | err = fsBTBadRotateErr; |
| 212 | goto ErrorExit; |
| 213 | } |
| 214 | @@ -1607,7 +1607,7 @@ static OSStatus RotateRight (BTreeContr |
| 215 | keyPtr, keyLength, recPtr, recSize); |
| 216 | if ( !didItFit ) |
| 217 | { |
| 218 | - Panic ("\pRotateRight: InsertKeyRecord (right) returned false!"); |
| 219 | + Panic ("RotateRight: InsertKeyRecord (right) returned false!"); |
| 220 | err = fsBTBadRotateErr; |
| 221 | goto ErrorExit; |
| 222 | } |
| 223 | --- a/fsck_hfs.tproj/dfalib/SBTree.c |
| 224 | +++ b/fsck_hfs.tproj/dfalib/SBTree.c |
| 225 | @@ -103,7 +103,7 @@ OSErr SearchBTreeRecord(SFCB *fcb, const |
| 226 | CopyMemory(&resultIterator->key, foundKey, CalcKeySize(btcb, &resultIterator->key)); //¥¥ warning, this could overflow user's buffer!!! |
| 227 | |
| 228 | if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) ) |
| 229 | - DebugStr("\pSearchBTreeRecord: bad record?"); |
| 230 | + DebugStr("SearchBTreeRecord: bad record?"); |
| 231 | } |
| 232 | |
| 233 | ErrorExit: |
| 234 | @@ -211,7 +211,7 @@ OSErr GetBTreeRecord(SFCB *fcb, SInt16 s |
| 235 | CopyMemory(&iterator->key, key, CalcKeySize(btcb, &iterator->key)); //¥¥ warning, this could overflow user's buffer!!! |
| 236 | |
| 237 | if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) ) |
| 238 | - DebugStr("\pGetBTreeRecord: bad record?"); |
| 239 | + DebugStr("GetBTreeRecord: bad record?"); |
| 240 | |
| 241 | } |
| 242 | |
| 243 | @@ -243,7 +243,7 @@ OSErr InsertBTreeRecord(SFCB *fcb, const |
| 244 | CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //¥¥ should we range check against maxkeylen? |
| 245 | |
| 246 | if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, dataSize) ) |
| 247 | - DebugStr("\pInsertBTreeRecord: bad record?"); |
| 248 | + DebugStr("InsertBTreeRecord: bad record?"); |
| 249 | |
| 250 | result = BTInsertRecord( fcb, &iterator, &btRecord, dataSize ); |
| 251 | |
| 252 | @@ -305,7 +305,7 @@ OSErr ReplaceBTreeRecord(SFCB *fcb, cons |
| 253 | CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //¥¥ should we range check against maxkeylen? |
| 254 | |
| 255 | if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) ) |
| 256 | - DebugStr("\pReplaceBTreeRecord: bad record?"); |
| 257 | + DebugStr("ReplaceBTreeRecord: bad record?"); |
| 258 | |
| 259 | result = BTReplaceRecord( fcb, &iterator, &btRecord, dataSize ); |
| 260 | |
| 261 | @@ -344,7 +344,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize |
| 262 | else |
| 263 | { |
| 264 | if ( DEBUG_BUILD ) |
| 265 | - DebugStr("\pSetEndOfForkProc: minEOF is smaller than current size!"); |
| 266 | + DebugStr("SetEndOfForkProc: minEOF is smaller than current size!"); |
| 267 | return -1; |
| 268 | } |
| 269 | |
| 270 | @@ -370,7 +370,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize |
| 271 | // Make sure we got at least as much space as we needed |
| 272 | // |
| 273 | if (filePtr->fcbLogicalSize < minEOF) { |
| 274 | - Panic("\pSetEndOfForkProc: disk too full to extend B-tree file"); |
| 275 | + Panic("SetEndOfForkProc: disk too full to extend B-tree file"); |
| 276 | return dskFulErr; |
| 277 | } |
| 278 | |
| 279 | @@ -442,7 +442,7 @@ static OSErr CheckBTreeKey(const BTreeKe |
| 280 | if ( (keyLen < 6) || (keyLen > btcb->maxKeyLength) ) |
| 281 | { |
| 282 | if ( DEBUG_BUILD ) |
| 283 | - DebugStr("\pCheckBTreeKey: bad key length!"); |
| 284 | + DebugStr("CheckBTreeKey: bad key length!"); |
| 285 | return fsBTInvalidKeyLengthErr; |
| 286 | } |
| 287 | |