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