Commit 6c13cf6dacf5f5f2f5ba4f28b3632f3f9df29b7c

Edward Thomson 2019-11-22T15:18:54

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.

diff --git a/src/futils.c b/src/futils.c
index c508c74..7e100a9 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 e6fd22b..f97b156 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;