0010-Rename-custom-macro-nil-with-NULL.patch (45750B)
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 4 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(-) 17 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, 23 24 ////////////////////// Preliminary Error Checking /////////////////////////// 25 26 - headerNode.buffer = nil; 27 + headerNode.buffer = NULL; 28 29 - if (pathPtr == nil) return paramErr; 30 + if (pathPtr == NULL) return paramErr; 31 32 setEndOfForkProc = pathPtr->agentPtr->agent.setEndOfForkProc; 33 setBlockSizeProc = pathPtr->agentPtr->agent.setBlockSizeProc; 34 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; 43 44 forkPtr = pathPtr->path.forkPtr; 45 46 - if (forkPtr->fork.btreePtr != nil) return fsBTrFileAlreadyOpenErr; 47 + if (forkPtr->fork.btreePtr != NULL) return fsBTrFileAlreadyOpenErr; 48 49 if ((maxKeyLength == 0) || 50 (maxKeyLength > kMaxKeyLength)) return fsBTInvalidKeyLengthErr; 51 @@ -209,7 +209,7 @@ OSStatus BTInitialize (FCB *filePtr, 52 //////////////////////// Allocate Control Block ///////////////////////////// 53 54 M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); 55 - if (btreePtr == nil) 56 + if (btreePtr == NULL) 57 { 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, 70 71 ///////////////////// Copy Key Descriptor To Header ///////////////////////// 72 #if SupportsKeyDescriptors 73 - if (keyDescPtr != nil) 74 + if (keyDescPtr != NULL) 75 { 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); 81 82 - pathPtr->path.forkPtr->fork.btreePtr = nil; 83 + pathPtr->path.forkPtr->fork.btreePtr = NULL; 84 M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); 85 86 return noErr; 87 @@ -320,7 +320,7 @@ OSStatus BTInitialize (FCB *filePtr, 88 ErrorExit: 89 90 (void) ReleaseNode (btreePtr, &headerNode); 91 - if (btreePtr != nil) 92 + if (btreePtr != NULL) 93 M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); 94 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 98 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, 106 107 ////////////////////// Preliminary Error Checking /////////////////////////// 108 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) 119 { 120 return paramErr; 121 } 122 123 - if ( filePtr->fcbBtree != nil ) // already has a BTreeCB 124 + if (filePtr->fcbBtree != NULL) // already has a BTreeCB 125 return noErr; 126 127 // is file large enough to contain header node? 128 @@ -384,7 +384,7 @@ OSStatus BTOpenPath (SFCB *filePtr, 129 //////////////////////// Allocate Control Block ///////////////////////////// 130 131 btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) ); 132 - if (btreePtr == nil) 133 + if (btreePtr == NULL) 134 { 135 Panic ("\pBTOpen: no memory for btreePtr."); 136 return memFullErr; 137 @@ -397,7 +397,7 @@ OSStatus BTOpenPath (SFCB *filePtr, 138 139 /////////////////////////// Read Header Node //////////////////////////////// 140 141 - nodeRec.buffer = nil; // so we can call ReleaseNode 142 + nodeRec.buffer = NULL; // so we can call ReleaseNode 143 144 btreePtr->fcbPtr = filePtr; 145 filePtr->fcbBtree = (void *) btreePtr; // attach btree cb to file 146 @@ -487,7 +487,7 @@ OSStatus BTOpenPath (SFCB *filePtr, 147 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 152 { 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 158 { 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 161 } 162 163 err = ReleaseNode (btreePtr, &nodeRec); 164 @@ -528,7 +528,7 @@ OSStatus BTOpenPath (SFCB *filePtr, 165 166 ErrorExit: 167 168 - filePtr->fcbBtree = nil; 169 + filePtr->fcbBtree = NULL; 170 (void) ReleaseNode (btreePtr, &nodeRec); 171 DisposeMemory( btreePtr ); 172 173 @@ -567,7 +567,7 @@ OSStatus BTClosePath (SFCB *filePtr) 174 175 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 176 177 - if (btreePtr == nil) 178 + if (btreePtr == NULL) 179 return fsBTInvalidFileErr; 180 181 ////////////////////// Check for other BTree Paths ////////////////////////// 182 @@ -603,14 +603,14 @@ OSStatus BTClosePath (SFCB *filePtr) 183 M_ExitOnError (err); 184 185 #if SupportsKeyDescriptors 186 - if (btreePtr->keyDescPtr != nil) // deallocate keyDescriptor, if any 187 + if (btreePtr->keyDescPtr != NULL) // deallocate keyDescriptor, if any 188 { 189 DisposeMemory( btreePtr->keyDescPtr ); 190 } 191 #endif 192 193 DisposeMemory( btreePtr ); 194 - filePtr->fcbBtree = nil; 195 + filePtr->fcbBtree = NULL; 196 197 // LogEndTime(kTraceCloseBTree, noErr); 198 199 @@ -643,7 +643,7 @@ Function: Search for position in B*Tree indicated by searchKey. If a valid node 200 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) 205 206 Output: record - pointer to BufferDescriptor containing record 207 recordLen - length of data at recordPtr 208 @@ -678,14 +678,14 @@ OSStatus BTSearchRecord (SFCB *filePtr, 209 210 // LogStartTime(kTraceSearchBTree); 211 212 - if (filePtr == nil) return paramErr; 213 - if (searchIterator == nil) return paramErr; 214 + if (filePtr == NULL) return paramErr; 215 + if (searchIterator == NULL) return paramErr; 216 217 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 218 - if (btreePtr == nil) return fsBTInvalidFileErr; 219 + if (btreePtr == NULL) return fsBTInvalidFileErr; 220 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 224 { 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); 230 231 - if (recordLen != nil) *recordLen = len; 232 + if (recordLen != NULL) *recordLen = len; 233 234 - if (record != nil) 235 + if (record != NULL) 236 { 237 ByteCount recordSize; 238 239 @@ -794,7 +794,7 @@ OSStatus BTSearchRecord (SFCB *filePtr, 240 241 /////////////////////// Success - Update Iterator /////////////////////////// 242 243 - if (resultIterator != nil) 244 + if (resultIterator != NULL) 245 { 246 resultIterator->hint.writeCount = btreePtr->writeCount; 247 resultIterator->hint.nodeNum = nodeNum; 248 @@ -825,10 +825,10 @@ OSStatus BTSearchRecord (SFCB *filePtr, 249 250 ErrorExit: 251 252 - if (recordLen != nil) 253 + if (recordLen != NULL) 254 *recordLen = 0; 255 256 - if (resultIterator != nil) 257 + if (resultIterator != NULL) 258 { 259 resultIterator->hint.writeCount = 0; 260 resultIterator->hint.nodeNum = 0; 261 @@ -892,18 +892,18 @@ OSStatus BTIterateRecord (SFCB *filePtr, 262 263 ////////////////////////// Priliminary Checks /////////////////////////////// 264 265 - left.buffer = nil; 266 - right.buffer = nil; 267 - node.buffer = nil; 268 + left.buffer = NULL; 269 + right.buffer = NULL; 270 + node.buffer = NULL; 271 272 273 - if (filePtr == nil) 274 + if (filePtr == NULL) 275 { 276 return paramErr; 277 } 278 279 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 280 - if (btreePtr == nil) 281 + if (btreePtr == NULL) 282 { 283 return fsBTInvalidFileErr; //ее handle properly 284 } 285 @@ -968,7 +968,7 @@ OSStatus BTIterateRecord (SFCB *filePtr, 286 } 287 else 288 { 289 - if (left.buffer == nil) 290 + if (left.buffer == NULL) 291 { 292 nodeNum = ((NodeDescPtr) node.buffer)->bLink; 293 if ( nodeNum > 0) 294 @@ -981,13 +981,13 @@ OSStatus BTIterateRecord (SFCB *filePtr, 295 } 296 } 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); 302 } 303 right = node; 304 node = left; 305 - left.buffer = nil; 306 + left.buffer = NULL; 307 index = ((NodeDescPtr) node.buffer)->numRecords -1; 308 } 309 } 310 @@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord (SFCB *filePtr, 311 } 312 else 313 { 314 - if (right.buffer == nil) 315 + if (right.buffer == NULL) 316 { 317 nodeNum = ((NodeDescPtr) node.buffer)->fLink; 318 if ( nodeNum > 0) 319 @@ -1025,13 +1025,13 @@ OSStatus BTIterateRecord (SFCB *filePtr, 320 } 321 } 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); 327 } 328 left = node; 329 node = right; 330 - right.buffer = nil; 331 + right.buffer = NULL; 332 index = 0; 333 } 334 } 335 @@ -1054,9 +1054,9 @@ CopyData: 336 err = GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len); 337 M_ExitOnError (err); 338 339 - if (recordLen != nil) *recordLen = len; 340 + if (recordLen != NULL) *recordLen = len; 341 342 - if (record != nil) 343 + if (record != NULL) 344 { 345 ByteCount recordSize; 346 347 @@ -1069,7 +1069,7 @@ CopyData: 348 CopyMemory (recordPtr, record->bufferAddress, len); 349 } 350 351 - if (iterator != nil) // first & last do not require iterator 352 + if (iterator != NULL) // first & last do not require iterator 353 { 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); 359 360 - if (left.buffer != nil) 361 + if (left.buffer != NULL) 362 { 363 err = ReleaseNode (btreePtr, &left); 364 M_ExitOnError (err); 365 } 366 367 - if (right.buffer != nil) 368 + if (right.buffer != NULL) 369 { 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); 375 376 - if (recordLen != nil) 377 + if (recordLen != NULL) 378 *recordLen = 0; 379 380 - if (iterator != nil) 381 + if (iterator != NULL) 382 { 383 iterator->hint.writeCount = 0; 384 iterator->hint.nodeNum = 0; 385 @@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord (SFCB *filePtr, 386 387 ////////////////////////// Priliminary Checks /////////////////////////////// 388 389 - nodeRec.buffer = nil; // so we can call ReleaseNode 390 + nodeRec.buffer = NULL; // so we can call ReleaseNode 391 392 err = CheckInsertParams (filePtr, iterator, record, recordLen); 393 if (err != noErr) 394 @@ -1317,7 +1317,7 @@ OSStatus BTSetRecord (SFCB *filePtr, 395 396 ////////////////////////// Priliminary Checks /////////////////////////////// 397 398 - nodeRec.buffer = nil; // so we can call ReleaseNode 399 + nodeRec.buffer = NULL; // so we can call ReleaseNode 400 401 err = CheckInsertParams (filePtr, iterator, record, recordLen); 402 if (err != noErr) 403 @@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord (SFCB *filePtr, 404 405 ////////////////////////// Priliminary Checks /////////////////////////////// 406 407 - nodeRec.buffer = nil; // so we can call ReleaseNode 408 + nodeRec.buffer = NULL; // so we can call ReleaseNode 409 410 err = CheckInsertParams (filePtr, iterator, record, recordLen); 411 if (err != noErr) 412 @@ -1645,20 +1645,20 @@ OSStatus BTDeleteRecord (SFCB *filePtr, 413 414 ////////////////////////// Priliminary Checks /////////////////////////////// 415 416 - nodeRec.buffer = nil; // so we can call ReleaseNode 417 + nodeRec.buffer = NULL; // so we can call ReleaseNode 418 419 - M_ReturnErrorIf (filePtr == nil, paramErr); 420 - M_ReturnErrorIf (iterator == nil, paramErr); 421 + M_ReturnErrorIf (filePtr == NULL, paramErr); 422 + M_ReturnErrorIf (iterator == NULL, paramErr); 423 424 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 425 - if (btreePtr == nil) 426 + if (btreePtr == NULL) 427 { 428 err = fsBTInvalidFileErr; 429 goto ErrorExit; 430 } 431 432 #if SupportsKeyDescriptors 433 - if (btreePtr->keyDescPtr != nil) 434 + if (btreePtr->keyDescPtr != NULL) 435 { 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; 440 441 442 - M_ReturnErrorIf (filePtr == nil, paramErr); 443 + M_ReturnErrorIf (filePtr == NULL, paramErr); 444 445 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 446 447 - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr); 448 - M_ReturnErrorIf (info == nil, paramErr); 449 + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr); 450 + M_ReturnErrorIf (info == NULL, paramErr); 451 452 //ее check version? 453 454 @@ -1730,7 +1730,7 @@ OSStatus BTGetInformation (SFCB *filePtr, 455 info->keyDescriptor = btreePtr->keyDescPtr; //ее this won't do at all... 456 info->reserved = 0; 457 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) 464 465 // LogStartTime(kTraceFlushBTree); 466 467 - M_ReturnErrorIf (filePtr == nil, paramErr); 468 + M_ReturnErrorIf (filePtr == NULL, paramErr); 469 470 btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; 471 472 - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr); 473 + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr); 474 475 err = UpdateHeader (btreePtr); 476 477 @@ -1788,13 +1788,13 @@ Input: iterator - pointer to BTreeIterator 478 Output: iterator - iterator with the hint.nodeNum cleared 479 480 Result: noErr - success 481 - paramErr - iterator == nil 482 + paramErr - iterator == NULL 483 -------------------------------------------------------------------------------*/ 484 485 486 OSStatus BTInvalidateHint (BTreeIterator *iterator ) 487 { 488 - if (iterator == nil) 489 + if (iterator == NULL) 490 return paramErr; 491 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) 498 499 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 504 505 while (true) 506 @@ -192,7 +192,7 @@ OSStatus FreeNode (BTreeControlBlockPtr btreePtr, UInt32 nodeNum) 507 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 512 513 while (nodeNum >= nodeIndex) 514 { 515 @@ -278,8 +278,8 @@ OSStatus ExtendBTree (BTreeControlBlockPtr btreePtr, 516 nodeSize = btreePtr->nodeSize; 517 filePtr = btreePtr->fcbPtr; 518 519 - mapNode.buffer = nil; 520 - newNode.buffer = nil; 521 + mapNode.buffer = NULL; 522 + newNode.buffer = NULL; 523 524 mapNodeRecSize = nodeSize - sizeof(BTNodeDescriptor) - 6; // 2 bytes of free space (see note) 525 526 @@ -448,7 +448,7 @@ ErrorExit: 527 Routine: GetMapNode - Get the next map node and pointer to the map record. 528 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. 533 534 535 @@ -474,7 +474,7 @@ OSStatus GetMapNode (BTreeControlBlockPtr btreePtr, 536 UInt16 mapIndex; 537 UInt32 nextNodeNum; 538 539 - if (nodePtr->buffer != nil) // if iterator is valid... 540 + if (nodePtr->buffer != NULL) // if iterator is valid... 541 { 542 nextNodeNum = ((NodeDescPtr)nodePtr->buffer)->fLink; 543 if (nextNodeNum == 0) 544 @@ -521,7 +521,7 @@ ErrorExit: 545 546 (void) ReleaseNode (btreePtr, nodePtr); 547 548 - *mapPtr = nil; 549 + *mapPtr = NULL; 550 *mapSize = 0; 551 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 560 561 - left->buffer = nil; 562 - middle->buffer = nil; 563 - right->buffer = nil; 564 + left->buffer = NULL; 565 + middle->buffer = NULL; 566 + right->buffer = NULL; 567 568 foundIt = false; 569 570 - if (iterator == nil) // do we have an iterator? 571 + if (iterator == NULL) // do we have an iterator? 572 { 573 err = fsBTInvalidIteratorErr; 574 goto ErrorExit; 575 @@ -250,7 +250,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr, 576 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) 581 { 582 err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength ); 583 M_ExitOnError (err); 584 @@ -309,7 +309,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr, 585 { 586 *right = *middle; 587 *middle = *left; 588 - left->buffer = nil; 589 + left->buffer = NULL; 590 index = leftIndex; 591 592 goto SuccessfulExit; 593 @@ -330,7 +330,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr, 594 { 595 *right = *middle; 596 *middle = *left; 597 - left->buffer = nil; 598 + left->buffer = NULL; 599 index = leftIndex; 600 601 goto SuccessfulExit; 602 @@ -363,7 +363,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr, 603 { 604 *left = *middle; 605 *middle = *right; 606 - right->buffer = nil; 607 + right->buffer = NULL; 608 index = rightIndex; 609 610 goto SuccessfulExit; 611 @@ -427,15 +427,15 @@ OSStatus CheckInsertParams (SFCB *filePtr, 612 { 613 BTreeControlBlockPtr btreePtr; 614 615 - if (filePtr == nil) return paramErr; 616 + if (filePtr == NULL) return paramErr; 617 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; 625 626 #if SupportsKeyDescriptors 627 - if (btreePtr->keyDescPtr != nil) 628 + if (btreePtr->keyDescPtr != NULL) 629 { 630 OSStatus err; 631 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 639 640 -Output: nodePtr - pointer to beginning of node (nil if error) 641 +Output: nodePtr - pointer to beginning of node (NULL if error) 642 643 Result: 644 noErr - success 645 @@ -139,7 +139,7 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr, 646 if (err != noErr) 647 { 648 Panic ("\pGetNode: getNodeProc returned error."); 649 - nodePtr->buffer = nil; 650 + nodePtr->buffer = NULL; 651 goto ErrorExit; 652 } 653 ++btreePtr->numGetNodes; 654 @@ -156,8 +156,8 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr, 655 return noErr; 656 657 ErrorExit: 658 - nodePtr->buffer = nil; 659 - nodePtr->blockHeader = nil; 660 + nodePtr->buffer = NULL; 661 + nodePtr->blockHeader = NULL; 662 663 // LogEndTime(kTraceGetNode, err); 664 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 668 669 -Output: returnNodePtr - pointer to beginning of node (nil if error) 670 +Output: returnNodePtr - pointer to beginning of node (NULL if error) 671 672 Result: noErr - success 673 != noErr - failure 674 @@ -203,7 +203,7 @@ OSStatus GetNewNode (BTreeControlBlockPtr btreePtr, 675 if (err != noErr) 676 { 677 Panic ("\pGetNewNode: getNodeProc returned error."); 678 - returnNodePtr->buffer = nil; 679 + returnNodePtr->buffer = NULL; 680 return err; 681 } 682 ++btreePtr->numGetNewNodes; 683 @@ -248,7 +248,7 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr, 684 685 err = noErr; 686 687 - if (nodePtr->buffer != nil) 688 + if (nodePtr->buffer != NULL) 689 { 690 /* 691 * The nodes must remain in the cache as big endian! 692 @@ -267,8 +267,8 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr, 693 ++btreePtr->numReleaseNodes; 694 } 695 696 - nodePtr->buffer = nil; 697 - nodePtr->blockHeader = nil; 698 + nodePtr->buffer = NULL; 699 + nodePtr->blockHeader = NULL; 700 701 // LogEndTime(kTraceReleaseNode, err); 702 703 @@ -299,7 +299,7 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr, 704 705 err = noErr; 706 707 - if (nodePtr->buffer != nil) 708 + if (nodePtr->buffer != NULL) 709 { 710 releaseNodeProc = btreePtr->releaseBlockProc; 711 err = releaseNodeProc (btreePtr->fcbPtr, 712 @@ -309,8 +309,8 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr, 713 ++btreePtr->numReleaseNodes; 714 } 715 716 - nodePtr->buffer = nil; 717 - nodePtr->blockHeader = nil; 718 + nodePtr->buffer = NULL; 719 + nodePtr->blockHeader = NULL; 720 721 return err; 722 } 723 @@ -338,7 +338,7 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr, 724 725 err = noErr; 726 727 - if (nodePtr->buffer != nil) //ее why call UpdateNode if nil ?!? 728 + if (nodePtr->buffer != NULL) //ее why call UpdateNode if NULL ?!? 729 { 730 // LogStartTime(kTraceReleaseNode); 731 err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig); 732 @@ -358,8 +358,8 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr, 733 ++btreePtr->numUpdateNodes; 734 } 735 736 - nodePtr->buffer = nil; 737 - nodePtr->blockHeader = nil; 738 + nodePtr->buffer = NULL; 739 + nodePtr->blockHeader = NULL; 740 741 return noErr; 742 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 748 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 -------------------------------------------------------------------------------*/ 755 756 @@ -321,8 +321,8 @@ ReleaseAndExit: 757 ErrorExit: 758 759 *nodeNum = 0; 760 - nodePtr->buffer = nil; 761 - nodePtr->blockHeader = nil; 762 + nodePtr->buffer = NULL; 763 + nodePtr->blockHeader = NULL; 764 *returnIndex = 0; 765 766 return err; 767 @@ -354,7 +354,7 @@ OSStatus InsertTree ( BTreeControlBlockPtr btreePtr, 768 primaryKey.replacingKey = replacingKey; 769 primaryKey.skipRotate = false; 770 771 - err = InsertLevel (btreePtr, treePathTable, &primaryKey, nil, 772 + err = InsertLevel (btreePtr, treePathTable, &primaryKey, NULL, 773 targetNode, index, level, insertNode ); 774 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; 783 784 insertParent = false; 785 @@ -420,7 +420,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr, 786 787 ////// process second insert (if any) ////// 788 789 - if ( secondaryKey != nil ) 790 + if (secondaryKey != NULL) 791 { 792 Boolean temp; 793 794 @@ -446,7 +446,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr, 795 UInt8 * recPtr; 796 UInt16 recSize; 797 798 - secondaryKey = nil; 799 + secondaryKey = NULL; 800 801 PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?"); 802 803 @@ -606,9 +606,9 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr, 804 805 if ( leftNodeNum > 0 ) 806 { 807 - PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!"); 808 + PanicIf(siblingNode->buffer != NULL, "InsertNode: siblingNode already aquired!"); 809 810 - if ( siblingNode->buffer == nil ) 811 + if (siblingNode->buffer == NULL) 812 { 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, 816 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!"); 821 822 DeleteRecord (btreePtr, targetNodePtr, index); 823 824 @@ -766,7 +766,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr, 825 deleteRequired = false; 826 updateRequired = false; 827 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 830 { 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; 836 837 - if ( left != nil ) 838 + if (left != NULL) 839 { 840 if ( left->fLink != rightNodeNum ) 841 return fsBTInvalidNodeErr; //ее E_BadSibling ? 842 @@ -1145,7 +1145,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr, 843 844 /////////////// Update Forward Link In Original Left Node /////////////////// 845 846 - if ( left != nil ) 847 + if (left != NULL) 848 { 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; 854 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"); 859 860 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; 865 866 - if ( rightPtr != nil ) 867 + if (rightPtr != NULL) 868 { 869 if ( rightPtr->bLink != nodeNum ) 870 return fsBTInvalidNodeErr; //ее E_BadSibling ? 871 @@ -1382,7 +1382,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr, 872 873 /////////////// Update backward Link In Original Right Node /////////////////// 874 875 - if ( rightPtr != nil ) 876 + if (rightPtr != NULL) 877 { 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; 886 887 888 if ( nodeP->numRecords == 0 ) 889 @@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb ) 890 return( -1 ); 891 } 892 893 - if ( prevkeyP != nil ) 894 + if (prevkeyP != NULL) 895 { 896 if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 ) 897 { 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, 903 { 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: 912 } 913 914 // Set up structures for post processing 915 - if ( (autoRepair == true) && (dataArea.fileIdentifierTable != nil) ) 916 + if ((autoRepair == true) && (dataArea.fileIdentifierTable != NULL)) 917 { 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: 921 // 922 // Post processing 923 // 924 - if ( fileIdentifierTable != nil ) 925 + if (fileIdentifierTable != NULL) 926 { 927 DisposeMemory( fileIdentifierTable ); 928 } 929 @@ -682,7 +682,7 @@ short CheckForStop( SGlob *GPtr ) 930 931 //if ( ((ticks - 10) > GPtr->lastTickCount) || (dfaStage == kAboutToRepairStage) ) // To reduce cursor flicker on fast machines, call through on a timed interval 932 //{ 933 - if ( GPtr->userCancelProc != nil ) 934 + if (GPtr->userCancelProc != NULL) 935 { 936 UInt64 progress = 0; 937 Boolean progressChanged; 938 @@ -761,7 +761,7 @@ static int ScavSetUp( SGlob *GPtr) 939 short ioRefNum; 940 #endif 941 942 - GPtr->MinorRepairsP = nil; 943 + GPtr->MinorRepairsP = NULL; 944 945 GPtr->itemsProcessed = 0; 946 GPtr->lastProgress = 0; 947 @@ -774,7 +774,7 @@ static int ScavSetUp( SGlob *GPtr) 948 ScavStaticStructures *pointer; 949 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 ) 959 { 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 963 } 964 #endif 965 @@ -949,7 +949,7 @@ static int ScavSetUp( SGlob *GPtr) 966 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 ); 973 } 974 @@ -995,17 +995,17 @@ static int ScavTerm( SGlobPtr GPtr ) 975 976 (void) BitMapCheckEnd(); 977 978 - while( (rP = GPtr->MinorRepairsP) != nil ) // loop freeing leftover (undone) repair orders 979 + while((rP = GPtr->MinorRepairsP) != NULL) // loop freeing leftover (undone) repair orders 980 { 981 GPtr->MinorRepairsP = rP->link; // (in case repairs were not made) 982 DisposeMemory(rP); 983 err = MemError(); 984 } 985 986 - if( GPtr->validFilesList != nil ) 987 + if (GPtr->validFilesList != NULL) 988 DisposeHandle( (Handle) GPtr->validFilesList ); 989 990 - if( GPtr->overlappedExtents != nil ) { 991 + if (GPtr->overlappedExtents != NULL) { 992 extentsTableH = GPtr->overlappedExtents; 993 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 ); 997 } 998 999 - if( GPtr->fileIdentifierTable != nil ) 1000 + if (GPtr->fileIdentifierTable != NULL) 1001 DisposeHandle( (Handle) GPtr->fileIdentifierTable ); 1002 1003 - if( GPtr->calculatedVCB == nil ) // already freed? 1004 + if (GPtr->calculatedVCB == NULL) // already freed? 1005 return( noErr ); 1006 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) 1011 { 1012 btcbP = (BTreeControlBlock*)fcbP->fcbBtree; 1013 - if ( btcbP != nil) 1014 + if (btcbP != NULL) 1015 { 1016 - if( btcbP->refCon != nil ) 1017 + if (btcbP->refCon != NULL) 1018 { 1019 - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil) 1020 + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL) 1021 { 1022 DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr); 1023 err = MemError(); 1024 } 1025 DisposeMemory( (Ptr)btcbP->refCon ); 1026 err = MemError(); 1027 - btcbP->refCon = nil; 1028 + btcbP->refCon = NULL; 1029 } 1030 1031 fcbP = GPtr->calculatedCatalogFCB; // release catalog BTree bit map 1032 btcbP = (BTreeControlBlock*)fcbP->fcbBtree; 1033 1034 - if( btcbP->refCon != nil ) 1035 + if (btcbP->refCon != NULL) 1036 { 1037 - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil) 1038 + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL) 1039 { 1040 DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr); 1041 err = MemError(); 1042 } 1043 DisposeMemory( (Ptr)btcbP->refCon ); 1044 err = MemError(); 1045 - btcbP->refCon = nil; 1046 + btcbP->refCon = NULL; 1047 } 1048 } 1049 } 1050 @@ -1066,7 +1066,7 @@ static int ScavTerm( SGlobPtr GPtr ) 1051 DisposeMemory( GPtr->calculatedVCB ); // Release our block of data structures 1052 err = MemError(); 1053 1054 - GPtr->calculatedVCB = nil; 1055 + GPtr->calculatedVCB = NULL; 1056 1057 return( noErr ); 1058 } 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)) 1065 { 1066 if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0) 1067 { 1068 @@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr ) 1069 1070 } 1071 driverName = (StringPtr)&(drvrHeaderPtr->drvrName); 1072 - if (!(IdenticalString(driverName,blueBoxSharedDriverName,nil))) 1073 + if (!(IdenticalString(driverName,blueBoxSharedDriverName,NULL))) 1074 { 1075 return( true ); 1076 } 1077 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))) 1082 { 1083 CntrlParam paramBlock; 1084 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 ) 1093 1094 iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam; 1095 whereStringPtr = (StringPtr) & iconAndStringRecPtr->string; 1096 - if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,nil))) 1097 + if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,NULL))) 1098 { 1099 return( true ); 1100 } 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 1106 1107 isHFSPlus = VolumeObjectIsHFSPlus( ); 1108 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 ); 1112 1113 if ( result ) return ( IntError( GPtr, result ) ); 1114 @@ -910,7 +910,7 @@ static OSErr FixDirThread( SGlobPtr GPtr, UInt32 did ) // the dir ID 1115 1116 isHFSPlus = VolumeObjectIsHFSPlus( ); 1117 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 ); 1121 1122 if ( result ) 1123 @@ -2171,7 +2171,7 @@ static OSErr FixOrphanedFiles ( SGlobPtr GPtr ) 1124 } 1125 1126 //-- Build the key for the file thread 1127 - BuildCatalogKey( cNodeID, nil, isHFSPlus, &key ); 1128 + BuildCatalogKey(cNodeID, NULL, isHFSPlus, &key); 1129 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 ); 1139 1140 - if ( GPtr->realVCB != nil ) 1141 + if (GPtr->realVCB != NULL) 1142 { 1143 GPtr->volumeFeatures |= volumeIsMountedMask; 1144 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 1153 * 1154 - * Output: nil 1155 + * Output: NULL 1156 */ 1157 void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype) 1158 { 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. 1165 // 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; 1171 } 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) 1176 { 1177 err = R_NoMem; 1178 goto exit; 1179 @@ -1145,13 +1145,13 @@ OSErr CreateCatalogBTreeControlBlock( SGlobPtr GPtr ) 1180 // 1181 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; 1187 } 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) 1192 { 1193 err = R_NoMem; 1194 goto exit; 1195 @@ -1339,7 +1339,7 @@ OSErr CatHChk( SGlobPtr GPtr ) 1196 1197 //ее Can we ignore this part by just taking advantage of setting the selCode = 0x8001; 1198 { 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 ); 1202 1203 GPtr->TarBlock = hint; /* set target block */ 1204 @@ -1443,7 +1443,7 @@ OSErr CatHChk( SGlobPtr GPtr ) 1205 /* 1206 * Find thread record 1207 */ 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. 1215 // 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; 1221 } 1222 1223 if (btcb->totalNodes == 0) 1224 { 1225 - ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = nil; 1226 + ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = NULL; 1227 ((BTreeExtensionsRec*)btcb->refCon)->BTCBMSize = 0; 1228 ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount = 0; 1229 } 1230 else 1231 { 1232 - if ( btcb->refCon == nil ) { 1233 + if (btcb->refCon == NULL) { 1234 err = R_NoMem; 1235 goto exit; 1236 } 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) 1241 { 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 1246 1247 p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) ); // get the node 1248 - if ( p == nil ) return( R_NoMem ); 1249 + if (p == NULL) return( R_NoMem ); 1250 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 1255 1256 p = AllocMinorRepairOrder( GPtr, 0 ); // get the node 1257 - if ( p == nil ) return( R_NoMem ); 1258 + if (p == NULL) return( R_NoMem ); 1259 1260 p->type = type; // save error info 1261 1262 @@ -3029,7 +3029,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType, 1263 foundBadExtent = false; 1264 lastExtentIndex = GPtr->numExtents; 1265 1266 - while ( (extents != nil) && (err == noErr) ) 1267 + while ((extents != NULL) && (err == noErr)) 1268 { 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 ) 1273 { 1274 err = noErr; // no more extent records 1275 - extents = nil; 1276 + extents = NULL; 1277 break; 1278 } 1279 else if ( err != noErr ) 1280 @@ -3121,7 +3121,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType, 1281 if ( err == btNotFound ) 1282 { 1283 err = noErr; // no more extent records 1284 - extents = nil; 1285 + extents = NULL; 1286 break; 1287 } 1288 else if ( err != noErr ) 1289 @@ -3205,7 +3205,7 @@ static OSErr AddExtentToOverlapList( SGlobPtr GPtr, HFSCatalogNodeID fileNumber, 1290 } 1291 1292 // If it's uninitialized 1293 - if ( GPtr->overlappedExtents == nil ) 1294 + if (GPtr->overlappedExtents == NULL) 1295 { 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; 1308 1309 1310 if ( nodeP->numRecords == 0 ) 1311 @@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb ) 1312 return( E_KeyLen ); 1313 } 1314 1315 - if ( prevkeyP != nil ) 1316 + if (prevkeyP != NULL) 1317 { 1318 if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 ) 1319 {