diff --git a/fsck_hfs.tproj/dfalib/CatalogCheck.c b/fsck_hfs.tproj/dfalib/CatalogCheck.c index 96068d6..eb8257c 100644 --- a/fsck_hfs.tproj/dfalib/CatalogCheck.c +++ b/fsck_hfs.tproj/dfalib/CatalogCheck.c @@ -23,6 +23,7 @@ #include "Scavenger.h" #include "DecompDataEnums.h" #include "DecompData.h" +#include /* * information collected when visiting catalog records diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c index 39b7d6c..3009857 100644 --- a/fsck_hfs.tproj/dfalib/SRepair.c +++ b/fsck_hfs.tproj/dfalib/SRepair.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "../cache.h" enum { diff --git a/fsck_hfs.tproj/dfalib/Scavenger.h b/fsck_hfs.tproj/dfalib/Scavenger.h index 31706dd..41e72a6 100644 --- a/fsck_hfs.tproj/dfalib/Scavenger.h +++ b/fsck_hfs.tproj/dfalib/Scavenger.h @@ -44,7 +44,7 @@ #include #include #endif -#include +#include #ifdef __cplusplus extern "C" { diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c index 1b065fd..ade6b22 100644 --- a/fsck_hfs.tproj/fsck_hfs.c +++ b/fsck_hfs.tproj/fsck_hfs.c @@ -88,11 +88,11 @@ Cache_t fscache; -static int checkfilesys __P((char * filesys)); -static int setup __P(( char *dev, int *blockDevice_fdPtr, int *canWritePtr )); -static void usage __P((void)); -static void getWriteAccess __P(( char *dev, int *blockDevice_fdPtr, int *canWritePtr )); -extern char *unrawname __P((char *name)); +static int checkfilesys (char * filesys); +static int setup ( char *dev, int *blockDevice_fdPtr, int *canWritePtr ); +static void usage (void); +static void getWriteAccess ( char *dev, int *blockDevice_fdPtr, int *canWritePtr ); +extern char *unrawname (char *name); int main(argc, argv) diff --git a/fsck_hfs.tproj/fsck_hfs.h b/fsck_hfs.tproj/fsck_hfs.h index c6e772a..bf9247b 100644 --- a/fsck_hfs.tproj/fsck_hfs.h +++ b/fsck_hfs.tproj/fsck_hfs.h @@ -47,9 +47,9 @@ extern Cache_t fscache; #define EEXIT 8 /* Standard error exit. */ -char *blockcheck __P((char *name)); -void catch __P((int)); -void ckfini __P((int markclean)); -void pfatal __P((const char *fmt, ...)); -void pwarn __P((const char *fmt, ...)); -int reply __P((char *question)); +char *blockcheck (char *name); +void catch (int); +void ckfini (int markclean); +void pfatal (const char *fmt, ...); +void pwarn (const char *fmt, ...); +int reply (char *question); diff --git a/fsck_hfs.tproj/utilities.c b/fsck_hfs.tproj/utilities.c index 8e1cd77..3891e13 100644 --- a/fsck_hfs.tproj/utilities.c +++ b/fsck_hfs.tproj/utilities.c @@ -66,8 +66,8 @@ #include "fsck_hfs.h" -char *rawname __P((char *name)); -char *unrawname __P((char *name)); +char *rawname (char *name); +char *unrawname (char *name); int diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c index b0371a2..b552131 100644 --- a/newfs_hfs.tproj/makehfs.c +++ b/newfs_hfs.tproj/makehfs.c @@ -35,7 +35,6 @@ #include #include "missing.h" #endif -#include #include #if !LINUX #include @@ -90,62 +89,62 @@ struct filefork { struct filefork gDTDBFork, gSystemFork, gReadMeFork; -static void WriteMDB __P((const DriveInfo *driveInfo, HFS_MDB *mdbp)); -static void InitMDB __P((hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)); +static void WriteMDB (const DriveInfo *driveInfo, HFS_MDB *mdbp); +static void InitMDB (hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp); -static void WriteVH __P((const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp)); -static void InitVH __P((hfsparams_t *defaults, UInt64 sectors, - HFSPlusVolumeHeader *header)); +static void WriteVH (const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp); +static void InitVH (hfsparams_t *defaults, UInt64 sectors, + HFSPlusVolumeHeader *header); -static void WriteBitmap __P((const DriveInfo *dip, UInt32 startingSector, - UInt32 alBlksUsed, UInt8 *buffer)); +static void WriteBitmap (const DriveInfo *dip, UInt32 startingSector, + UInt32 alBlksUsed, UInt8 *buffer); -static void WriteExtentsFile __P((const DriveInfo *dip, UInt32 startingSector, +static void WriteExtentsFile (const DriveInfo *dip, UInt32 startingSector, const hfsparams_t *dp, HFSExtentDescriptor *bbextp, void *buffer, - UInt32 *bytesUsed, UInt32 *mapNodes)); -static void InitExtentsRoot __P((UInt16 btNodeSize, HFSExtentDescriptor *bbextp, - void *buffer)); + UInt32 *bytesUsed, UInt32 *mapNodes); +static void InitExtentsRoot (UInt16 btNodeSize, HFSExtentDescriptor *bbextp, + void *buffer); -static void WriteCatalogFile __P((const DriveInfo *dip, UInt32 startingSector, +static void WriteCatalogFile (const DriveInfo *dip, UInt32 startingSector, const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer, - UInt32 *bytesUsed, UInt32 *mapNodes)); + UInt32 *bytesUsed, UInt32 *mapNodes); static void WriteJournalInfo(const DriveInfo *driveInfo, UInt32 startingSector, const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer); -static void InitCatalogRoot_HFSPlus __P((const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer)); -static void InitCatalogRoot_HFS __P((const hfsparams_t *dp, void * buffer)); -static void InitFirstCatalogLeaf __P((const hfsparams_t *dp, void * buffer, - int wrapper)); -static void InitSecondCatalogLeaf __P((const hfsparams_t *dp, void *buffer)); +static void InitCatalogRoot_HFSPlus (const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer); +static void InitCatalogRoot_HFS (const hfsparams_t *dp, void * buffer); +static void InitFirstCatalogLeaf (const hfsparams_t *dp, void * buffer, + int wrapper); +static void InitSecondCatalogLeaf (const hfsparams_t *dp, void *buffer); static void WriteDesktopDB(const hfsparams_t *dp, const DriveInfo *driveInfo, UInt32 startingSector, void *buffer, UInt32 *mapNodes); -static void ClearDisk __P((const DriveInfo *driveInfo, UInt64 startingSector, - UInt32 numberOfSectors)); -static void WriteSystemFile __P((const DriveInfo *dip, UInt32 startingSector, - UInt32 *filesize)); -static void WriteReadMeFile __P((const DriveInfo *dip, UInt32 startingSector, - UInt32 *filesize)); -static void WriteMapNodes __P((const DriveInfo *driveInfo, UInt32 diskStart, - UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer)); -static void WriteBuffer __P((const DriveInfo *driveInfo, UInt64 startingSector, - UInt32 byteCount, const void *buffer)); -static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d )); - -static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header, - UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector)); +static void ClearDisk (const DriveInfo *driveInfo, UInt64 startingSector, + UInt32 numberOfSectors); +static void WriteSystemFile (const DriveInfo *dip, UInt32 startingSector, + UInt32 *filesize); +static void WriteReadMeFile (const DriveInfo *dip, UInt32 startingSector, + UInt32 *filesize); +static void WriteMapNodes (const DriveInfo *driveInfo, UInt32 diskStart, + UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer); +static void WriteBuffer (const DriveInfo *driveInfo, UInt64 startingSector, + UInt32 byteCount, const void *buffer); +static UInt32 Largest (UInt32 a, UInt32 b, UInt32 c, UInt32 d ); + +static void MarkBitInAllocationBuffer (HFSPlusVolumeHeader *header, + UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector); #if !LINUX static UInt32 GetDefaultEncoding(); #endif -static UInt32 UTCToLocal __P((UInt32 utcTime)); +static UInt32 UTCToLocal (UInt32 utcTime); -static UInt32 DivideAndRoundUp __P((UInt32 numerator, UInt32 denominator)); +static UInt32 DivideAndRoundUp (UInt32 numerator, UInt32 denominator); -static int ConvertUTF8toUnicode __P((const UInt8* source, UInt32 bufsize, - UniChar* unibuf, UInt16 *charcount)); +static int ConvertUTF8toUnicode (const UInt8* source, UInt32 bufsize, + UniChar* unibuf, UInt16 *charcount); static int getencodinghint(unsigned char *name); diff --git a/newfs_hfs.tproj/newfs_hfs.c b/newfs_hfs.tproj/newfs_hfs.c index 1bcc044..7d736ca 100644 --- a/newfs_hfs.tproj/newfs_hfs.c +++ b/newfs_hfs.tproj/newfs_hfs.c @@ -61,19 +61,19 @@ #define ROUNDUP(x,y) (((x)+(y)-1)/(y)*(y)) -static void getnodeopts __P((char* optlist)); -static void getclumpopts __P((char* optlist)); -static gid_t a_gid __P((char *)); -static uid_t a_uid __P((char *)); -static mode_t a_mask __P((char *)); -static int hfs_newfs __P((char *device, int forceHFS, int isRaw)); -static void validate_hfsplus_block_size __P((UInt64 sectorCount, UInt32 sectorSize)); -static void hfsplus_params __P((UInt64 sectorCount, UInt32 sectorSize, hfsparams_t *defaults)); -static void hfs_params __P((UInt32 sectorCount, UInt32 sectorSize, hfsparams_t *defaults)); -static UInt32 clumpsizecalc __P((UInt32 clumpblocks)); -static UInt32 CalcBTreeClumpSize __P((UInt32 blockSize, UInt32 nodeSize, UInt32 driveBlocks, int catalog)); -static UInt32 CalcHFSPlusBTreeClumpSize __P((UInt32 blockSize, UInt32 nodeSize, UInt64 sectors, int catalog)); -static void usage __P((void)); +static void getnodeopts (char* optlist); +static void getclumpopts (char* optlist); +static gid_t a_gid (char *); +static uid_t a_uid (char *); +static mode_t a_mask (char *); +static int hfs_newfs (char *device, int forceHFS, int isRaw); +static void validate_hfsplus_block_size (UInt64 sectorCount, UInt32 sectorSize); +static void hfsplus_params (UInt64 sectorCount, UInt32 sectorSize, hfsparams_t *defaults); +static void hfs_params (UInt32 sectorCount, UInt32 sectorSize, hfsparams_t *defaults); +static UInt32 clumpsizecalc (UInt32 clumpblocks); +static UInt32 CalcBTreeClumpSize (UInt32 blockSize, UInt32 nodeSize, UInt32 driveBlocks, int catalog); +static UInt32 CalcHFSPlusBTreeClumpSize (UInt32 blockSize, UInt32 nodeSize, UInt64 sectors, int catalog); +static void usage (void); char *progname;