0005-Remove-Apple-specific-p-from-strings.patch 12 KB

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