Commit 6c13cf6d by Edward Thomson

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.
parent fefefd1d
...@@ -1110,7 +1110,7 @@ int git_futils_filestamp_check( ...@@ -1110,7 +1110,7 @@ int git_futils_filestamp_check(
#if defined(GIT_USE_NSEC) #if defined(GIT_USE_NSEC)
stamp->mtime.tv_nsec == st.st_mtime_nsec && stamp->mtime.tv_nsec == st.st_mtime_nsec &&
#endif #endif
stamp->size == (git_off_t)st.st_size && stamp->size == (uint64_t)st.st_size &&
stamp->ino == (unsigned int)st.st_ino) stamp->ino == (unsigned int)st.st_ino)
return 0; return 0;
...@@ -1118,7 +1118,7 @@ int git_futils_filestamp_check( ...@@ -1118,7 +1118,7 @@ int git_futils_filestamp_check(
#if defined(GIT_USE_NSEC) #if defined(GIT_USE_NSEC)
stamp->mtime.tv_nsec = st.st_mtime_nsec; stamp->mtime.tv_nsec = st.st_mtime_nsec;
#endif #endif
stamp->size = (git_off_t)st.st_size; stamp->size = (uint64_t)st.st_size;
stamp->ino = (unsigned int)st.st_ino; stamp->ino = (unsigned int)st.st_ino;
return 1; return 1;
...@@ -1146,7 +1146,7 @@ void git_futils_filestamp_set_from_stat( ...@@ -1146,7 +1146,7 @@ void git_futils_filestamp_set_from_stat(
#else #else
stamp->mtime.tv_nsec = 0; stamp->mtime.tv_nsec = 0;
#endif #endif
stamp->size = (git_off_t)st->st_size; stamp->size = (uint64_t)st->st_size;
stamp->ino = (unsigned int)st->st_ino; stamp->ino = (unsigned int)st->st_ino;
} else { } else {
memset(stamp, 0, sizeof(*stamp)); memset(stamp, 0, sizeof(*stamp));
......
...@@ -330,7 +330,7 @@ extern int git_futils_fake_symlink(const char *new, const char *old); ...@@ -330,7 +330,7 @@ extern int git_futils_fake_symlink(const char *new, const char *old);
*/ */
typedef struct { typedef struct {
struct timespec mtime; struct timespec mtime;
git_off_t size; uint64_t size;
unsigned int ino; unsigned int ino;
} git_futils_filestamp; } git_futils_filestamp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment