]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfscommon/Misc/BTreeWrapper.c
xnu-1228.7.58.tar.gz
[apple/xnu.git] / bsd / hfs / hfscommon / Misc / BTreeWrapper.c
index 8216559855ce53b3f527ab9dff041dde2a096265..eb7fc628f92c0885afb55a9e15739c801961af46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000,2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2002, 2005 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
 
 // local routines
 static OSErr   CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb);
-static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, UInt16 recordSize);
+static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, u_int16_t recordSize);
 
 
 
 
-OSErr SearchBTreeRecord(FileReference refNum, const void* key, UInt32 hint, void* foundKey, void* data, UInt16 *dataSize, UInt32 *newHint)
+OSErr SearchBTreeRecord(__unused FileReference refNum, __unused const void* key, __unused u_int32_t hint, __unused void* foundKey, __unused void* data, __unused u_int16_t *dataSize, __unused u_int32_t *newHint)
 {
        panic("SearchBTreeRecord is dead code!");
        return (-1);
@@ -94,7 +94,7 @@ ErrorExit:
 }
 
 
-OSErr ReplaceBTreeRecord(FileReference refNum, const void* key, UInt32 hint, void *newData, UInt16 dataSize, UInt32 *newHint)
+OSErr ReplaceBTreeRecord(FileReference refNum, const void* key, u_int32_t hint, void *newData, u_int16_t dataSize, u_int32_t *newHint)
 {
        FSBufferDescriptor      btRecord;
        BTreeIterator           iterator;
@@ -112,10 +112,10 @@ OSErr ReplaceBTreeRecord(FileReference refNum, const void* key, UInt32 hint, voi
 
        iterator.hint.nodeNum = hint;
 
-       result = CheckBTreeKey((BTreeKey *) key, btcb);
+       result = CheckBTreeKey((const BTreeKey *) key, btcb);
        ExitOnError(result);
 
-       BlockMoveData(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key));         //\80\80 should we range check against maxkeylen?
+       BlockMoveData(key, &iterator.key, CalcKeySize(btcb, (const BTreeKey *) key));           //\80\80 should we range check against maxkeylen?
 
        if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
                DebugStr("\pReplaceBTreeRecord: bad record?");
@@ -135,7 +135,7 @@ ErrorExit:
 
 static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
 {
-       UInt16  keyLen;
+       u_int16_t       keyLen;
        
        if ( btcb->attributes & kBTBigKeysMask )
                keyLen = key->length16;
@@ -153,9 +153,9 @@ static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
 }
 
 
-static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, UInt16 recordSize)
+static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, u_int16_t recordSize)
 {
-       UInt32                  cNodeID;
+       u_int32_t                       cNodeID;
        
        if ( btcb->maxKeyLength == kHFSExtentKeyMaximumLength )
        {
@@ -167,7 +167,7 @@ static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb,
        }
        else // Catalog record
        {
-               CatalogRecord *catalogRecord = (CatalogRecord*) record;
+               const CatalogRecord *catalogRecord = (const CatalogRecord*) record;
 
                switch(catalogRecord->recordType)
                {
@@ -205,7 +205,7 @@ static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb,
        
                        case kHFSFileRecord:
                        {
-//                             UInt16                                  i;
+//                             u_int16_t                                       i;
                                HFSExtentDescriptor     *dataExtent;
                                HFSExtentDescriptor     *rsrcExtent;
                                
@@ -247,7 +247,7 @@ static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb,
        
                        case kHFSPlusFileRecord:
                        {
-//                             UInt16                                  i;
+//                             u_int16_t                                       i;
                                HFSPlusExtentDescriptor *dataExtent;
                                HFSPlusExtentDescriptor *rsrcExtent;