* updated wlroots (0.17.3 -> 0.18.1)
[t2sde.git] / package / filesystem / hfsplusutils / 0010-Rename-custom-macro-nil-with-NULL.patch
blob354b4ffc042e0178dad1b675c7008209d1258454
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: Rename custom macro nil with NULL
5 ---
6 fsck_hfs.tproj/dfalib/BTree.c | 142 +++++++++++++++++-----------------
7 fsck_hfs.tproj/dfalib/BTreeAllocate.c | 14 ++--
8 fsck_hfs.tproj/dfalib/BTreeMiscOps.c | 26 +++----
9 fsck_hfs.tproj/dfalib/BTreeNodeOps.c | 30 +++----
10 fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 38 ++++-----
11 fsck_hfs.tproj/dfalib/SControl.c | 56 +++++++-------
12 fsck_hfs.tproj/dfalib/SRepair.c | 6 +-
13 fsck_hfs.tproj/dfalib/SUtils.c | 6 +-
14 fsck_hfs.tproj/dfalib/SVerify1.c | 32 ++++----
15 fsck_hfs.tproj/dfalib/SVerify2.c | 4 +-
16 10 files changed, 177 insertions(+), 177 deletions(-)
18 diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
19 index 7ad9fe0..c0c8744 100644
20 --- a/fsck_hfs.tproj/dfalib/BTree.c
21 +++ b/fsck_hfs.tproj/dfalib/BTree.c
22 @@ -163,21 +163,21 @@ OSStatus BTInitialize (FCB *filePtr,
24 ////////////////////// Preliminary Error Checking ///////////////////////////
26 - headerNode.buffer = nil;
27 + headerNode.buffer = NULL;
29 - if (pathPtr == nil) return paramErr;
30 + if (pathPtr == NULL) return paramErr;
32 setEndOfForkProc = pathPtr->agentPtr->agent.setEndOfForkProc;
33 setBlockSizeProc = pathPtr->agentPtr->agent.setBlockSizeProc;
35 - if (pathPtr->agentPtr->agent.getBlockProc == nil) return E_NoGetBlockProc;
36 - if (pathPtr->agentPtr->agent.releaseBlockProc == nil) return E_NoReleaseBlockProc;
37 - if (setEndOfForkProc == nil) return E_NoSetEndOfForkProc;
38 - if (setBlockSizeProc == nil) return E_NoSetBlockSizeProc;
39 + if (pathPtr->agentPtr->agent.getBlockProc == NULL) return E_NoGetBlockProc;
40 + if (pathPtr->agentPtr->agent.releaseBlockProc == NULL) return E_NoReleaseBlockProc;
41 + if (setEndOfForkProc == NULL) return E_NoSetEndOfForkProc;
42 + if (setBlockSizeProc == NULL) return E_NoSetBlockSizeProc;
44 forkPtr = pathPtr->path.forkPtr;
46 - if (forkPtr->fork.btreePtr != nil) return fsBTrFileAlreadyOpenErr;
47 + if (forkPtr->fork.btreePtr != NULL) return fsBTrFileAlreadyOpenErr;
49 if ((maxKeyLength == 0) ||
50 (maxKeyLength > kMaxKeyLength)) return fsBTInvalidKeyLengthErr;
51 @@ -209,7 +209,7 @@ OSStatus BTInitialize (FCB *filePtr,
52 //////////////////////// Allocate Control Block /////////////////////////////
54 M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
55 - if (btreePtr == nil)
56 + if (btreePtr == NULL)
58 err = memFullErr;
59 goto ErrorExit;
60 @@ -220,7 +220,7 @@ OSStatus BTInitialize (FCB *filePtr,
61 btreePtr->flags = 0;
62 btreePtr->attributes = 0;
63 btreePtr->forkPtr = forkPtr;
64 - btreePtr->keyCompareProc = nil;
65 + btreePtr->keyCompareProc = NULL;
66 btreePtr->keyDescPtr = keyDescPtr;
67 btreePtr->btreeType = btreeType;
68 btreePtr->treeDepth = 0;
69 @@ -282,7 +282,7 @@ OSStatus BTInitialize (FCB *filePtr,
71 ///////////////////// Copy Key Descriptor To Header /////////////////////////
72 #if SupportsKeyDescriptors
73 - if (keyDescPtr != nil)
74 + if (keyDescPtr != NULL)
76 err = CheckKeyDescriptor (keyDescPtr, maxKeyLength);
77 M_ExitOnError (err);
78 @@ -309,7 +309,7 @@ OSStatus BTInitialize (FCB *filePtr,
79 err = UpdateHeader (btreePtr);
80 M_ExitOnError (err);
82 - pathPtr->path.forkPtr->fork.btreePtr = nil;
83 + pathPtr->path.forkPtr->fork.btreePtr = NULL;
84 M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
86 return noErr;
87 @@ -320,7 +320,7 @@ OSStatus BTInitialize (FCB *filePtr,
88 ErrorExit:
90 (void) ReleaseNode (btreePtr, &headerNode);
91 - if (btreePtr != nil)
92 + if (btreePtr != NULL)
93 M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
95 return err;
96 @@ -342,7 +342,7 @@ Input: filePtr - pointer to file to open as a B-tree
97 setEndOfForkProc - pointer to client's SetEOF function
99 Result: noErr - success
100 - paramErr - required ptr was nil
101 + paramErr - required ptr was NULL
102 fsBTInvalidFileErr -
103 memFullErr -
104 != noErr - failure
105 @@ -364,16 +364,16 @@ OSStatus BTOpenPath (SFCB *filePtr,
107 ////////////////////// Preliminary Error Checking ///////////////////////////
109 - if ( filePtr == nil ||
110 - getBlockProc == nil ||
111 - releaseBlockProc == nil ||
112 - setEndOfForkProc == nil ||
113 - setBlockSizeProc == nil )
114 + if (filePtr == NULL ||
115 + getBlockProc == NULL ||
116 + releaseBlockProc == NULL ||
117 + setEndOfForkProc == NULL ||
118 + setBlockSizeProc == NULL)
120 return paramErr;
123 - if ( filePtr->fcbBtree != nil ) // already has a BTreeCB
124 + if (filePtr->fcbBtree != NULL) // already has a BTreeCB
125 return noErr;
127 // is file large enough to contain header node?
128 @@ -384,7 +384,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
129 //////////////////////// Allocate Control Block /////////////////////////////
131 btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) );
132 - if (btreePtr == nil)
133 + if (btreePtr == NULL)
135 Panic ("\pBTOpen: no memory for btreePtr.");
136 return memFullErr;
137 @@ -397,7 +397,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
139 /////////////////////////// Read Header Node ////////////////////////////////
141 - nodeRec.buffer = nil; // so we can call ReleaseNode
142 + nodeRec.buffer = NULL; // so we can call ReleaseNode
144 btreePtr->fcbPtr = filePtr;
145 filePtr->fcbBtree = (void *) btreePtr; // attach btree cb to file
146 @@ -487,7 +487,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
148 ////////////////////////// Get Key Descriptor ///////////////////////////////
149 #if SupportsKeyDescriptors
150 - if ( keyCompareProc == nil ) // if no key compare proc then get key descriptor
151 + if (keyCompareProc == NULL) // if no key compare proc then get key descriptor
153 err = GetKeyDescriptor (btreePtr, nodeRec.buffer); //¥¥ it should check amount of memory allocated...
154 M_ExitOnError (err);
155 @@ -499,7 +499,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
156 else
157 #endif
159 - btreePtr->keyDescPtr = nil; // clear it so we don't dispose garbage later
160 + btreePtr->keyDescPtr = NULL; // clear it so we don't dispose garbage later
163 err = ReleaseNode (btreePtr, &nodeRec);
164 @@ -528,7 +528,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
166 ErrorExit:
168 - filePtr->fcbBtree = nil;
169 + filePtr->fcbBtree = NULL;
170 (void) ReleaseNode (btreePtr, &nodeRec);
171 DisposeMemory( btreePtr );
173 @@ -567,7 +567,7 @@ OSStatus BTClosePath (SFCB *filePtr)
175 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
177 - if (btreePtr == nil)
178 + if (btreePtr == NULL)
179 return fsBTInvalidFileErr;
181 ////////////////////// Check for other BTree Paths //////////////////////////
182 @@ -603,14 +603,14 @@ OSStatus BTClosePath (SFCB *filePtr)
183 M_ExitOnError (err);
185 #if SupportsKeyDescriptors
186 - if (btreePtr->keyDescPtr != nil) // deallocate keyDescriptor, if any
187 + if (btreePtr->keyDescPtr != NULL) // deallocate keyDescriptor, if any
189 DisposeMemory( btreePtr->keyDescPtr );
191 #endif
193 DisposeMemory( btreePtr );
194 - filePtr->fcbBtree = nil;
195 + filePtr->fcbBtree = NULL;
197 // LogEndTime(kTraceCloseBTree, noErr);
199 @@ -643,7 +643,7 @@ Function: Search for position in B*Tree indicated by searchKey. If a valid node
201 Input: pathPtr - pointer to path for BTree file.
202 searchKey - pointer to search key to match.
203 - hintPtr - pointer to hint (may be nil)
204 + hintPtr - pointer to hint (may be NULL)
206 Output: record - pointer to BufferDescriptor containing record
207 recordLen - length of data at recordPtr
208 @@ -678,14 +678,14 @@ OSStatus BTSearchRecord (SFCB *filePtr,
210 // LogStartTime(kTraceSearchBTree);
212 - if (filePtr == nil) return paramErr;
213 - if (searchIterator == nil) return paramErr;
214 + if (filePtr == NULL) return paramErr;
215 + if (searchIterator == NULL) return paramErr;
217 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
218 - if (btreePtr == nil) return fsBTInvalidFileErr;
219 + if (btreePtr == NULL) return fsBTInvalidFileErr;
221 #if SupportsKeyDescriptors
222 - if (btreePtr->keyCompareProc == nil) // CheckKey if we using Key Descriptor
223 + if (btreePtr->keyCompareProc == NULL) // CheckKey if we using Key Descriptor
225 err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
226 M_ExitOnError (err);
227 @@ -775,9 +775,9 @@ OSStatus BTSearchRecord (SFCB *filePtr,
228 //¥¥ Should check for errors! Or BlockMove could choke on recordPtr!!!
229 GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
231 - if (recordLen != nil) *recordLen = len;
232 + if (recordLen != NULL) *recordLen = len;
234 - if (record != nil)
235 + if (record != NULL)
237 ByteCount recordSize;
239 @@ -794,7 +794,7 @@ OSStatus BTSearchRecord (SFCB *filePtr,
241 /////////////////////// Success - Update Iterator ///////////////////////////
243 - if (resultIterator != nil)
244 + if (resultIterator != NULL)
246 resultIterator->hint.writeCount = btreePtr->writeCount;
247 resultIterator->hint.nodeNum = nodeNum;
248 @@ -825,10 +825,10 @@ OSStatus BTSearchRecord (SFCB *filePtr,
250 ErrorExit:
252 - if (recordLen != nil)
253 + if (recordLen != NULL)
254 *recordLen = 0;
256 - if (resultIterator != nil)
257 + if (resultIterator != NULL)
259 resultIterator->hint.writeCount = 0;
260 resultIterator->hint.nodeNum = 0;
261 @@ -892,18 +892,18 @@ OSStatus BTIterateRecord (SFCB *filePtr,
263 ////////////////////////// Priliminary Checks ///////////////////////////////
265 - left.buffer = nil;
266 - right.buffer = nil;
267 - node.buffer = nil;
268 + left.buffer = NULL;
269 + right.buffer = NULL;
270 + node.buffer = NULL;
273 - if (filePtr == nil)
274 + if (filePtr == NULL)
276 return paramErr;
279 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
280 - if (btreePtr == nil)
281 + if (btreePtr == NULL)
283 return fsBTInvalidFileErr; //¥¥ handle properly
285 @@ -968,7 +968,7 @@ OSStatus BTIterateRecord (SFCB *filePtr,
287 else
289 - if (left.buffer == nil)
290 + if (left.buffer == NULL)
292 nodeNum = ((NodeDescPtr) node.buffer)->bLink;
293 if ( nodeNum > 0)
294 @@ -981,13 +981,13 @@ OSStatus BTIterateRecord (SFCB *filePtr,
297 // Before we stomp on "right", we'd better release it if needed
298 - if (right.buffer != nil) {
299 + if (right.buffer != NULL) {
300 err = ReleaseNode(btreePtr, &right);
301 M_ExitOnError(err);
303 right = node;
304 node = left;
305 - left.buffer = nil;
306 + left.buffer = NULL;
307 index = ((NodeDescPtr) node.buffer)->numRecords -1;
310 @@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord (SFCB *filePtr,
312 else
314 - if (right.buffer == nil)
315 + if (right.buffer == NULL)
317 nodeNum = ((NodeDescPtr) node.buffer)->fLink;
318 if ( nodeNum > 0)
319 @@ -1025,13 +1025,13 @@ OSStatus BTIterateRecord (SFCB *filePtr,
322 // Before we stomp on "left", we'd better release it if needed
323 - if (left.buffer != nil) {
324 + if (left.buffer != NULL) {
325 err = ReleaseNode(btreePtr, &left);
326 M_ExitOnError(err);
328 left = node;
329 node = right;
330 - right.buffer = nil;
331 + right.buffer = NULL;
332 index = 0;
335 @@ -1054,9 +1054,9 @@ CopyData:
336 err = GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
337 M_ExitOnError (err);
339 - if (recordLen != nil) *recordLen = len;
340 + if (recordLen != NULL) *recordLen = len;
342 - if (record != nil)
343 + if (record != NULL)
345 ByteCount recordSize;
347 @@ -1069,7 +1069,7 @@ CopyData:
348 CopyMemory (recordPtr, record->bufferAddress, len);
351 - if (iterator != nil) // first & last do not require iterator
352 + if (iterator != NULL) // first & last do not require iterator
354 iterator->hint.writeCount = btreePtr->writeCount;
355 iterator->hint.nodeNum = nodeNum;
356 @@ -1089,13 +1089,13 @@ CopyData:
357 err = ReleaseNode (btreePtr, &node);
358 M_ExitOnError (err);
360 - if (left.buffer != nil)
361 + if (left.buffer != NULL)
363 err = ReleaseNode (btreePtr, &left);
364 M_ExitOnError (err);
367 - if (right.buffer != nil)
368 + if (right.buffer != NULL)
370 err = ReleaseNode (btreePtr, &right);
371 M_ExitOnError (err);
372 @@ -1113,10 +1113,10 @@ ErrorExit:
373 (void) ReleaseNode (btreePtr, &node);
374 (void) ReleaseNode (btreePtr, &right);
376 - if (recordLen != nil)
377 + if (recordLen != NULL)
378 *recordLen = 0;
380 - if (iterator != nil)
381 + if (iterator != NULL)
383 iterator->hint.writeCount = 0;
384 iterator->hint.nodeNum = 0;
385 @@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord (SFCB *filePtr,
387 ////////////////////////// Priliminary Checks ///////////////////////////////
389 - nodeRec.buffer = nil; // so we can call ReleaseNode
390 + nodeRec.buffer = NULL; // so we can call ReleaseNode
392 err = CheckInsertParams (filePtr, iterator, record, recordLen);
393 if (err != noErr)
394 @@ -1317,7 +1317,7 @@ OSStatus BTSetRecord (SFCB *filePtr,
396 ////////////////////////// Priliminary Checks ///////////////////////////////
398 - nodeRec.buffer = nil; // so we can call ReleaseNode
399 + nodeRec.buffer = NULL; // so we can call ReleaseNode
401 err = CheckInsertParams (filePtr, iterator, record, recordLen);
402 if (err != noErr)
403 @@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord (SFCB *filePtr,
405 ////////////////////////// Priliminary Checks ///////////////////////////////
407 - nodeRec.buffer = nil; // so we can call ReleaseNode
408 + nodeRec.buffer = NULL; // so we can call ReleaseNode
410 err = CheckInsertParams (filePtr, iterator, record, recordLen);
411 if (err != noErr)
412 @@ -1645,20 +1645,20 @@ OSStatus BTDeleteRecord (SFCB *filePtr,
414 ////////////////////////// Priliminary Checks ///////////////////////////////
416 - nodeRec.buffer = nil; // so we can call ReleaseNode
417 + nodeRec.buffer = NULL; // so we can call ReleaseNode
419 - M_ReturnErrorIf (filePtr == nil, paramErr);
420 - M_ReturnErrorIf (iterator == nil, paramErr);
421 + M_ReturnErrorIf (filePtr == NULL, paramErr);
422 + M_ReturnErrorIf (iterator == NULL, paramErr);
424 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
425 - if (btreePtr == nil)
426 + if (btreePtr == NULL)
428 err = fsBTInvalidFileErr;
429 goto ErrorExit;
432 #if SupportsKeyDescriptors
433 - if (btreePtr->keyDescPtr != nil)
434 + if (btreePtr->keyDescPtr != NULL)
436 err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
437 M_ExitOnError (err);
438 @@ -1712,12 +1712,12 @@ OSStatus BTGetInformation (SFCB *filePtr,
439 BTreeControlBlockPtr btreePtr;
442 - M_ReturnErrorIf (filePtr == nil, paramErr);
443 + M_ReturnErrorIf (filePtr == NULL, paramErr);
445 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
447 - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr);
448 - M_ReturnErrorIf (info == nil, paramErr);
449 + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr);
450 + M_ReturnErrorIf (info == NULL, paramErr);
452 //¥¥ check version?
454 @@ -1730,7 +1730,7 @@ OSStatus BTGetInformation (SFCB *filePtr,
455 info->keyDescriptor = btreePtr->keyDescPtr; //¥¥ this won't do at all...
456 info->reserved = 0;
458 - if (btreePtr->keyDescPtr == nil)
459 + if (btreePtr->keyDescPtr == NULL)
460 info->keyDescLength = 0;
461 else
462 info->keyDescLength = (UInt32) btreePtr->keyDescPtr->length;
463 @@ -1762,11 +1762,11 @@ OSStatus BTFlushPath (SFCB *filePtr)
465 // LogStartTime(kTraceFlushBTree);
467 - M_ReturnErrorIf (filePtr == nil, paramErr);
468 + M_ReturnErrorIf (filePtr == NULL, paramErr);
470 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
472 - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr);
473 + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr);
475 err = UpdateHeader (btreePtr);
477 @@ -1788,13 +1788,13 @@ Input: iterator - pointer to BTreeIterator
478 Output: iterator - iterator with the hint.nodeNum cleared
480 Result: noErr - success
481 - paramErr - iterator == nil
482 + paramErr - iterator == NULL
483 -------------------------------------------------------------------------------*/
486 OSStatus BTInvalidateHint (BTreeIterator *iterator )
488 - if (iterator == nil)
489 + if (iterator == NULL)
490 return paramErr;
492 iterator->hint.nodeNum = 0;
493 diff --git a/fsck_hfs.tproj/dfalib/BTreeAllocate.c b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
494 index 485d867..02bdd8d 100644
495 --- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
496 +++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
497 @@ -83,7 +83,7 @@ OSStatus AllocateNode (BTreeControlBlockPtr btreePtr, UInt32 *nodeNum)
500 nodeNumber = 0; // first node number of header map record
501 - node.buffer = nil; // clear node.buffer to get header node
502 + node.buffer = NULL; // clear node.buffer to get header node
503 // - and for ErrorExit
505 while (true)
506 @@ -192,7 +192,7 @@ OSStatus FreeNode (BTreeControlBlockPtr btreePtr, UInt32 nodeNum)
508 //////////////////////////// Find Map Record ////////////////////////////////
509 nodeIndex = 0; // first node number of header map record
510 - node.buffer = nil; // invalidate node.buffer to get header node
511 + node.buffer = NULL; // invalidate node.buffer to get header node
513 while (nodeNum >= nodeIndex)
515 @@ -278,8 +278,8 @@ OSStatus ExtendBTree (BTreeControlBlockPtr btreePtr,
516 nodeSize = btreePtr->nodeSize;
517 filePtr = btreePtr->fcbPtr;
519 - mapNode.buffer = nil;
520 - newNode.buffer = nil;
521 + mapNode.buffer = NULL;
522 + newNode.buffer = NULL;
524 mapNodeRecSize = nodeSize - sizeof(BTNodeDescriptor) - 6; // 2 bytes of free space (see note)
526 @@ -448,7 +448,7 @@ ErrorExit:
527 Routine: GetMapNode - Get the next map node and pointer to the map record.
529 Function: Given a BlockDescriptor to a map node in nodePtr, GetMapNode releases
530 - it and gets the next node. If nodePtr->buffer is nil, then the header
531 + it and gets the next node. If nodePtr->buffer is NULL, then the header
532 node is retrieved.
535 @@ -474,7 +474,7 @@ OSStatus GetMapNode (BTreeControlBlockPtr btreePtr,
536 UInt16 mapIndex;
537 UInt32 nextNodeNum;
539 - if (nodePtr->buffer != nil) // if iterator is valid...
540 + if (nodePtr->buffer != NULL) // if iterator is valid...
542 nextNodeNum = ((NodeDescPtr)nodePtr->buffer)->fLink;
543 if (nextNodeNum == 0)
544 @@ -521,7 +521,7 @@ ErrorExit:
546 (void) ReleaseNode (btreePtr, nodePtr);
548 - *mapPtr = nil;
549 + *mapPtr = NULL;
550 *mapSize = 0;
552 return err;
553 diff --git a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
554 index 7c9edca..997f34b 100644
555 --- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
556 +++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
557 @@ -236,13 +236,13 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
558 // assume index points to UInt16
559 // assume foundRecord points to Boolean
561 - left->buffer = nil;
562 - middle->buffer = nil;
563 - right->buffer = nil;
564 + left->buffer = NULL;
565 + middle->buffer = NULL;
566 + right->buffer = NULL;
568 foundIt = false;
570 - if (iterator == nil) // do we have an iterator?
571 + if (iterator == NULL) // do we have an iterator?
573 err = fsBTInvalidIteratorErr;
574 goto ErrorExit;
575 @@ -250,7 +250,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
577 #if SupportsKeyDescriptors
578 //¥¥ verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?)
579 - if (btreePtr->keyDescPtr != nil)
580 + if (btreePtr->keyDescPtr != NULL)
582 err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength );
583 M_ExitOnError (err);
584 @@ -309,7 +309,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
586 *right = *middle;
587 *middle = *left;
588 - left->buffer = nil;
589 + left->buffer = NULL;
590 index = leftIndex;
592 goto SuccessfulExit;
593 @@ -330,7 +330,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
595 *right = *middle;
596 *middle = *left;
597 - left->buffer = nil;
598 + left->buffer = NULL;
599 index = leftIndex;
601 goto SuccessfulExit;
602 @@ -363,7 +363,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
604 *left = *middle;
605 *middle = *right;
606 - right->buffer = nil;
607 + right->buffer = NULL;
608 index = rightIndex;
610 goto SuccessfulExit;
611 @@ -427,15 +427,15 @@ OSStatus CheckInsertParams (SFCB *filePtr,
613 BTreeControlBlockPtr btreePtr;
615 - if (filePtr == nil) return paramErr;
616 + if (filePtr == NULL) return paramErr;
618 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
619 - if (btreePtr == nil) return fsBTInvalidFileErr;
620 - if (iterator == nil) return paramErr;
621 - if (record == nil) return paramErr;
622 + if (btreePtr == NULL) return fsBTInvalidFileErr;
623 + if (iterator == NULL) return paramErr;
624 + if (record == NULL) return paramErr;
626 #if SupportsKeyDescriptors
627 - if (btreePtr->keyDescPtr != nil)
628 + if (btreePtr->keyDescPtr != NULL)
630 OSStatus err;
632 diff --git a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
633 index da07cc7..ef2bd7b 100644
634 --- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
635 +++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
636 @@ -105,7 +105,7 @@ Function: Gets an existing BTree node from FS Agent and verifies it.
637 Input: btreePtr - pointer to BTree control block
638 nodeNum - number of node to request
640 -Output: nodePtr - pointer to beginning of node (nil if error)
641 +Output: nodePtr - pointer to beginning of node (NULL if error)
643 Result:
644 noErr - success
645 @@ -139,7 +139,7 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr,
646 if (err != noErr)
648 Panic ("\pGetNode: getNodeProc returned error.");
649 - nodePtr->buffer = nil;
650 + nodePtr->buffer = NULL;
651 goto ErrorExit;
653 ++btreePtr->numGetNodes;
654 @@ -156,8 +156,8 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr,
655 return noErr;
657 ErrorExit:
658 - nodePtr->buffer = nil;
659 - nodePtr->blockHeader = nil;
660 + nodePtr->buffer = NULL;
661 + nodePtr->blockHeader = NULL;
663 // LogEndTime(kTraceGetNode, err);
665 @@ -176,7 +176,7 @@ Function: Gets a new BTree node from FS Agent and initializes it to an empty
666 Input: btreePtr - pointer to BTree control block
667 nodeNum - number of node to request
669 -Output: returnNodePtr - pointer to beginning of node (nil if error)
670 +Output: returnNodePtr - pointer to beginning of node (NULL if error)
672 Result: noErr - success
673 != noErr - failure
674 @@ -203,7 +203,7 @@ OSStatus GetNewNode (BTreeControlBlockPtr btreePtr,
675 if (err != noErr)
677 Panic ("\pGetNewNode: getNodeProc returned error.");
678 - returnNodePtr->buffer = nil;
679 + returnNodePtr->buffer = NULL;
680 return err;
682 ++btreePtr->numGetNewNodes;
683 @@ -248,7 +248,7 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr,
685 err = noErr;
687 - if (nodePtr->buffer != nil)
688 + if (nodePtr->buffer != NULL)
691 * The nodes must remain in the cache as big endian!
692 @@ -267,8 +267,8 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr,
693 ++btreePtr->numReleaseNodes;
696 - nodePtr->buffer = nil;
697 - nodePtr->blockHeader = nil;
698 + nodePtr->buffer = NULL;
699 + nodePtr->blockHeader = NULL;
701 // LogEndTime(kTraceReleaseNode, err);
703 @@ -299,7 +299,7 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr,
705 err = noErr;
707 - if (nodePtr->buffer != nil)
708 + if (nodePtr->buffer != NULL)
710 releaseNodeProc = btreePtr->releaseBlockProc;
711 err = releaseNodeProc (btreePtr->fcbPtr,
712 @@ -309,8 +309,8 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr,
713 ++btreePtr->numReleaseNodes;
716 - nodePtr->buffer = nil;
717 - nodePtr->blockHeader = nil;
718 + nodePtr->buffer = NULL;
719 + nodePtr->blockHeader = NULL;
721 return err;
723 @@ -338,7 +338,7 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr,
725 err = noErr;
727 - if (nodePtr->buffer != nil) //¥¥ why call UpdateNode if nil ?!?
728 + if (nodePtr->buffer != NULL) //¥¥ why call UpdateNode if NULL ?!?
730 // LogStartTime(kTraceReleaseNode);
731 err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig);
732 @@ -358,8 +358,8 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr,
733 ++btreePtr->numUpdateNodes;
736 - nodePtr->buffer = nil;
737 - nodePtr->blockHeader = nil;
738 + nodePtr->buffer = NULL;
739 + nodePtr->blockHeader = NULL;
741 return noErr;
743 diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
744 index 37fb170..73e1fda 100644
745 --- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
746 +++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
747 @@ -177,7 +177,7 @@ Output: nodeNum - number of the node containing the key position
749 Result: noErr - key found, index is record index
750 fsBTRecordNotFoundErr - key not found, index is insert index
751 - fsBTEmptyErr - key not found, return params are nil
752 + fsBTEmptyErr - key not found, return params are NULL
753 otherwise - catastrophic failure (GetNode/ReleaseNode failed)
754 -------------------------------------------------------------------------------*/
756 @@ -321,8 +321,8 @@ ReleaseAndExit:
757 ErrorExit:
759 *nodeNum = 0;
760 - nodePtr->buffer = nil;
761 - nodePtr->blockHeader = nil;
762 + nodePtr->buffer = NULL;
763 + nodePtr->blockHeader = NULL;
764 *returnIndex = 0;
766 return err;
767 @@ -354,7 +354,7 @@ OSStatus InsertTree ( BTreeControlBlockPtr btreePtr,
768 primaryKey.replacingKey = replacingKey;
769 primaryKey.skipRotate = false;
771 - err = InsertLevel (btreePtr, treePathTable, &primaryKey, nil,
772 + err = InsertLevel (btreePtr, treePathTable, &primaryKey, NULL,
773 targetNode, index, level, insertNode );
775 return err;
776 @@ -385,7 +385,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
777 #if defined(applec) && !defined(__SC__)
778 PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! ");
779 #endif
780 - siblingNode.buffer = nil;
781 + siblingNode.buffer = NULL;
782 targetNodeNum = treePathTable [level].node;
784 insertParent = false;
785 @@ -420,7 +420,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
787 ////// process second insert (if any) //////
789 - if ( secondaryKey != nil )
790 + if (secondaryKey != NULL)
792 Boolean temp;
794 @@ -446,7 +446,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
795 UInt8 * recPtr;
796 UInt16 recSize;
798 - secondaryKey = nil;
799 + secondaryKey = NULL;
801 PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
803 @@ -606,9 +606,9 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr,
805 if ( leftNodeNum > 0 )
807 - PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
808 + PanicIf(siblingNode->buffer != NULL, "InsertNode: siblingNode already aquired!");
810 - if ( siblingNode->buffer == nil )
811 + if (siblingNode->buffer == NULL)
813 err = GetNode (btreePtr, leftNodeNum, siblingNode); // will be released by caller or a split below
814 M_ExitOnError (err);
815 @@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
817 targetNodeNum = treePathTable[level].node;
818 targetNodePtr = targetNode->buffer;
819 - PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
820 + PanicIf (targetNodePtr == NULL, "DeleteTree: targetNode has NULL buffer!");
822 DeleteRecord (btreePtr, targetNodePtr, index);
824 @@ -766,7 +766,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
825 deleteRequired = false;
826 updateRequired = false;
828 - if ( targetNode->buffer == nil ) // then root was freed and the btree is empty
829 + if (targetNode->buffer == NULL) // then root was freed and the btree is empty
831 btreePtr->rootNode = 0;
832 btreePtr->treeDepth = 0;
833 @@ -1124,7 +1124,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr,
834 if ( (right->height == 1) && (right->kind != kBTLeafNode) )
835 return fsBTInvalidNodeErr;
837 - if ( left != nil )
838 + if (left != NULL)
840 if ( left->fLink != rightNodeNum )
841 return fsBTInvalidNodeErr; //¥¥ E_BadSibling ?
842 @@ -1145,7 +1145,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr,
844 /////////////// Update Forward Link In Original Left Node ///////////////////
846 - if ( left != nil )
847 + if (left != NULL)
849 left->fLink = newNodeNum;
850 err = UpdateNode (btreePtr, leftNode);
851 @@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeControlBlockPtr btreePtr,
852 Boolean didItFit;
853 UInt16 keyLength;
855 - PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
856 - PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
857 + PanicIf (leftNode == NULL, "AddNewRootNode: leftNode == NULL");
858 + PanicIf (rightNode == NULL, "AddNewRootNode: rightNode == NULL");
861 /////////////////////// Initialize New Root Node ////////////////////////////
862 @@ -1362,7 +1362,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr,
863 if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) )
864 return fsBTInvalidNodeErr;
866 - if ( rightPtr != nil )
867 + if (rightPtr != NULL)
869 if ( rightPtr->bLink != nodeNum )
870 return fsBTInvalidNodeErr; //¥¥ E_BadSibling ?
871 @@ -1382,7 +1382,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr,
873 /////////////// Update backward Link In Original Right Node ///////////////////
875 - if ( rightPtr != nil )
876 + if (rightPtr != NULL)
878 rightPtr->bLink = newNodeNum;
879 err = UpdateNode (btreePtr, rightNodePtr);
880 @@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
881 UInt16 keyLength;
882 KeyPtr keyPtr;
883 UInt8 *dataPtr;
884 - KeyPtr prevkeyP = nil;
885 + KeyPtr prevkeyP = NULL;
888 if ( nodeP->numRecords == 0 )
889 @@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
890 return( -1 );
893 - if ( prevkeyP != nil )
894 + if (prevkeyP != NULL)
896 if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
898 diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
899 index 8b03ece..d3145e0 100644
900 --- a/fsck_hfs.tproj/dfalib/SControl.c
901 +++ b/fsck_hfs.tproj/dfalib/SControl.c
902 @@ -82,7 +82,7 @@ CheckHFS( int fsReadRef, int fsWriteRef, int checkLevel, int repairLevel,
904 SGlob dataArea; // Allocate the scav globals
905 short temp;
906 - FileIdentifierTable *fileIdentifierTable = nil;
907 + FileIdentifierTable *fileIdentifierTable = NULL;
908 OSErr err = noErr;
909 OSErr scavError = 0;
910 int scanCount = 0;
911 @@ -228,7 +228,7 @@ DoAgain:
914 // Set up structures for post processing
915 - if ( (autoRepair == true) && (dataArea.fileIdentifierTable != nil) )
916 + if ((autoRepair == true) && (dataArea.fileIdentifierTable != NULL))
918 // *repairInfo = *repairInfo | kVolumeHadOverlappingExtents; // Report back that volume has overlapping extents
919 fileIdentifierTable = (FileIdentifierTable *) AllocateMemory( GetHandleSize( (Handle) dataArea.fileIdentifierTable ) );
920 @@ -239,7 +239,7 @@ DoAgain:
922 // Post processing
924 - if ( fileIdentifierTable != nil )
925 + if (fileIdentifierTable != NULL)
927 DisposeMemory( fileIdentifierTable );
929 @@ -682,7 +682,7 @@ short CheckForStop( SGlob *GPtr )
931 //if ( ((ticks - 10) > GPtr->lastTickCount) || (dfaStage == kAboutToRepairStage) ) // To reduce cursor flicker on fast machines, call through on a timed interval
933 - if ( GPtr->userCancelProc != nil )
934 + if (GPtr->userCancelProc != NULL)
936 UInt64 progress = 0;
937 Boolean progressChanged;
938 @@ -761,7 +761,7 @@ static int ScavSetUp( SGlob *GPtr)
939 short ioRefNum;
940 #endif
942 - GPtr->MinorRepairsP = nil;
943 + GPtr->MinorRepairsP = NULL;
945 GPtr->itemsProcessed = 0;
946 GPtr->lastProgress = 0;
947 @@ -774,7 +774,7 @@ static int ScavSetUp( SGlob *GPtr)
948 ScavStaticStructures *pointer;
950 pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
951 - if ( pointer == nil ) {
952 + if (pointer == NULL) {
953 if ( GPtr->logLevel >= kDebugLog ) {
954 printf( "\t error %d - could not allocate %i bytes of memory \n",
955 R_NoMem, sizeof(ScavStaticStructures) );
956 @@ -831,7 +831,7 @@ static int ScavSetUp( SGlob *GPtr)
957 // Save current value of vcbWrCnt, to detect modifications to volume by other apps etc
958 if ( GPtr->volumeFeatures & volumeIsMountedMask )
960 - FlushVol( nil, GPtr->realVCB->vcbVRefNum ); // Ask HFS to update all changes to disk
961 + FlushVol(NULL, GPtr->realVCB->vcbVRefNum); // Ask HFS to update all changes to disk
962 GPtr->wrCnt = GPtr->realVCB->vcbWrCnt; // Remember write count after writing changes
964 #endif
965 @@ -949,7 +949,7 @@ static int ScavSetUp( SGlob *GPtr)
967 // Keep a valid file id list for HFS volumes
968 GPtr->validFilesList = (UInt32**)NewHandle( 0 );
969 - if ( GPtr->validFilesList == nil ) {
970 + if (GPtr->validFilesList == NULL) {
971 if ( GPtr->logLevel >= kDebugLog ) {
972 printf( "\t error %d - could not allocate file ID list \n", R_NoMem );
974 @@ -995,17 +995,17 @@ static int ScavTerm( SGlobPtr GPtr )
976 (void) BitMapCheckEnd();
978 - while( (rP = GPtr->MinorRepairsP) != nil ) // loop freeing leftover (undone) repair orders
979 + while((rP = GPtr->MinorRepairsP) != NULL) // loop freeing leftover (undone) repair orders
981 GPtr->MinorRepairsP = rP->link; // (in case repairs were not made)
982 DisposeMemory(rP);
983 err = MemError();
986 - if( GPtr->validFilesList != nil )
987 + if (GPtr->validFilesList != NULL)
988 DisposeHandle( (Handle) GPtr->validFilesList );
990 - if( GPtr->overlappedExtents != nil ) {
991 + if (GPtr->overlappedExtents != NULL) {
992 extentsTableH = GPtr->overlappedExtents;
994 /* Overlapped extents list also allocated memory for attribute name */
995 @@ -1021,44 +1021,44 @@ static int ScavTerm( SGlobPtr GPtr )
996 DisposeHandle( (Handle) GPtr->overlappedExtents );
999 - if( GPtr->fileIdentifierTable != nil )
1000 + if (GPtr->fileIdentifierTable != NULL)
1001 DisposeHandle( (Handle) GPtr->fileIdentifierTable );
1003 - if( GPtr->calculatedVCB == nil ) // already freed?
1004 + if (GPtr->calculatedVCB == NULL) // already freed?
1005 return( noErr );
1007 // If the FCB's and BTCB's have been set up, dispose of them
1008 fcbP = GPtr->calculatedExtentsFCB; // release extent file BTree bit map
1009 - if ( fcbP != nil )
1010 + if (fcbP != NULL)
1012 btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
1013 - if ( btcbP != nil)
1014 + if (btcbP != NULL)
1016 - if( btcbP->refCon != nil )
1017 + if (btcbP->refCon != NULL)
1019 - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
1020 + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
1022 DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
1023 err = MemError();
1025 DisposeMemory( (Ptr)btcbP->refCon );
1026 err = MemError();
1027 - btcbP->refCon = nil;
1028 + btcbP->refCon = NULL;
1031 fcbP = GPtr->calculatedCatalogFCB; // release catalog BTree bit map
1032 btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
1034 - if( btcbP->refCon != nil )
1035 + if (btcbP->refCon != NULL)
1037 - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
1038 + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
1040 DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
1041 err = MemError();
1043 DisposeMemory( (Ptr)btcbP->refCon );
1044 err = MemError();
1045 - btcbP->refCon = nil;
1046 + btcbP->refCon = NULL;
1050 @@ -1066,7 +1066,7 @@ static int ScavTerm( SGlobPtr GPtr )
1051 DisposeMemory( GPtr->calculatedVCB ); // Release our block of data structures
1052 err = MemError();
1054 - GPtr->calculatedVCB = nil;
1055 + GPtr->calculatedVCB = NULL;
1057 return( noErr );
1059 @@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
1060 // Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks.
1061 driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum);
1062 driverDCtlPtr = *driverDCtlHandle;
1063 - if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != nil))
1064 + if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != NULL))
1066 if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0)
1068 @@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
1071 driverName = (StringPtr)&(drvrHeaderPtr->drvrName);
1072 - if (!(IdenticalString(driverName,blueBoxSharedDriverName,nil)))
1073 + if (!(IdenticalString(driverName,blueBoxSharedDriverName,NULL)))
1075 return( true );
1078 // Special case for the ".Sony" floppy driver which might be accessed in Shared mode inside the Blue Box
1079 // Test its "where" string instead of the driver name.
1080 - if (!(IdenticalString(driverName,sonyDriverName,nil)))
1081 + if (!(IdenticalString(driverName,sonyDriverName,NULL)))
1083 CntrlParam paramBlock;
1085 - paramBlock.ioCompletion = nil;
1086 - paramBlock.ioNamePtr = nil;
1087 + paramBlock.ioCompletion = NULL;
1088 + paramBlock.ioNamePtr = NULL;
1089 paramBlock.ioVRefNum = dqPtr->dQDrive;
1090 paramBlock.ioCRefNum = dqPtr->dQRefNum;
1091 paramBlock.csCode = kDriveIcon; // return physical icon
1092 @@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
1094 iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam;
1095 whereStringPtr = (StringPtr) & iconAndStringRecPtr->string;
1096 - if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,nil)))
1097 + if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,NULL)))
1099 return( true );
1101 diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
1102 index 89c12d6..b261c37 100644
1103 --- a/fsck_hfs.tproj/dfalib/SRepair.c
1104 +++ b/fsck_hfs.tproj/dfalib/SRepair.c
1105 @@ -844,7 +844,7 @@ static int DelFThd( SGlobPtr GPtr, UInt32 fid ) // the file ID
1107 isHFSPlus = VolumeObjectIsHFSPlus( );
1109 - BuildCatalogKey( fid, (const CatalogName*) nil, isHFSPlus, &key );
1110 + BuildCatalogKey(fid, NULL, isHFSPlus, &key);
1111 result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
1113 if ( result ) return ( IntError( GPtr, result ) );
1114 @@ -910,7 +910,7 @@ static OSErr FixDirThread( SGlobPtr GPtr, UInt32 did ) // the dir ID
1116 isHFSPlus = VolumeObjectIsHFSPlus( );
1118 - BuildCatalogKey( did, (const CatalogName*) nil, isHFSPlus, &key );
1119 + BuildCatalogKey(did, NULL, isHFSPlus, &key);
1120 result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
1122 if ( result )
1123 @@ -2171,7 +2171,7 @@ static OSErr FixOrphanedFiles ( SGlobPtr GPtr )
1126 //-- Build the key for the file thread
1127 - BuildCatalogKey( cNodeID, nil, isHFSPlus, &key );
1128 + BuildCatalogKey(cNodeID, NULL, isHFSPlus, &key);
1130 err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint,
1131 &tempKey, &threadRecord, &recordSize, &hint2 );
1132 diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
1133 index 6e9253e..491afbf 100644
1134 --- a/fsck_hfs.tproj/dfalib/SUtils.c
1135 +++ b/fsck_hfs.tproj/dfalib/SUtils.c
1136 @@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
1137 err = GetVCBDriveNum( &GPtr->realVCB, GPtr->DrvNum );
1138 ReturnIfError( err );
1140 - if ( GPtr->realVCB != nil )
1141 + if (GPtr->realVCB != NULL)
1143 GPtr->volumeFeatures |= volumeIsMountedMask;
1145 - pb.ioParam.ioNamePtr = nil;
1146 + pb.ioParam.ioNamePtr = NULL;
1147 pb.ioParam.ioVRefNum = GPtr->realVCB->vcbVRefNum;
1148 pb.ioParam.ioBuffer = (Ptr) &buffer;
1149 pb.ioParam.ioReqCount = sizeof( buffer );
1150 @@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *cur);
1151 * 4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord
1152 * indicates which btree prime number bucket should be incremented
1154 - * Output: nil
1155 + * Output: NULL
1157 void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype)
1159 diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
1160 index 39bda5c..c33155f 100644
1161 --- a/fsck_hfs.tproj/dfalib/SVerify1.c
1162 +++ b/fsck_hfs.tproj/dfalib/SVerify1.c
1163 @@ -790,13 +790,13 @@ OSErr CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
1164 // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
1166 btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
1167 - if ( btcb->refCon == nil ) {
1168 + if (btcb->refCon == NULL) {
1169 err = R_NoMem;
1170 goto exit;
1172 size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
1173 ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
1174 - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
1175 + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
1177 err = R_NoMem;
1178 goto exit;
1179 @@ -1145,13 +1145,13 @@ OSErr CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
1182 btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
1183 - if ( btcb->refCon == nil ) {
1184 + if (btcb->refCon == NULL) {
1185 err = R_NoMem;
1186 goto exit;
1188 size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
1189 ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
1190 - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
1191 + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
1193 err = R_NoMem;
1194 goto exit;
1195 @@ -1339,7 +1339,7 @@ OSErr CatHChk( SGlobPtr GPtr )
1197 //¥¥ Can we ignore this part by just taking advantage of setting the selCode = 0x8001;
1199 - BuildCatalogKey( 1, (const CatalogName *)nil, isHFSPlus, &key );
1200 + BuildCatalogKey(1, NULL, isHFSPlus, &key);
1201 result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
1203 GPtr->TarBlock = hint; /* set target block */
1204 @@ -1443,7 +1443,7 @@ OSErr CatHChk( SGlobPtr GPtr )
1206 * Find thread record
1208 - BuildCatalogKey( dprP->directoryID, (const CatalogName *) nil, isHFSPlus, &key );
1209 + BuildCatalogKey(dprP->directoryID, NULL, isHFSPlus, &key);
1210 result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
1211 if ( result != noErr ) {
1212 char idStr[16];
1213 @@ -1780,26 +1780,26 @@ OSErr CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
1214 // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
1216 btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
1217 - if ( btcb->refCon == nil ) {
1218 + if (btcb->refCon == NULL) {
1219 err = R_NoMem;
1220 goto exit;
1223 if (btcb->totalNodes == 0)
1225 - ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = nil;
1226 + ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = NULL;
1227 ((BTreeExtensionsRec*)btcb->refCon)->BTCBMSize = 0;
1228 ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount = 0;
1230 else
1232 - if ( btcb->refCon == nil ) {
1233 + if (btcb->refCon == NULL) {
1234 err = R_NoMem;
1235 goto exit;
1237 size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
1238 ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
1239 - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
1240 + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
1242 err = R_NoMem;
1243 goto exit;
1244 @@ -2358,7 +2358,7 @@ static OSErr RcdMDBEmbededVolDescriptionErr( SGlobPtr GPtr, OSErr type, HFSMaste
1245 RcdError( GPtr, type ); // first, record the error
1247 p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) ); // get the node
1248 - if ( p == nil ) return( R_NoMem );
1249 + if (p == NULL) return( R_NoMem );
1251 p->type = type; // save error info
1252 desc = (EmbededVolDescription *) &(p->name);
1253 @@ -2397,7 +2397,7 @@ static OSErr RcdInvalidWrapperExtents( SGlobPtr GPtr, OSErr type )
1254 RcdError( GPtr, type ); // first, record the error
1256 p = AllocMinorRepairOrder( GPtr, 0 ); // get the node
1257 - if ( p == nil ) return( R_NoMem );
1258 + if (p == NULL) return( R_NoMem );
1260 p->type = type; // save error info
1262 @@ -3029,7 +3029,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
1263 foundBadExtent = false;
1264 lastExtentIndex = GPtr->numExtents;
1266 - while ( (extents != nil) && (err == noErr) )
1267 + while ((extents != NULL) && (err == noErr))
1269 // checkout the extent record first
1270 err = ChkExtRec( GPtr, extents, &lastExtentIndex );
1271 @@ -3105,7 +3105,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
1272 if ( err == btNotFound )
1274 err = noErr; // no more extent records
1275 - extents = nil;
1276 + extents = NULL;
1277 break;
1279 else if ( err != noErr )
1280 @@ -3121,7 +3121,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
1281 if ( err == btNotFound )
1283 err = noErr; // no more extent records
1284 - extents = nil;
1285 + extents = NULL;
1286 break;
1288 else if ( err != noErr )
1289 @@ -3205,7 +3205,7 @@ static OSErr AddExtentToOverlapList( SGlobPtr GPtr, HFSCatalogNodeID fileNumber,
1292 // If it's uninitialized
1293 - if ( GPtr->overlappedExtents == nil )
1294 + if (GPtr->overlappedExtents == NULL)
1296 GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) );
1297 extentsTableH = GPtr->overlappedExtents;
1298 diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
1299 index c68f3d8..da1a982 100644
1300 --- a/fsck_hfs.tproj/dfalib/SVerify2.c
1301 +++ b/fsck_hfs.tproj/dfalib/SVerify2.c
1302 @@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
1303 UInt16 keyLength;
1304 KeyPtr keyPtr;
1305 UInt8 *dataPtr;
1306 - KeyPtr prevkeyP = nil;
1307 + KeyPtr prevkeyP = NULL;
1310 if ( nodeP->numRecords == 0 )
1311 @@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
1312 return( E_KeyLen );
1315 - if ( prevkeyP != nil )
1316 + if (prevkeyP != NULL)
1318 if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )