/*
- * Copyright (c) 2000,2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2002, 2005 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* Please see the License for the specific language governing rights and
* limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#include "../headers/BTreesPrivate.h"
// 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);
}
-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;
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?");
static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
{
- UInt16 keyLen;
+ u_int16_t keyLen;
if ( btcb->attributes & kBTBigKeysMask )
keyLen = key->length16;
}
-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 )
{
}
else // Catalog record
{
- CatalogRecord *catalogRecord = (CatalogRecord*) record;
+ const CatalogRecord *catalogRecord = (const CatalogRecord*) record;
switch(catalogRecord->recordType)
{
case kHFSFileRecord:
{
-// UInt16 i;
+// u_int16_t i;
HFSExtentDescriptor *dataExtent;
HFSExtentDescriptor *rsrcExtent;
case kHFSPlusFileRecord:
{
-// UInt16 i;
+// u_int16_t i;
HFSPlusExtentDescriptor *dataExtent;
HFSPlusExtentDescriptor *rsrcExtent;