diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-11-22 15:18:54 +1100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-11-22 15:18:54 +1100 |
commit | 6c13cf6dacf5f5f2f5ba4f28b3632f3f9df29b7c (patch) | |
tree | f57c3a420e3e43f0936105b4b6f642f315fe1627 | |
parent | fefefd1d39420095631987e503402f8ee6956163 (diff) | |
download | libgit2-6c13cf6dacf5f5f2f5ba4f28b3632f3f9df29b7c.tar.gz |
filestamp: use `uint64_t` for object size
Instead of using a signed type (`off_t`) use an unsigned `uint64_t` for
the size of the files.
-rw-r--r-- | src/futils.c | 6 | ||||
-rw-r--r-- | src/futils.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/futils.c b/src/futils.c index c508c7485..7e100a930 100644 --- a/src/futils.c +++ b/src/futils.c @@ -1110,7 +1110,7 @@ int git_futils_filestamp_check( #if defined(GIT_USE_NSEC) stamp->mtime.tv_nsec == st.st_mtime_nsec && #endif - stamp->size == (git_off_t)st.st_size && + stamp->size == (uint64_t)st.st_size && stamp->ino == (unsigned int)st.st_ino) return 0; @@ -1118,7 +1118,7 @@ int git_futils_filestamp_check( #if defined(GIT_USE_NSEC) stamp->mtime.tv_nsec = st.st_mtime_nsec; #endif - stamp->size = (git_off_t)st.st_size; + stamp->size = (uint64_t)st.st_size; stamp->ino = (unsigned int)st.st_ino; return 1; @@ -1146,7 +1146,7 @@ void git_futils_filestamp_set_from_stat( #else stamp->mtime.tv_nsec = 0; #endif - stamp->size = (git_off_t)st->st_size; + stamp->size = (uint64_t)st->st_size; stamp->ino = (unsigned int)st->st_ino; } else { memset(stamp, 0, sizeof(*stamp)); diff --git a/src/futils.h b/src/futils.h index e6fd22bc1..f97b15602 100644 --- a/src/futils.h +++ b/src/futils.h @@ -330,7 +330,7 @@ extern int git_futils_fake_symlink(const char *new, const char *old); */ typedef struct { struct timespec mtime; - git_off_t size; + uint64_t size; unsigned int ino; } git_futils_filestamp; |