(void)snprintf((char*)&attrRec->attrData[0],
sizeof(attrdata) - offsetof(HFSPlusAttrData, attrData),
"%lu", (unsigned long)(p->correct));
- attrRec->attrSize = 1 + strlen((char*)&attrRec->attrData[0]);
+ attrRec->attrSize = (u_int32_t)(1 + strlen((char*)&attrRec->attrData[0]));
bt_data.bufferAddress = attrRec;
recsize = sizeof(HFSPlusAttrData) - 2 + attrRec->attrSize + ((attrRec->attrSize & 1) ? 1 : 0);
bt_data.itemSize = recsize;
if (rec.recordType != kHFSPlusFileRecord) {
retval = IntError(GPtr, R_IntErr);
} else {
- rec.hfsPlusFile.createDate = p->correct;
+ rec.hfsPlusFile.createDate = (u_int32_t)p->correct;
retval = ReplaceBTreeRecord(GPtr->calculatedCatalogFCB, &key, kNoHint, &rec, recsize, &hint);
}
}
}
#endif
- record.hfsPlusFolder.folderCount = p->correct;
+ record.hfsPlusFolder.folderCount = (u_int32_t)p->correct;
result = ReplaceBTreeRecord( GPtr->calculatedCatalogFCB, &foundKey, hint,
&record, recSize, &hint);
if (result) {
Boolean didRepair;
fileID = p->parid;
- badExtentIndex = p->correct;
+ badExtentIndex = (UInt32)p->correct;
extentStartBlock = p->hint;
forkType = p->forkType;
/* Lookup record in catalog BTree */
err = GetCatalogRecord(GPtr, fileID, isHFSPlus, &catKey, &catRecord, &recordSize);
if (err) {
- plog("%s: Could not get catalog record for fileID %u\n", __FUNCTION__, fileID);
+ if (debug) plog("%s: Could not get catalog record for fileID %u\n", __FUNCTION__, fileID);
goto out;
}
err = ReplaceBTreeRecord(GPtr->calculatedCatalogFCB, &catKey, kNoHint,
&catRecord, recordSize, &hint);
if (err) {
- plog("%s: Could not replace catalog record for fileID %u\n", __FUNCTION__, fileID);
+ if (debug) plog("%s: Could not replace catalog record for fileID %u\n", __FUNCTION__, fileID);
goto out;
}
didRepair = true;
err = SearchBTreeRecord (GPtr->calculatedExtentsFCB, &extentKey, kNoHint,
&extentKey, &extentRecord, &recordSize, &hint);
if (err) {
- plog("%s: Could not get overflow extents record for fileID %u, fork %u, start block %u\n", __FUNCTION__, fileID, forkType, extentStartBlock);
+ if (debug) plog("%s: Could not get overflow extents record for fileID %u, fork %u, start block %u\n", __FUNCTION__, fileID, forkType,
+ extentStartBlock);
goto out;
}
err = ReplaceBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey, hint,
&extentRecord, recordSize, &hint);
if (err) {
- plog("%s: Could not replace overflow extents record for fileID %u, fork %u, start block %u\n", __FUNCTION__, fileID, forkType, extentStartBlock);
+ if (debug) plog("%s: Could not replace overflow extents record for fileID %u, fork %u, start block %u\n", __FUNCTION__, fileID,
+ forkType, extentStartBlock);
goto out;
}
didRepair = true;
BuildCatalogKey(fileID, NULL, isHFSPlus, &catThreadKey);
err = SearchBTreeRecord(GPtr->calculatedCatalogFCB, &catThreadKey, kNoHint, catKey, catRecord, recordSize, &hint);
if (err) {
- plog ("%s: No matching catalog thread record found\n", __FUNCTION__);
+ if (debug) plog ("%s: No matching catalog thread record found\n", __FUNCTION__);
goto out;
}
BuildCatalogKey(catRecord->hfsPlusThread.parentID, &catalogName, isHFSPlus, catKey);
err = SearchBTreeRecord(GPtr->calculatedCatalogFCB, catKey, kNoHint, catKey, catRecord, recordSize, &hint);
if (err) {
- plog ("%s: No matching catalog record found\n", __FUNCTION__);
+ if (debug) plog ("%s: No matching catalog record found\n", __FUNCTION__);
if (cur_debug_level & d_dump_record)
{
plog ("Searching for key:\n");
int cmpLongs ( const void *a, const void *b )
{
- return( *(long*)a - *(long*)b );
+ return (int)( *(long*)a - *(long*)b );
}
/* Function: FixOverlappingExtents
break;
};
filename[len] = '\0';
- *filenamelen = strlen (filename);
+ *filenamelen = (unsigned int)strlen (filename);
}
return err;
}
}
/* Do not NULL terminate the string */
- curPtr->namelen = namelen;
+ curPtr->namelen = (unsigned int)namelen;
curPtr->name = malloc(namelen);
if (!curPtr->name) {
err = memFullErr;
// no way to find the original name and this should make it unique within our
// lost+found directory.
sprintf( myString, "%ld", (long)theObjID );
- nameLen = strlen( myString );
+ nameLen = (int)strlen( myString );
if ( isHFSPlus )
{
isHFSPlus = VolumeObjectIsHFSPlus( );
fcbPtr = GPtr->calculatedCatalogFCB;
- nameLen = strlen( (char *)dirName );
+ nameLen = (int)strlen( (char *)dirName );
if ( isHFSPlus )
{