diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-03-20 18:36:25 +0100 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-23 00:07:58 +0200 |
commit | 56d8ca266c92e51a1b38ac68b7aa6a24193f5812 (patch) | |
tree | 83e188bcb8d157cd10774ecaabe0a4a42561f5b6 /src/index.c | |
parent | fe1920206b7fb780486dcef14d0d6f01835b430d (diff) | |
download | libgit2-56d8ca266c92e51a1b38ac68b7aa6a24193f5812.tar.gz |
Switch from time_t to git_time_t
git_time_t is defined as a signed 64 integer. This allows a true predictable multiplatform behavior.
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/index.c b/src/index.c index 6a355e11b..34208731c 100644 --- a/src/index.c +++ b/src/index.c @@ -312,8 +312,8 @@ int git_index_add(git_index *index, const char *rel_path, int stage) memset(&entry, 0x0, sizeof(git_index_entry)); - entry.ctime.seconds = st.st_ctime; - entry.mtime.seconds = st.st_mtime; + entry.ctime.seconds = (git_time_t)st.st_ctime; + entry.mtime.seconds = (git_time_t)st.st_mtime; /* entry.mtime.nanoseconds = st.st_mtimensec; */ /* entry.ctime.nanoseconds = st.st_ctimensec; */ entry.dev= st.st_rdev; @@ -491,10 +491,10 @@ static size_t read_entry(git_index_entry *dest, const void *buffer, size_t buffe source = (const struct entry_short *)(buffer); - dest->ctime.seconds = (time_t)ntohl(source->ctime.seconds); - dest->ctime.nanoseconds = (time_t)ntohl(source->ctime.nanoseconds); - dest->mtime.seconds = (time_t)ntohl(source->mtime.seconds); - dest->mtime.nanoseconds = (time_t)ntohl(source->mtime.nanoseconds); + dest->ctime.seconds = (git_time_t)ntohl(source->ctime.seconds); + dest->ctime.nanoseconds = ntohl(source->ctime.nanoseconds); + dest->mtime.seconds = (git_time_t)ntohl(source->mtime.seconds); + dest->mtime.nanoseconds = ntohl(source->mtime.nanoseconds); dest->dev = ntohl(source->dev); dest->ino = ntohl(source->ino); dest->mode = ntohl(source->mode); |