You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

287 lines
11 KiB

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