]> git.proxmox.com Git - libgit2.git/commitdiff
pack: `__object_header` always returns unsigned values
authorVicent Marti <tanoku@gmail.com>
Fri, 1 Nov 2013 15:31:02 +0000 (16:31 +0100)
committerVicent Marti <tanoku@gmail.com>
Fri, 1 Nov 2013 16:36:09 +0000 (17:36 +0100)
src/indexer.c
src/pack.c
src/pack.h

index 64a9074a1e94b7bdc0b3b6857486842238d6318b..3b4dffabe5e816b4fdf86a799cb18ce37a359c3e 100644 (file)
@@ -632,8 +632,7 @@ static int inject_object(git_indexer_stream *idx, git_oid *id)
        git_buf buf = GIT_BUF_INIT;
        git_off_t entry_start;
        const void *data;
-       size_t len;
-       int hdr_len;
+       size_t len, hdr_len;
        int error;
 
        entry = git__calloc(1, sizeof(*entry));
index 51fbc4e9dad2d7aefecbb2ce054c81928e2d7f6e..644b2d465b8f4f048c5b2c539f44ad541850ba49 100644 (file)
@@ -372,7 +372,7 @@ static unsigned char *pack_window_open(
  *  - each byte afterwards: low seven bits are size continuation,
  *    with the high bit being "size continues"
  */
-int git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type)
+size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type)
 {
        unsigned char *hdr_base;
        unsigned char c;
@@ -392,7 +392,7 @@ int git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type)
        }
        *hdr++ = c;
 
-       return (int)(hdr - hdr_base);
+       return (hdr - hdr_base);
 }
 
 
index baad361f8a8b1a0078160b91139e18065393a4e6..28146ab30dcd826334a4ec13807fedfc2ddd75fc 100644 (file)
@@ -112,7 +112,7 @@ typedef struct git_packfile_stream {
        git_mwindow *mw;
 } git_packfile_stream;
 
-int git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type);
+size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type);
 
 int git_packfile_unpack_header(
                size_t *size_p,