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

1299 lines
42 KiB

  1. From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
  2. Date: Thu, 24 Oct 2013 01:11:21 -0200
  3. Subject: Rename custom macro nil with NULL
  4. ---
  5. fsck_hfs.tproj/dfalib/BTree.c | 142 +++++++++++++++++-----------------
  6. fsck_hfs.tproj/dfalib/BTreeAllocate.c | 14 ++--
  7. fsck_hfs.tproj/dfalib/BTreeMiscOps.c | 26 +++----
  8. fsck_hfs.tproj/dfalib/BTreeNodeOps.c | 30 +++----
  9. fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 38 ++++-----
  10. fsck_hfs.tproj/dfalib/SControl.c | 56 +++++++-------
  11. fsck_hfs.tproj/dfalib/SRepair.c | 6 +-
  12. fsck_hfs.tproj/dfalib/SUtils.c | 6 +-
  13. fsck_hfs.tproj/dfalib/SVerify1.c | 32 ++++----
  14. fsck_hfs.tproj/dfalib/SVerify2.c | 4 +-
  15. 10 files changed, 177 insertions(+), 177 deletions(-)
  16. --- a/fsck_hfs.tproj/dfalib/BTree.c
  17. +++ b/fsck_hfs.tproj/dfalib/BTree.c
  18. @@ -163,21 +163,21 @@ OSStatus BTInitialize (FCB *filePtr
  19. ////////////////////// Preliminary Error Checking ///////////////////////////
  20. - headerNode.buffer = nil;
  21. + headerNode.buffer = NULL;
  22. - if (pathPtr == nil) return paramErr;
  23. + if (pathPtr == NULL) return paramErr;
  24. setEndOfForkProc = pathPtr->agentPtr->agent.setEndOfForkProc;
  25. setBlockSizeProc = pathPtr->agentPtr->agent.setBlockSizeProc;
  26. - if (pathPtr->agentPtr->agent.getBlockProc == nil) return E_NoGetBlockProc;
  27. - if (pathPtr->agentPtr->agent.releaseBlockProc == nil) return E_NoReleaseBlockProc;
  28. - if (setEndOfForkProc == nil) return E_NoSetEndOfForkProc;
  29. - if (setBlockSizeProc == nil) return E_NoSetBlockSizeProc;
  30. + if (pathPtr->agentPtr->agent.getBlockProc == NULL) return E_NoGetBlockProc;
  31. + if (pathPtr->agentPtr->agent.releaseBlockProc == NULL) return E_NoReleaseBlockProc;
  32. + if (setEndOfForkProc == NULL) return E_NoSetEndOfForkProc;
  33. + if (setBlockSizeProc == NULL) return E_NoSetBlockSizeProc;
  34. forkPtr = pathPtr->path.forkPtr;
  35. - if (forkPtr->fork.btreePtr != nil) return fsBTrFileAlreadyOpenErr;
  36. + if (forkPtr->fork.btreePtr != NULL) return fsBTrFileAlreadyOpenErr;
  37. if ((maxKeyLength == 0) ||
  38. (maxKeyLength > kMaxKeyLength)) return fsBTInvalidKeyLengthErr;
  39. @@ -209,7 +209,7 @@ OSStatus BTInitialize (FCB *filePtr
  40. //////////////////////// Allocate Control Block /////////////////////////////
  41. M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
  42. - if (btreePtr == nil)
  43. + if (btreePtr == NULL)
  44. {
  45. err = memFullErr;
  46. goto ErrorExit;
  47. @@ -220,7 +220,7 @@ OSStatus BTInitialize (FCB *filePtr
  48. btreePtr->flags = 0;
  49. btreePtr->attributes = 0;
  50. btreePtr->forkPtr = forkPtr;
  51. - btreePtr->keyCompareProc = nil;
  52. + btreePtr->keyCompareProc = NULL;
  53. btreePtr->keyDescPtr = keyDescPtr;
  54. btreePtr->btreeType = btreeType;
  55. btreePtr->treeDepth = 0;
  56. @@ -282,7 +282,7 @@ OSStatus BTInitialize (FCB *filePtr
  57. ///////////////////// Copy Key Descriptor To Header /////////////////////////
  58. #if SupportsKeyDescriptors
  59. - if (keyDescPtr != nil)
  60. + if (keyDescPtr != NULL)
  61. {
  62. err = CheckKeyDescriptor (keyDescPtr, maxKeyLength);
  63. M_ExitOnError (err);
  64. @@ -309,7 +309,7 @@ OSStatus BTInitialize (FCB *filePtr
  65. err = UpdateHeader (btreePtr);
  66. M_ExitOnError (err);
  67. - pathPtr->path.forkPtr->fork.btreePtr = nil;
  68. + pathPtr->path.forkPtr->fork.btreePtr = NULL;
  69. M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
  70. return noErr;
  71. @@ -320,7 +320,7 @@ OSStatus BTInitialize (FCB *filePtr
  72. ErrorExit:
  73. (void) ReleaseNode (btreePtr, &headerNode);
  74. - if (btreePtr != nil)
  75. + if (btreePtr != NULL)
  76. M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
  77. return err;
  78. @@ -342,7 +342,7 @@ Input: filePtr - pointer to file to
  79. setEndOfForkProc - pointer to client's SetEOF function
  80. Result: noErr - success
  81. - paramErr - required ptr was nil
  82. + paramErr - required ptr was NULL
  83. fsBTInvalidFileErr -
  84. memFullErr -
  85. != noErr - failure
  86. @@ -364,16 +364,16 @@ OSStatus BTOpenPath (SFCB *filePtr
  87. ////////////////////// Preliminary Error Checking ///////////////////////////
  88. - if ( filePtr == nil ||
  89. - getBlockProc == nil ||
  90. - releaseBlockProc == nil ||
  91. - setEndOfForkProc == nil ||
  92. - setBlockSizeProc == nil )
  93. + if (filePtr == NULL ||
  94. + getBlockProc == NULL ||
  95. + releaseBlockProc == NULL ||
  96. + setEndOfForkProc == NULL ||
  97. + setBlockSizeProc == NULL)
  98. {
  99. return paramErr;
  100. }
  101. - if ( filePtr->fcbBtree != nil ) // already has a BTreeCB
  102. + if (filePtr->fcbBtree != NULL) // already has a BTreeCB
  103. return noErr;
  104. // is file large enough to contain header node?
  105. @@ -384,7 +384,7 @@ OSStatus BTOpenPath (SFCB *filePtr
  106. //////////////////////// Allocate Control Block /////////////////////////////
  107. btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) );
  108. - if (btreePtr == nil)
  109. + if (btreePtr == NULL)
  110. {
  111. Panic ("\pBTOpen: no memory for btreePtr.");
  112. return memFullErr;
  113. @@ -397,7 +397,7 @@ OSStatus BTOpenPath (SFCB *filePtr
  114. /////////////////////////// Read Header Node ////////////////////////////////
  115. - nodeRec.buffer = nil; // so we can call ReleaseNode
  116. + nodeRec.buffer = NULL; // so we can call ReleaseNode
  117. btreePtr->fcbPtr = filePtr;
  118. filePtr->fcbBtree = (void *) btreePtr; // attach btree cb to file
  119. @@ -487,7 +487,7 @@ OSStatus BTOpenPath (SFCB *filePtr
  120. ////////////////////////// Get Key Descriptor ///////////////////////////////
  121. #if SupportsKeyDescriptors
  122. - if ( keyCompareProc == nil ) // if no key compare proc then get key descriptor
  123. + if (keyCompareProc == NULL) // if no key compare proc then get key descriptor
  124. {
  125. err = GetKeyDescriptor (btreePtr, nodeRec.buffer); //�� it should check amount of memory allocated...
  126. M_ExitOnError (err);
  127. @@ -499,7 +499,7 @@ OSStatus BTOpenPath (SFCB *filePtr
  128. else
  129. #endif
  130. {
  131. - btreePtr->keyDescPtr = nil; // clear it so we don't dispose garbage later
  132. + btreePtr->keyDescPtr = NULL; // clear it so we don't dispose garbage later
  133. }
  134. err = ReleaseNode (btreePtr, &nodeRec);
  135. @@ -528,7 +528,7 @@ OSStatus BTOpenPath (SFCB *filePtr
  136. ErrorExit:
  137. - filePtr->fcbBtree = nil;
  138. + filePtr->fcbBtree = NULL;
  139. (void) ReleaseNode (btreePtr, &nodeRec);
  140. DisposeMemory( btreePtr );
  141. @@ -567,7 +567,7 @@ OSStatus BTClosePath (SFCB *filePt
  142. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  143. - if (btreePtr == nil)
  144. + if (btreePtr == NULL)
  145. return fsBTInvalidFileErr;
  146. ////////////////////// Check for other BTree Paths //////////////////////////
  147. @@ -603,14 +603,14 @@ OSStatus BTClosePath (SFCB *filePt
  148. M_ExitOnError (err);
  149. #if SupportsKeyDescriptors
  150. - if (btreePtr->keyDescPtr != nil) // deallocate keyDescriptor, if any
  151. + if (btreePtr->keyDescPtr != NULL) // deallocate keyDescriptor, if any
  152. {
  153. DisposeMemory( btreePtr->keyDescPtr );
  154. }
  155. #endif
  156. DisposeMemory( btreePtr );
  157. - filePtr->fcbBtree = nil;
  158. + filePtr->fcbBtree = NULL;
  159. // LogEndTime(kTraceCloseBTree, noErr);
  160. @@ -643,7 +643,7 @@ Function: Search for position in B*Tree
  161. Input: pathPtr - pointer to path for BTree file.
  162. searchKey - pointer to search key to match.
  163. - hintPtr - pointer to hint (may be nil)
  164. + hintPtr - pointer to hint (may be NULL)
  165. Output: record - pointer to BufferDescriptor containing record
  166. recordLen - length of data at recordPtr
  167. @@ -678,14 +678,14 @@ OSStatus BTSearchRecord (SFCB *fil
  168. // LogStartTime(kTraceSearchBTree);
  169. - if (filePtr == nil) return paramErr;
  170. - if (searchIterator == nil) return paramErr;
  171. + if (filePtr == NULL) return paramErr;
  172. + if (searchIterator == NULL) return paramErr;
  173. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  174. - if (btreePtr == nil) return fsBTInvalidFileErr;
  175. + if (btreePtr == NULL) return fsBTInvalidFileErr;
  176. #if SupportsKeyDescriptors
  177. - if (btreePtr->keyCompareProc == nil) // CheckKey if we using Key Descriptor
  178. + if (btreePtr->keyCompareProc == NULL) // CheckKey if we using Key Descriptor
  179. {
  180. err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
  181. M_ExitOnError (err);
  182. @@ -775,9 +775,9 @@ OSStatus BTSearchRecord (SFCB *fil
  183. //�� Should check for errors! Or BlockMove could choke on recordPtr!!!
  184. GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
  185. - if (recordLen != nil) *recordLen = len;
  186. + if (recordLen != NULL) *recordLen = len;
  187. - if (record != nil)
  188. + if (record != NULL)
  189. {
  190. ByteCount recordSize;
  191. @@ -794,7 +794,7 @@ OSStatus BTSearchRecord (SFCB *fil
  192. /////////////////////// Success - Update Iterator ///////////////////////////
  193. - if (resultIterator != nil)
  194. + if (resultIterator != NULL)
  195. {
  196. resultIterator->hint.writeCount = btreePtr->writeCount;
  197. resultIterator->hint.nodeNum = nodeNum;
  198. @@ -825,10 +825,10 @@ OSStatus BTSearchRecord (SFCB *fil
  199. ErrorExit:
  200. - if (recordLen != nil)
  201. + if (recordLen != NULL)
  202. *recordLen = 0;
  203. - if (resultIterator != nil)
  204. + if (resultIterator != NULL)
  205. {
  206. resultIterator->hint.writeCount = 0;
  207. resultIterator->hint.nodeNum = 0;
  208. @@ -892,18 +892,18 @@ OSStatus BTIterateRecord (SFCB *fi
  209. ////////////////////////// Priliminary Checks ///////////////////////////////
  210. - left.buffer = nil;
  211. - right.buffer = nil;
  212. - node.buffer = nil;
  213. + left.buffer = NULL;
  214. + right.buffer = NULL;
  215. + node.buffer = NULL;
  216. - if (filePtr == nil)
  217. + if (filePtr == NULL)
  218. {
  219. return paramErr;
  220. }
  221. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  222. - if (btreePtr == nil)
  223. + if (btreePtr == NULL)
  224. {
  225. return fsBTInvalidFileErr; //�� handle properly
  226. }
  227. @@ -968,7 +968,7 @@ OSStatus BTIterateRecord (SFCB *fi
  228. }
  229. else
  230. {
  231. - if (left.buffer == nil)
  232. + if (left.buffer == NULL)
  233. {
  234. nodeNum = ((NodeDescPtr) node.buffer)->bLink;
  235. if ( nodeNum > 0)
  236. @@ -981,13 +981,13 @@ OSStatus BTIterateRecord (SFCB *fi
  237. }
  238. }
  239. // Before we stomp on "right", we'd better release it if needed
  240. - if (right.buffer != nil) {
  241. + if (right.buffer != NULL) {
  242. err = ReleaseNode(btreePtr, &right);
  243. M_ExitOnError(err);
  244. }
  245. right = node;
  246. node = left;
  247. - left.buffer = nil;
  248. + left.buffer = NULL;
  249. index = ((NodeDescPtr) node.buffer)->numRecords -1;
  250. }
  251. }
  252. @@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord (SFCB *fi
  253. }
  254. else
  255. {
  256. - if (right.buffer == nil)
  257. + if (right.buffer == NULL)
  258. {
  259. nodeNum = ((NodeDescPtr) node.buffer)->fLink;
  260. if ( nodeNum > 0)
  261. @@ -1025,13 +1025,13 @@ OSStatus BTIterateRecord (SFCB *fi
  262. }
  263. }
  264. // Before we stomp on "left", we'd better release it if needed
  265. - if (left.buffer != nil) {
  266. + if (left.buffer != NULL) {
  267. err = ReleaseNode(btreePtr, &left);
  268. M_ExitOnError(err);
  269. }
  270. left = node;
  271. node = right;
  272. - right.buffer = nil;
  273. + right.buffer = NULL;
  274. index = 0;
  275. }
  276. }
  277. @@ -1054,9 +1054,9 @@ CopyData:
  278. err = GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
  279. M_ExitOnError (err);
  280. - if (recordLen != nil) *recordLen = len;
  281. + if (recordLen != NULL) *recordLen = len;
  282. - if (record != nil)
  283. + if (record != NULL)
  284. {
  285. ByteCount recordSize;
  286. @@ -1069,7 +1069,7 @@ CopyData:
  287. CopyMemory (recordPtr, record->bufferAddress, len);
  288. }
  289. - if (iterator != nil) // first & last do not require iterator
  290. + if (iterator != NULL) // first & last do not require iterator
  291. {
  292. iterator->hint.writeCount = btreePtr->writeCount;
  293. iterator->hint.nodeNum = nodeNum;
  294. @@ -1089,13 +1089,13 @@ CopyData:
  295. err = ReleaseNode (btreePtr, &node);
  296. M_ExitOnError (err);
  297. - if (left.buffer != nil)
  298. + if (left.buffer != NULL)
  299. {
  300. err = ReleaseNode (btreePtr, &left);
  301. M_ExitOnError (err);
  302. }
  303. - if (right.buffer != nil)
  304. + if (right.buffer != NULL)
  305. {
  306. err = ReleaseNode (btreePtr, &right);
  307. M_ExitOnError (err);
  308. @@ -1113,10 +1113,10 @@ ErrorExit:
  309. (void) ReleaseNode (btreePtr, &node);
  310. (void) ReleaseNode (btreePtr, &right);
  311. - if (recordLen != nil)
  312. + if (recordLen != NULL)
  313. *recordLen = 0;
  314. - if (iterator != nil)
  315. + if (iterator != NULL)
  316. {
  317. iterator->hint.writeCount = 0;
  318. iterator->hint.nodeNum = 0;
  319. @@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord (SFCB *fil
  320. ////////////////////////// Priliminary Checks ///////////////////////////////
  321. - nodeRec.buffer = nil; // so we can call ReleaseNode
  322. + nodeRec.buffer = NULL; // so we can call ReleaseNode
  323. err = CheckInsertParams (filePtr, iterator, record, recordLen);
  324. if (err != noErr)
  325. @@ -1317,7 +1317,7 @@ OSStatus BTSetRecord (SFCB *fileP
  326. ////////////////////////// Priliminary Checks ///////////////////////////////
  327. - nodeRec.buffer = nil; // so we can call ReleaseNode
  328. + nodeRec.buffer = NULL; // so we can call ReleaseNode
  329. err = CheckInsertParams (filePtr, iterator, record, recordLen);
  330. if (err != noErr)
  331. @@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord (SFCB *fi
  332. ////////////////////////// Priliminary Checks ///////////////////////////////
  333. - nodeRec.buffer = nil; // so we can call ReleaseNode
  334. + nodeRec.buffer = NULL; // so we can call ReleaseNode
  335. err = CheckInsertParams (filePtr, iterator, record, recordLen);
  336. if (err != noErr)
  337. @@ -1645,20 +1645,20 @@ OSStatus BTDeleteRecord (SFCB *fil
  338. ////////////////////////// Priliminary Checks ///////////////////////////////
  339. - nodeRec.buffer = nil; // so we can call ReleaseNode
  340. + nodeRec.buffer = NULL; // so we can call ReleaseNode
  341. - M_ReturnErrorIf (filePtr == nil, paramErr);
  342. - M_ReturnErrorIf (iterator == nil, paramErr);
  343. + M_ReturnErrorIf (filePtr == NULL, paramErr);
  344. + M_ReturnErrorIf (iterator == NULL, paramErr);
  345. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  346. - if (btreePtr == nil)
  347. + if (btreePtr == NULL)
  348. {
  349. err = fsBTInvalidFileErr;
  350. goto ErrorExit;
  351. }
  352. #if SupportsKeyDescriptors
  353. - if (btreePtr->keyDescPtr != nil)
  354. + if (btreePtr->keyDescPtr != NULL)
  355. {
  356. err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
  357. M_ExitOnError (err);
  358. @@ -1712,12 +1712,12 @@ OSStatus BTGetInformation (SFCB *fil
  359. BTreeControlBlockPtr btreePtr;
  360. - M_ReturnErrorIf (filePtr == nil, paramErr);
  361. + M_ReturnErrorIf (filePtr == NULL, paramErr);
  362. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  363. - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr);
  364. - M_ReturnErrorIf (info == nil, paramErr);
  365. + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr);
  366. + M_ReturnErrorIf (info == NULL, paramErr);
  367. //�� check version?
  368. @@ -1730,7 +1730,7 @@ OSStatus BTGetInformation (SFCB *fil
  369. info->keyDescriptor = btreePtr->keyDescPtr; //�� this won't do at all...
  370. info->reserved = 0;
  371. - if (btreePtr->keyDescPtr == nil)
  372. + if (btreePtr->keyDescPtr == NULL)
  373. info->keyDescLength = 0;
  374. else
  375. info->keyDescLength = (UInt32) btreePtr->keyDescPtr->length;
  376. @@ -1762,11 +1762,11 @@ OSStatus BTFlushPath (SFCB *fileP
  377. // LogStartTime(kTraceFlushBTree);
  378. - M_ReturnErrorIf (filePtr == nil, paramErr);
  379. + M_ReturnErrorIf (filePtr == NULL, paramErr);
  380. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  381. - M_ReturnErrorIf (btreePtr == nil, fsBTInvalidFileErr);
  382. + M_ReturnErrorIf (btreePtr == NULL, fsBTInvalidFileErr);
  383. err = UpdateHeader (btreePtr);
  384. @@ -1788,13 +1788,13 @@ Input: iterator - pointer to BTreeItera
  385. Output: iterator - iterator with the hint.nodeNum cleared
  386. Result: noErr - success
  387. - paramErr - iterator == nil
  388. + paramErr - iterator == NULL
  389. -------------------------------------------------------------------------------*/
  390. OSStatus BTInvalidateHint (BTreeIterator *iterator )
  391. {
  392. - if (iterator == nil)
  393. + if (iterator == NULL)
  394. return paramErr;
  395. iterator->hint.nodeNum = 0;
  396. --- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
  397. +++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
  398. @@ -83,7 +83,7 @@ OSStatus AllocateNode (BTreeControlBlock
  399. nodeNumber = 0; // first node number of header map record
  400. - node.buffer = nil; // clear node.buffer to get header node
  401. + node.buffer = NULL; // clear node.buffer to get header node
  402. // - and for ErrorExit
  403. while (true)
  404. @@ -192,7 +192,7 @@ OSStatus FreeNode (BTreeControlBlockPtr
  405. //////////////////////////// Find Map Record ////////////////////////////////
  406. nodeIndex = 0; // first node number of header map record
  407. - node.buffer = nil; // invalidate node.buffer to get header node
  408. + node.buffer = NULL; // invalidate node.buffer to get header node
  409. while (nodeNum >= nodeIndex)
  410. {
  411. @@ -278,8 +278,8 @@ OSStatus ExtendBTree (BTreeControlBlockP
  412. nodeSize = btreePtr->nodeSize;
  413. filePtr = btreePtr->fcbPtr;
  414. - mapNode.buffer = nil;
  415. - newNode.buffer = nil;
  416. + mapNode.buffer = NULL;
  417. + newNode.buffer = NULL;
  418. mapNodeRecSize = nodeSize - sizeof(BTNodeDescriptor) - 6; // 2 bytes of free space (see note)
  419. @@ -448,7 +448,7 @@ ErrorExit:
  420. Routine: GetMapNode - Get the next map node and pointer to the map record.
  421. Function: Given a BlockDescriptor to a map node in nodePtr, GetMapNode releases
  422. - it and gets the next node. If nodePtr->buffer is nil, then the header
  423. + it and gets the next node. If nodePtr->buffer is NULL, then the header
  424. node is retrieved.
  425. @@ -474,7 +474,7 @@ OSStatus GetMapNode (BTreeControlBlockPt
  426. UInt16 mapIndex;
  427. UInt32 nextNodeNum;
  428. - if (nodePtr->buffer != nil) // if iterator is valid...
  429. + if (nodePtr->buffer != NULL) // if iterator is valid...
  430. {
  431. nextNodeNum = ((NodeDescPtr)nodePtr->buffer)->fLink;
  432. if (nextNodeNum == 0)
  433. @@ -521,7 +521,7 @@ ErrorExit:
  434. (void) ReleaseNode (btreePtr, nodePtr);
  435. - *mapPtr = nil;
  436. + *mapPtr = NULL;
  437. *mapSize = 0;
  438. return err;
  439. --- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
  440. +++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
  441. @@ -236,13 +236,13 @@ OSStatus FindIteratorPosition (BTreeCont
  442. // assume index points to UInt16
  443. // assume foundRecord points to Boolean
  444. - left->buffer = nil;
  445. - middle->buffer = nil;
  446. - right->buffer = nil;
  447. + left->buffer = NULL;
  448. + middle->buffer = NULL;
  449. + right->buffer = NULL;
  450. foundIt = false;
  451. - if (iterator == nil) // do we have an iterator?
  452. + if (iterator == NULL) // do we have an iterator?
  453. {
  454. err = fsBTInvalidIteratorErr;
  455. goto ErrorExit;
  456. @@ -250,7 +250,7 @@ OSStatus FindIteratorPosition (BTreeCont
  457. #if SupportsKeyDescriptors
  458. //�� verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?)
  459. - if (btreePtr->keyDescPtr != nil)
  460. + if (btreePtr->keyDescPtr != NULL)
  461. {
  462. err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength );
  463. M_ExitOnError (err);
  464. @@ -309,7 +309,7 @@ OSStatus FindIteratorPosition (BTreeCont
  465. {
  466. *right = *middle;
  467. *middle = *left;
  468. - left->buffer = nil;
  469. + left->buffer = NULL;
  470. index = leftIndex;
  471. goto SuccessfulExit;
  472. @@ -330,7 +330,7 @@ OSStatus FindIteratorPosition (BTreeCont
  473. {
  474. *right = *middle;
  475. *middle = *left;
  476. - left->buffer = nil;
  477. + left->buffer = NULL;
  478. index = leftIndex;
  479. goto SuccessfulExit;
  480. @@ -363,7 +363,7 @@ OSStatus FindIteratorPosition (BTreeCont
  481. {
  482. *left = *middle;
  483. *middle = *right;
  484. - right->buffer = nil;
  485. + right->buffer = NULL;
  486. index = rightIndex;
  487. goto SuccessfulExit;
  488. @@ -427,15 +427,15 @@ OSStatus CheckInsertParams (SFCB *
  489. {
  490. BTreeControlBlockPtr btreePtr;
  491. - if (filePtr == nil) return paramErr;
  492. + if (filePtr == NULL) return paramErr;
  493. btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
  494. - if (btreePtr == nil) return fsBTInvalidFileErr;
  495. - if (iterator == nil) return paramErr;
  496. - if (record == nil) return paramErr;
  497. + if (btreePtr == NULL) return fsBTInvalidFileErr;
  498. + if (iterator == NULL) return paramErr;
  499. + if (record == NULL) return paramErr;
  500. #if SupportsKeyDescriptors
  501. - if (btreePtr->keyDescPtr != nil)
  502. + if (btreePtr->keyDescPtr != NULL)
  503. {
  504. OSStatus err;
  505. --- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
  506. +++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
  507. @@ -105,7 +105,7 @@ Function: Gets an existing BTree node fr
  508. Input: btreePtr - pointer to BTree control block
  509. nodeNum - number of node to request
  510. -Output: nodePtr - pointer to beginning of node (nil if error)
  511. +Output: nodePtr - pointer to beginning of node (NULL if error)
  512. Result:
  513. noErr - success
  514. @@ -139,7 +139,7 @@ OSStatus GetNode (BTreeControlBlockPtr
  515. if (err != noErr)
  516. {
  517. Panic ("\pGetNode: getNodeProc returned error.");
  518. - nodePtr->buffer = nil;
  519. + nodePtr->buffer = NULL;
  520. goto ErrorExit;
  521. }
  522. ++btreePtr->numGetNodes;
  523. @@ -156,8 +156,8 @@ OSStatus GetNode (BTreeControlBlockPtr
  524. return noErr;
  525. ErrorExit:
  526. - nodePtr->buffer = nil;
  527. - nodePtr->blockHeader = nil;
  528. + nodePtr->buffer = NULL;
  529. + nodePtr->blockHeader = NULL;
  530. // LogEndTime(kTraceGetNode, err);
  531. @@ -176,7 +176,7 @@ Function: Gets a new BTree node from FS
  532. Input: btreePtr - pointer to BTree control block
  533. nodeNum - number of node to request
  534. -Output: returnNodePtr - pointer to beginning of node (nil if error)
  535. +Output: returnNodePtr - pointer to beginning of node (NULL if error)
  536. Result: noErr - success
  537. != noErr - failure
  538. @@ -203,7 +203,7 @@ OSStatus GetNewNode (BTreeControlBlockPt
  539. if (err != noErr)
  540. {
  541. Panic ("\pGetNewNode: getNodeProc returned error.");
  542. - returnNodePtr->buffer = nil;
  543. + returnNodePtr->buffer = NULL;
  544. return err;
  545. }
  546. ++btreePtr->numGetNewNodes;
  547. @@ -248,7 +248,7 @@ OSStatus ReleaseNode (BTreeControlBlockP
  548. err = noErr;
  549. - if (nodePtr->buffer != nil)
  550. + if (nodePtr->buffer != NULL)
  551. {
  552. /*
  553. * The nodes must remain in the cache as big endian!
  554. @@ -267,8 +267,8 @@ OSStatus ReleaseNode (BTreeControlBlockP
  555. ++btreePtr->numReleaseNodes;
  556. }
  557. - nodePtr->buffer = nil;
  558. - nodePtr->blockHeader = nil;
  559. + nodePtr->buffer = NULL;
  560. + nodePtr->blockHeader = NULL;
  561. // LogEndTime(kTraceReleaseNode, err);
  562. @@ -299,7 +299,7 @@ OSStatus TrashNode (BTreeControlBlockPtr
  563. err = noErr;
  564. - if (nodePtr->buffer != nil)
  565. + if (nodePtr->buffer != NULL)
  566. {
  567. releaseNodeProc = btreePtr->releaseBlockProc;
  568. err = releaseNodeProc (btreePtr->fcbPtr,
  569. @@ -309,8 +309,8 @@ OSStatus TrashNode (BTreeControlBlockPtr
  570. ++btreePtr->numReleaseNodes;
  571. }
  572. - nodePtr->buffer = nil;
  573. - nodePtr->blockHeader = nil;
  574. + nodePtr->buffer = NULL;
  575. + nodePtr->blockHeader = NULL;
  576. return err;
  577. }
  578. @@ -338,7 +338,7 @@ OSStatus UpdateNode (BTreeControlBlockPt
  579. err = noErr;
  580. - if (nodePtr->buffer != nil) //�� why call UpdateNode if nil ?!?
  581. + if (nodePtr->buffer != NULL) //�� why call UpdateNode if NULL ?!?
  582. {
  583. // LogStartTime(kTraceReleaseNode);
  584. err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig);
  585. @@ -358,8 +358,8 @@ OSStatus UpdateNode (BTreeControlBlockPt
  586. ++btreePtr->numUpdateNodes;
  587. }
  588. - nodePtr->buffer = nil;
  589. - nodePtr->blockHeader = nil;
  590. + nodePtr->buffer = NULL;
  591. + nodePtr->blockHeader = NULL;
  592. return noErr;
  593. --- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
  594. +++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
  595. @@ -177,7 +177,7 @@ Output: nodeNum - number of the node
  596. Result: noErr - key found, index is record index
  597. fsBTRecordNotFoundErr - key not found, index is insert index
  598. - fsBTEmptyErr - key not found, return params are nil
  599. + fsBTEmptyErr - key not found, return params are NULL
  600. otherwise - catastrophic failure (GetNode/ReleaseNode failed)
  601. -------------------------------------------------------------------------------*/
  602. @@ -321,8 +321,8 @@ ReleaseAndExit:
  603. ErrorExit:
  604. *nodeNum = 0;
  605. - nodePtr->buffer = nil;
  606. - nodePtr->blockHeader = nil;
  607. + nodePtr->buffer = NULL;
  608. + nodePtr->blockHeader = NULL;
  609. *returnIndex = 0;
  610. return err;
  611. @@ -354,7 +354,7 @@ OSStatus InsertTree ( BTreeControlBlockP
  612. primaryKey.replacingKey = replacingKey;
  613. primaryKey.skipRotate = false;
  614. - err = InsertLevel (btreePtr, treePathTable, &primaryKey, nil,
  615. + err = InsertLevel (btreePtr, treePathTable, &primaryKey, NULL,
  616. targetNode, index, level, insertNode );
  617. return err;
  618. @@ -385,7 +385,7 @@ OSStatus InsertLevel (BTreeControlBlockP
  619. #if defined(applec) && !defined(__SC__)
  620. PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! ");
  621. #endif
  622. - siblingNode.buffer = nil;
  623. + siblingNode.buffer = NULL;
  624. targetNodeNum = treePathTable [level].node;
  625. insertParent = false;
  626. @@ -420,7 +420,7 @@ OSStatus InsertLevel (BTreeControlBlockP
  627. ////// process second insert (if any) //////
  628. - if ( secondaryKey != nil )
  629. + if (secondaryKey != NULL)
  630. {
  631. Boolean temp;
  632. @@ -446,7 +446,7 @@ OSStatus InsertLevel (BTreeControlBlockP
  633. UInt8 * recPtr;
  634. UInt16 recSize;
  635. - secondaryKey = nil;
  636. + secondaryKey = NULL;
  637. PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
  638. @@ -606,9 +606,9 @@ static OSErr InsertNode (BTreeControlBlo
  639. if ( leftNodeNum > 0 )
  640. {
  641. - PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
  642. + PanicIf(siblingNode->buffer != NULL, "InsertNode: siblingNode already aquired!");
  643. - if ( siblingNode->buffer == nil )
  644. + if (siblingNode->buffer == NULL)
  645. {
  646. err = GetNode (btreePtr, leftNodeNum, siblingNode); // will be released by caller or a split below
  647. M_ExitOnError (err);
  648. @@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlock
  649. targetNodeNum = treePathTable[level].node;
  650. targetNodePtr = targetNode->buffer;
  651. - PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
  652. + PanicIf (targetNodePtr == NULL, "DeleteTree: targetNode has NULL buffer!");
  653. DeleteRecord (btreePtr, targetNodePtr, index);
  654. @@ -766,7 +766,7 @@ OSStatus DeleteTree (BTreeControlBlock
  655. deleteRequired = false;
  656. updateRequired = false;
  657. - if ( targetNode->buffer == nil ) // then root was freed and the btree is empty
  658. + if (targetNode->buffer == NULL) // then root was freed and the btree is empty
  659. {
  660. btreePtr->rootNode = 0;
  661. btreePtr->treeDepth = 0;
  662. @@ -1124,7 +1124,7 @@ static OSStatus SplitLeft (BTreeControl
  663. if ( (right->height == 1) && (right->kind != kBTLeafNode) )
  664. return fsBTInvalidNodeErr;
  665. - if ( left != nil )
  666. + if (left != NULL)
  667. {
  668. if ( left->fLink != rightNodeNum )
  669. return fsBTInvalidNodeErr; //�� E_BadSibling ?
  670. @@ -1145,7 +1145,7 @@ static OSStatus SplitLeft (BTreeControl
  671. /////////////// Update Forward Link In Original Left Node ///////////////////
  672. - if ( left != nil )
  673. + if (left != NULL)
  674. {
  675. left->fLink = newNodeNum;
  676. err = UpdateNode (btreePtr, leftNode);
  677. @@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeCon
  678. Boolean didItFit;
  679. UInt16 keyLength;
  680. - PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
  681. - PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
  682. + PanicIf (leftNode == NULL, "AddNewRootNode: leftNode == NULL");
  683. + PanicIf (rightNode == NULL, "AddNewRootNode: rightNode == NULL");
  684. /////////////////////// Initialize New Root Node ////////////////////////////
  685. @@ -1362,7 +1362,7 @@ static OSStatus SplitRight (BTreeContro
  686. if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) )
  687. return fsBTInvalidNodeErr;
  688. - if ( rightPtr != nil )
  689. + if (rightPtr != NULL)
  690. {
  691. if ( rightPtr->bLink != nodeNum )
  692. return fsBTInvalidNodeErr; //�� E_BadSibling ?
  693. @@ -1382,7 +1382,7 @@ static OSStatus SplitRight (BTreeContro
  694. /////////////// Update backward Link In Original Right Node ///////////////////
  695. - if ( rightPtr != nil )
  696. + if (rightPtr != NULL)
  697. {
  698. rightPtr->bLink = newNodeNum;
  699. err = UpdateNode (btreePtr, rightNodePtr);
  700. @@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP
  701. UInt16 keyLength;
  702. KeyPtr keyPtr;
  703. UInt8 *dataPtr;
  704. - KeyPtr prevkeyP = nil;
  705. + KeyPtr prevkeyP = NULL;
  706. if ( nodeP->numRecords == 0 )
  707. @@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP
  708. return( -1 );
  709. }
  710. - if ( prevkeyP != nil )
  711. + if (prevkeyP != NULL)
  712. {
  713. if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
  714. {
  715. --- a/fsck_hfs.tproj/dfalib/SControl.c
  716. +++ b/fsck_hfs.tproj/dfalib/SControl.c
  717. @@ -82,7 +82,7 @@ CheckHFS( int fsReadRef, int fsWriteRef
  718. {
  719. SGlob dataArea; // Allocate the scav globals
  720. short temp;
  721. - FileIdentifierTable *fileIdentifierTable = nil;
  722. + FileIdentifierTable *fileIdentifierTable = NULL;
  723. OSErr err = noErr;
  724. OSErr scavError = 0;
  725. int scanCount = 0;
  726. @@ -228,7 +228,7 @@ DoAgain:
  727. }
  728. // Set up structures for post processing
  729. - if ( (autoRepair == true) && (dataArea.fileIdentifierTable != nil) )
  730. + if ((autoRepair == true) && (dataArea.fileIdentifierTable != NULL))
  731. {
  732. // *repairInfo = *repairInfo | kVolumeHadOverlappingExtents; // Report back that volume has overlapping extents
  733. fileIdentifierTable = (FileIdentifierTable *) AllocateMemory( GetHandleSize( (Handle) dataArea.fileIdentifierTable ) );
  734. @@ -239,7 +239,7 @@ DoAgain:
  735. //
  736. // Post processing
  737. //
  738. - if ( fileIdentifierTable != nil )
  739. + if (fileIdentifierTable != NULL)
  740. {
  741. DisposeMemory( fileIdentifierTable );
  742. }
  743. @@ -682,7 +682,7 @@ short CheckForStop( SGlob *GPtr )
  744. //if ( ((ticks - 10) > GPtr->lastTickCount) || (dfaStage == kAboutToRepairStage) ) // To reduce cursor flicker on fast machines, call through on a timed interval
  745. //{
  746. - if ( GPtr->userCancelProc != nil )
  747. + if (GPtr->userCancelProc != NULL)
  748. {
  749. UInt64 progress = 0;
  750. Boolean progressChanged;
  751. @@ -761,7 +761,7 @@ static int ScavSetUp( SGlob *GPtr)
  752. short ioRefNum;
  753. #endif
  754. - GPtr->MinorRepairsP = nil;
  755. + GPtr->MinorRepairsP = NULL;
  756. GPtr->itemsProcessed = 0;
  757. GPtr->lastProgress = 0;
  758. @@ -774,7 +774,7 @@ static int ScavSetUp( SGlob *GPtr)
  759. ScavStaticStructures *pointer;
  760. pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
  761. - if ( pointer == nil ) {
  762. + if (pointer == NULL) {
  763. if ( GPtr->logLevel >= kDebugLog ) {
  764. printf( "\t error %d - could not allocate %i bytes of memory \n",
  765. R_NoMem, sizeof(ScavStaticStructures) );
  766. @@ -831,7 +831,7 @@ static int ScavSetUp( SGlob *GPtr)
  767. // Save current value of vcbWrCnt, to detect modifications to volume by other apps etc
  768. if ( GPtr->volumeFeatures & volumeIsMountedMask )
  769. {
  770. - FlushVol( nil, GPtr->realVCB->vcbVRefNum ); // Ask HFS to update all changes to disk
  771. + FlushVol(NULL, GPtr->realVCB->vcbVRefNum); // Ask HFS to update all changes to disk
  772. GPtr->wrCnt = GPtr->realVCB->vcbWrCnt; // Remember write count after writing changes
  773. }
  774. #endif
  775. @@ -949,7 +949,7 @@ static int ScavSetUp( SGlob *GPtr)
  776. // Keep a valid file id list for HFS volumes
  777. GPtr->validFilesList = (UInt32**)NewHandle( 0 );
  778. - if ( GPtr->validFilesList == nil ) {
  779. + if (GPtr->validFilesList == NULL) {
  780. if ( GPtr->logLevel >= kDebugLog ) {
  781. printf( "\t error %d - could not allocate file ID list \n", R_NoMem );
  782. }
  783. @@ -995,17 +995,17 @@ static int ScavTerm( SGlobPtr GPtr )
  784. (void) BitMapCheckEnd();
  785. - while( (rP = GPtr->MinorRepairsP) != nil ) // loop freeing leftover (undone) repair orders
  786. + while((rP = GPtr->MinorRepairsP) != NULL) // loop freeing leftover (undone) repair orders
  787. {
  788. GPtr->MinorRepairsP = rP->link; // (in case repairs were not made)
  789. DisposeMemory(rP);
  790. err = MemError();
  791. }
  792. - if( GPtr->validFilesList != nil )
  793. + if (GPtr->validFilesList != NULL)
  794. DisposeHandle( (Handle) GPtr->validFilesList );
  795. - if( GPtr->overlappedExtents != nil ) {
  796. + if (GPtr->overlappedExtents != NULL) {
  797. extentsTableH = GPtr->overlappedExtents;
  798. /* Overlapped extents list also allocated memory for attribute name */
  799. @@ -1021,44 +1021,44 @@ static int ScavTerm( SGlobPtr GPtr )
  800. DisposeHandle( (Handle) GPtr->overlappedExtents );
  801. }
  802. - if( GPtr->fileIdentifierTable != nil )
  803. + if (GPtr->fileIdentifierTable != NULL)
  804. DisposeHandle( (Handle) GPtr->fileIdentifierTable );
  805. - if( GPtr->calculatedVCB == nil ) // already freed?
  806. + if (GPtr->calculatedVCB == NULL) // already freed?
  807. return( noErr );
  808. // If the FCB's and BTCB's have been set up, dispose of them
  809. fcbP = GPtr->calculatedExtentsFCB; // release extent file BTree bit map
  810. - if ( fcbP != nil )
  811. + if (fcbP != NULL)
  812. {
  813. btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
  814. - if ( btcbP != nil)
  815. + if (btcbP != NULL)
  816. {
  817. - if( btcbP->refCon != nil )
  818. + if (btcbP->refCon != NULL)
  819. {
  820. - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
  821. + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
  822. {
  823. DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
  824. err = MemError();
  825. }
  826. DisposeMemory( (Ptr)btcbP->refCon );
  827. err = MemError();
  828. - btcbP->refCon = nil;
  829. + btcbP->refCon = NULL;
  830. }
  831. fcbP = GPtr->calculatedCatalogFCB; // release catalog BTree bit map
  832. btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
  833. - if( btcbP->refCon != nil )
  834. + if (btcbP->refCon != NULL)
  835. {
  836. - if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
  837. + if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
  838. {
  839. DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
  840. err = MemError();
  841. }
  842. DisposeMemory( (Ptr)btcbP->refCon );
  843. err = MemError();
  844. - btcbP->refCon = nil;
  845. + btcbP->refCon = NULL;
  846. }
  847. }
  848. }
  849. @@ -1066,7 +1066,7 @@ static int ScavTerm( SGlobPtr GPtr )
  850. DisposeMemory( GPtr->calculatedVCB ); // Release our block of data structures
  851. err = MemError();
  852. - GPtr->calculatedVCB = nil;
  853. + GPtr->calculatedVCB = NULL;
  854. return( noErr );
  855. }
  856. @@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
  857. // Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks.
  858. driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum);
  859. driverDCtlPtr = *driverDCtlHandle;
  860. - if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != nil))
  861. + if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != NULL))
  862. {
  863. if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0)
  864. {
  865. @@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
  866. }
  867. driverName = (StringPtr)&(drvrHeaderPtr->drvrName);
  868. - if (!(IdenticalString(driverName,blueBoxSharedDriverName,nil)))
  869. + if (!(IdenticalString(driverName,blueBoxSharedDriverName,NULL)))
  870. {
  871. return( true );
  872. }
  873. // Special case for the ".Sony" floppy driver which might be accessed in Shared mode inside the Blue Box
  874. // Test its "where" string instead of the driver name.
  875. - if (!(IdenticalString(driverName,sonyDriverName,nil)))
  876. + if (!(IdenticalString(driverName,sonyDriverName,NULL)))
  877. {
  878. CntrlParam paramBlock;
  879. - paramBlock.ioCompletion = nil;
  880. - paramBlock.ioNamePtr = nil;
  881. + paramBlock.ioCompletion = NULL;
  882. + paramBlock.ioNamePtr = NULL;
  883. paramBlock.ioVRefNum = dqPtr->dQDrive;
  884. paramBlock.ioCRefNum = dqPtr->dQRefNum;
  885. paramBlock.csCode = kDriveIcon; // return physical icon
  886. @@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
  887. iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam;
  888. whereStringPtr = (StringPtr) & iconAndStringRecPtr->string;
  889. - if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,nil)))
  890. + if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,NULL)))
  891. {
  892. return( true );
  893. }
  894. --- a/fsck_hfs.tproj/dfalib/SRepair.c
  895. +++ b/fsck_hfs.tproj/dfalib/SRepair.c
  896. @@ -844,7 +844,7 @@ static int DelFThd( SGlobPtr GPtr, UInt3
  897. isHFSPlus = VolumeObjectIsHFSPlus( );
  898. - BuildCatalogKey( fid, (const CatalogName*) nil, isHFSPlus, &key );
  899. + BuildCatalogKey(fid, NULL, isHFSPlus, &key);
  900. result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
  901. if ( result ) return ( IntError( GPtr, result ) );
  902. @@ -910,7 +910,7 @@ static OSErr FixDirThread( SGlobPtr GPtr
  903. isHFSPlus = VolumeObjectIsHFSPlus( );
  904. - BuildCatalogKey( did, (const CatalogName*) nil, isHFSPlus, &key );
  905. + BuildCatalogKey(did, NULL, isHFSPlus, &key);
  906. result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
  907. if ( result )
  908. @@ -2171,7 +2171,7 @@ static OSErr FixOrphanedFiles ( SGlobPtr
  909. }
  910. //-- Build the key for the file thread
  911. - BuildCatalogKey( cNodeID, nil, isHFSPlus, &key );
  912. + BuildCatalogKey(cNodeID, NULL, isHFSPlus, &key);
  913. err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint,
  914. &tempKey, &threadRecord, &recordSize, &hint2 );
  915. --- a/fsck_hfs.tproj/dfalib/SUtils.c
  916. +++ b/fsck_hfs.tproj/dfalib/SUtils.c
  917. @@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
  918. err = GetVCBDriveNum( &GPtr->realVCB, GPtr->DrvNum );
  919. ReturnIfError( err );
  920. - if ( GPtr->realVCB != nil )
  921. + if (GPtr->realVCB != NULL)
  922. {
  923. GPtr->volumeFeatures |= volumeIsMountedMask;
  924. - pb.ioParam.ioNamePtr = nil;
  925. + pb.ioParam.ioNamePtr = NULL;
  926. pb.ioParam.ioVRefNum = GPtr->realVCB->vcbVRefNum;
  927. pb.ioParam.ioBuffer = (Ptr) &buffer;
  928. pb.ioParam.ioReqCount = sizeof( buffer );
  929. @@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *c
  930. * 4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord
  931. * indicates which btree prime number bucket should be incremented
  932. *
  933. - * Output: nil
  934. + * Output: NULL
  935. */
  936. void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype)
  937. {
  938. --- a/fsck_hfs.tproj/dfalib/SVerify1.c
  939. +++ b/fsck_hfs.tproj/dfalib/SVerify1.c
  940. @@ -790,13 +790,13 @@ OSErr CreateExtentsBTreeControlBlock( SG
  941. // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
  942. //
  943. btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  944. - if ( btcb->refCon == nil ) {
  945. + if (btcb->refCon == NULL) {
  946. err = R_NoMem;
  947. goto exit;
  948. }
  949. size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
  950. ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
  951. - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
  952. + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
  953. {
  954. err = R_NoMem;
  955. goto exit;
  956. @@ -1145,13 +1145,13 @@ OSErr CreateCatalogBTreeControlBlock( SG
  957. //
  958. btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  959. - if ( btcb->refCon == nil ) {
  960. + if (btcb->refCon == NULL) {
  961. err = R_NoMem;
  962. goto exit;
  963. }
  964. size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
  965. ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
  966. - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
  967. + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
  968. {
  969. err = R_NoMem;
  970. goto exit;
  971. @@ -1339,7 +1339,7 @@ OSErr CatHChk( SGlobPtr GPtr )
  972. //�� Can we ignore this part by just taking advantage of setting the selCode = 0x8001;
  973. {
  974. - BuildCatalogKey( 1, (const CatalogName *)nil, isHFSPlus, &key );
  975. + BuildCatalogKey(1, NULL, isHFSPlus, &key);
  976. result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
  977. GPtr->TarBlock = hint; /* set target block */
  978. @@ -1443,7 +1443,7 @@ OSErr CatHChk( SGlobPtr GPtr )
  979. /*
  980. * Find thread record
  981. */
  982. - BuildCatalogKey( dprP->directoryID, (const CatalogName *) nil, isHFSPlus, &key );
  983. + BuildCatalogKey(dprP->directoryID, NULL, isHFSPlus, &key);
  984. result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
  985. if ( result != noErr ) {
  986. char idStr[16];
  987. @@ -1780,26 +1780,26 @@ OSErr CreateAttributesBTreeControlBlock(
  988. // set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes.
  989. //
  990. btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions
  991. - if ( btcb->refCon == nil ) {
  992. + if (btcb->refCon == NULL) {
  993. err = R_NoMem;
  994. goto exit;
  995. }
  996. if (btcb->totalNodes == 0)
  997. {
  998. - ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = nil;
  999. + ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = NULL;
  1000. ((BTreeExtensionsRec*)btcb->refCon)->BTCBMSize = 0;
  1001. ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount = 0;
  1002. }
  1003. else
  1004. {
  1005. - if ( btcb->refCon == nil ) {
  1006. + if (btcb->refCon == NULL) {
  1007. err = R_NoMem;
  1008. goto exit;
  1009. }
  1010. size = (btcb->totalNodes + 7) / 8; // size of BTree bit map
  1011. ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size); // get precleared bitmap
  1012. - if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
  1013. + if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
  1014. {
  1015. err = R_NoMem;
  1016. goto exit;
  1017. @@ -2358,7 +2358,7 @@ static OSErr RcdMDBEmbededVolDescription
  1018. RcdError( GPtr, type ); // first, record the error
  1019. p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) ); // get the node
  1020. - if ( p == nil ) return( R_NoMem );
  1021. + if (p == NULL) return( R_NoMem );
  1022. p->type = type; // save error info
  1023. desc = (EmbededVolDescription *) &(p->name);
  1024. @@ -2397,7 +2397,7 @@ static OSErr RcdInvalidWrapperExtents( S
  1025. RcdError( GPtr, type ); // first, record the error
  1026. p = AllocMinorRepairOrder( GPtr, 0 ); // get the node
  1027. - if ( p == nil ) return( R_NoMem );
  1028. + if (p == NULL) return( R_NoMem );
  1029. p->type = type; // save error info
  1030. @@ -3029,7 +3029,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
  1031. foundBadExtent = false;
  1032. lastExtentIndex = GPtr->numExtents;
  1033. - while ( (extents != nil) && (err == noErr) )
  1034. + while ((extents != NULL) && (err == noErr))
  1035. {
  1036. // checkout the extent record first
  1037. err = ChkExtRec( GPtr, extents, &lastExtentIndex );
  1038. @@ -3105,7 +3105,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
  1039. if ( err == btNotFound )
  1040. {
  1041. err = noErr; // no more extent records
  1042. - extents = nil;
  1043. + extents = NULL;
  1044. break;
  1045. }
  1046. else if ( err != noErr )
  1047. @@ -3121,7 +3121,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
  1048. if ( err == btNotFound )
  1049. {
  1050. err = noErr; // no more extent records
  1051. - extents = nil;
  1052. + extents = NULL;
  1053. break;
  1054. }
  1055. else if ( err != noErr )
  1056. @@ -3205,7 +3205,7 @@ static OSErr AddExtentToOverlapList( SGl
  1057. }
  1058. // If it's uninitialized
  1059. - if ( GPtr->overlappedExtents == nil )
  1060. + if (GPtr->overlappedExtents == NULL)
  1061. {
  1062. GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) );
  1063. extentsTableH = GPtr->overlappedExtents;
  1064. --- a/fsck_hfs.tproj/dfalib/SVerify2.c
  1065. +++ b/fsck_hfs.tproj/dfalib/SVerify2.c
  1066. @@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, Node
  1067. UInt16 keyLength;
  1068. KeyPtr keyPtr;
  1069. UInt8 *dataPtr;
  1070. - KeyPtr prevkeyP = nil;
  1071. + KeyPtr prevkeyP = NULL;
  1072. if ( nodeP->numRecords == 0 )
  1073. @@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, Node
  1074. return( E_KeyLen );
  1075. }
  1076. - if ( prevkeyP != nil )
  1077. + if (prevkeyP != NULL)
  1078. {
  1079. if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
  1080. {