8000 filestamp: use `uint64_t` for object size · libgit2/libgit2@6c13cf6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c13cf6

Browse files
committed
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.
1 parent fefefd1 commit 6c13cf6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/futils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,15 +1110,15 @@ int git_futils_filestamp_check(
11101110
#if defined(GIT_USE_NSEC)
11111111
stamp->mtime.tv_nsec == st.st_mtime_nsec &&
11121112
#endif
1113-
stamp->size == (git_off_t)st.st_size &&
1113+
stamp->size == (uint64_t)st.st_size &&
11141114
stamp->ino == (unsigned int)st.st_ino)
11151115
return 0;
11161116

11171117
stamp->mtime.tv_sec = st.st_mtime;
11181118
#if defined(GIT_USE_NSEC)
11191119
stamp->mtime.tv_nsec = st.st_mtime_nsec;
11201120
#endif
1121-
stamp->size = (git_off_t)st.st_size;
1121+
stamp->size = (uint64_t)st.st_size;
11221122
stamp->ino = (unsigned int)st.st_ino;
11231123

11241124
return 1;
@@ -1146,7 +1146,7 @@ void git_futils_filestamp_set_from_stat(
11461146
#else
11471147
stamp->mtime.tv_nsec = 0;
11481148
#endif
1149-
stamp->size = (git_off_t)st->st_size;
1149+
stamp->size = (uint64_t)st->st_size;
11501150
stamp->ino = (unsigned int)st->st_ino;
11511151
} else {
11521152
memset(stamp, 0, sizeof(*stamp));

src/futils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ extern int git_futils_fake_symlink(const char *new, const char *old);
330330
*/
331331
typedef struct {
332332
struct timespec mtime;
333-
git_off_t size;
333+
uint64_t size;
334334
unsigned int ino;
335335
} git_futils_filestamp;
336336

0 commit comments

Comments
 (0)
0