From cabb55290dd33131b62549c5499cc77e6edb0ccf Mon Sep 17 00:00:00 2001 From: Yorhel <git@yorhel.nl> Date: Mon, 27 Aug 2012 19:07:05 +0200 Subject: [PATCH] Use uint64_t instead of ino_t POSIX defines ino_t to be of an unsigned integer type, and searching around the net didn't tell me of any definitions conflicting that. So every ino_t can be represented in an uint64_t. (Assuming that is the largest integer type in use for an inode number, but I'm sure that assumption will hold for a while) (dev_t, on the other hand, is a bit messier. Still figuring out what to do with that.) --- configure.in | 1 + src/dir_scan.c | 2 +- src/global.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 71f3294..053f3bd 100644 --- a/configure.in +++ b/configure.in @@ -16,6 +16,7 @@ AC_CHECK_HEADERS( # Check for typedefs, structures, and compiler characteristics. AC_TYPE_INT64_T +AC_TYPE_UINT64_T AC_SYS_LARGEFILE AC_STRUCT_ST_BLOCKS diff --git a/src/dir_scan.c b/src/dir_scan.c index e7ee5d8..4b07ed5 100644 --- a/src/dir_scan.c +++ b/src/dir_scan.c @@ -49,7 +49,7 @@ static dev_t curdev; /* current device we're scanning on */ /* Populates the struct dir item with information from the stat struct. Sets * everything necessary for output_dir.item() except FF_ERR and FF_EXL. */ static void stat_to_dir(struct dir *d, struct stat *fs) { - d->ino = fs->st_ino; + d->ino = (uint64_t)fs->st_ino; d->dev = fs->st_dev; if(S_ISREG(fs->st_mode)) diff --git a/src/global.h b/src/global.h index e1f273e..7737204 100644 --- a/src/global.h +++ b/src/global.h @@ -61,7 +61,7 @@ struct dir { struct dir *parent, *next, *prev, *sub, *hlnk; int64_t size, asize; - ino_t ino; + uint64_t ino; int items; dev_t dev; unsigned char flags; -- GitLab