summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-17 23:32:22 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-17 23:32:22 +0200
commit084c193562029e0671e208172d62f673dfd3a6f3 (patch)
tree443d9660cf401464257946a7824fefab5c5a26e0 /src/index.c
parent348c7335dd804ea12eabac7106c5f9675a421ba0 (diff)
downloadlibgit2-084c193562029e0671e208172d62f673dfd3a6f3.tar.gz
Fix type truncation in index entries
64-bit types stored in memory have to be truncated into 32 bits when writing to disk. Was causing warnings in MSVC. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/index.c b/src/index.c
index 2d56cb956..e4271ef1e 100644
--- a/src/index.c
+++ b/src/index.c
@@ -701,8 +701,8 @@ static void *create_disk_entry(size_t *disk_size, git_index_entry *entry)
if (ondisk == NULL)
return NULL;
- ondisk->ctime.seconds = htonl(entry->ctime.seconds);
- ondisk->mtime.seconds = htonl(entry->mtime.seconds);
+ ondisk->ctime.seconds = htonl((unsigned long)entry->ctime.seconds);
+ ondisk->mtime.seconds = htonl((unsigned long)entry->mtime.seconds);
ondisk->ctime.nanoseconds = htonl(entry->ctime.nanoseconds);
ondisk->mtime.nanoseconds = htonl(entry->mtime.nanoseconds);
ondisk->dev = htonl(entry->dev);
@@ -710,7 +710,7 @@ static void *create_disk_entry(size_t *disk_size, git_index_entry *entry)
ondisk->mode = htonl(entry->mode);
ondisk->uid = htonl(entry->uid);
ondisk->gid = htonl(entry->gid);
- ondisk->file_size = htonl(entry->file_size);
+ ondisk->file_size = htonl((unsigned long)entry->file_size);
git_oid_cpy(&ondisk->oid, &entry->oid);