vasi / squashfuse

FUSE filesystem to mount squashfs archives
Other
295 stars 69 forks source link

Add squashfuse_extract tool #14

Closed probonopd closed 8 years ago

probonopd commented 8 years ago

The squashfuse_extract can extract files, directories, and symlinks from a squashfs image. Closes #13 and partly #9.

probonopd commented 8 years ago

Thanks for your thorough review @chipturner. I have addressed your points. Now I would like to get rid of the following compiler warnings, can you give me hints on how to do that?

extract.c: In function ‘sqfs_stat’:
extract.c:51:17: warning: implicit declaration of function ‘sqfs_makedev’ [-Wimplicit-function-declaration]
   st->st_rdev = sqfs_makedev(inode->xtra.dev.major,
                 ^
extract.c: In function ‘main’:
extract.c:148:91: warning: pointer targets in passing argument 4 of ‘sqfs_read_range’ differ in signedness [-Wpointer-sign]
                         if (sqfs_read_range(&fs, &inode, (sqfs_off_t) bytes_already_read, &bytes_at_a_time, buf))
                                                                                           ^
In file included from squashfuse.h:29:0,
                 from extract.c:1:
file.h:60:10: note: expected ‘sqfs_off_t * {aka long int *}’ but argument is of type ‘size_t * {aka long unsigned int *}’
 sqfs_err sqfs_read_range(sqfs *fs, sqfs_inode *inode, sqfs_off_t start,
          ^
  CCLD     squashfuse_extract
make[1]: Leaving directory '/home/me/squashfuse'
chipturner commented 8 years ago

Looks good, thanks!

chipturner commented 8 years ago

To fix that warning, you probably need to switch from long int to a size_t (size_t is unsigned)