[Pancutan-commits] r62 - hfsbootfiles
tincho-guest at alioth.debian.org
tincho-guest at alioth.debian.org
Wed Aug 15 23:42:29 UTC 2007
Author: tincho-guest
Date: 2007-08-15 23:42:28 +0000 (Wed, 15 Aug 2007)
New Revision: 62
Modified:
hfsbootfiles/btree.c
hfsbootfiles/hfsbootfiles.c
hfsbootfiles/volume.c
hfsbootfiles/volume.h
Log:
Fix for some compiler warnings
Modified: hfsbootfiles/btree.c
===================================================================
--- hfsbootfiles/btree.c 2007-08-14 23:55:38 UTC (rev 61)
+++ hfsbootfiles/btree.c 2007-08-15 23:42:28 UTC (rev 62)
@@ -409,7 +409,7 @@
* DESCRIPTION: recursively locate a node and insert a record
*/
static
-int insertx(node *np, byte *record, int *reclen)
+int insertx(node *np, byte *record, unsigned int *reclen)
{
node child;
byte *rec;
Modified: hfsbootfiles/hfsbootfiles.c
===================================================================
--- hfsbootfiles/hfsbootfiles.c 2007-08-14 23:55:38 UTC (rev 61)
+++ hfsbootfiles/hfsbootfiles.c 2007-08-15 23:42:28 UTC (rev 62)
@@ -8,40 +8,46 @@
extern unsigned long FIX_OFFSET;
int main(int argc, char** argv) {
+ int partno = 0;
+ hfsvol *vol;
+ hfsvolent volent;
+ unsigned long id;
+ char *name = NULL;
+ int len = 0;
+ hfsdir *dir;
+ hfsdirent dirent;
+
if(argc < 2) {
fprintf(stderr, "Usage: %s file partno\n", argv[0]);
return 2;
}
- int partno = 0;
if(argc > 2)
partno = atoi(argv[2]);
- hfsvol *vol = hfs_mount(argv[1], partno, HFS_MODE_RDONLY);
+ vol = hfs_mount(argv[1], partno, HFS_MODE_RDONLY);
if(!vol)
pexit(3);
- hfsvolent volent;
if(hfs_vstat(vol, &volent))
pexit(3);
- unsigned long id = volent.blessed;
+ id = volent.blessed;
if(!id) {
fprintf(stderr, "No blessed folder\n");
return 1;
}
- char *name = NULL; //strdup(":");
- int len = 0;
while(id != HFS_CNID_ROOTPAR) {
char buf[HFS_MAX_FLEN + 1];
+ char *nname;
+
if(hfs_dirinfo(vol, &id, buf))
pexit(3);
len += strlen(buf) + 1;
- char *nname = malloc(len + 1);
+ nname = malloc(len + 1);
snprintf(nname, len + 1, "%s:%s", buf, name);
free(name);
name = nname;
}
- hfsdir *dir = hfs_opendir(vol, name);
+ dir = hfs_opendir(vol, name);
if(!dir)
pexit(3);
- hfsdirent dirent;
while(hfs_readdir(dir, &dirent) == 0) {
if(!(dirent.flags & HFS_ISDIR ||
strncmp(dirent.u.file.type, "tbxi", 4)))
Modified: hfsbootfiles/volume.c
===================================================================
--- hfsbootfiles/volume.c 2007-08-14 23:55:38 UTC (rev 61)
+++ hfsbootfiles/volume.c 2007-08-15 23:42:28 UTC (rev 62)
@@ -758,7 +758,7 @@
* DESCRIPTION: translate a pathname; return catalog information
*/
int v_resolve(hfsvol **vol, const char *path,
- CatDataRec *data, long *parid, char *fname, node *np)
+ CatDataRec *data, unsigned long *parid, char *fname, node *np)
{
unsigned long dirid;
char name[HFS_MAX_FLEN + 1], *nptr;
Modified: hfsbootfiles/volume.h
===================================================================
--- hfsbootfiles/volume.h 2007-08-14 23:55:38 UTC (rev 61)
+++ hfsbootfiles/volume.h 2007-08-15 23:42:28 UTC (rev 62)
@@ -54,7 +54,8 @@
int v_allocblocks(hfsvol *, ExtDescriptor *);
int v_freeblocks(hfsvol *, const ExtDescriptor *);
-int v_resolve(hfsvol **, const char *, CatDataRec *, long *, char *, node *);
+int v_resolve(hfsvol **, const char *, CatDataRec *, unsigned long *, char *,
+ node *);
int v_adjvalence(hfsvol *, unsigned long, int, int);
int v_mkdir(hfsvol *, unsigned long, const char *);
More information about the Pancutan-commits
mailing list