]> granicus.if.org Git - git/commitdiff
Merge branch 'mk/use-size-t-in-zlib' into pu
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Oct 2019 06:10:16 +0000 (15:10 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Oct 2019 06:10:16 +0000 (15:10 +0900)
The wrapper to call into zlib followed our long tradition to use
"unsigned long" for sizes of regions in memory, which have been
updated to use "size_t".

* mk/use-size-t-in-zlib:
  zlib.c: use size_t for size

1  2 
builtin/pack-objects.c
cache.h
pack-check.c
packfile.c
packfile.h

index f710f8dde384eec0e1e56d3fbe5d27fd7ab67278,89fe1c5d460efe1a6f1df76d79c48678020fecb4..6004d9c4d2697fe5d941c566306e9ca5fccb00ad
@@@ -2115,10 -1966,11 +2115,11 @@@ unsigned long oe_get_size_slow(struct p
        struct pack_window *w_curs;
        unsigned char *buf;
        enum object_type type;
-       unsigned long used, avail, size;
+       unsigned long used, size;
+       size_t avail;
  
        if (e->type_ != OBJ_OFS_DELTA && e->type_ != OBJ_REF_DELTA) {
 -              read_lock();
 +              packing_data_lock(&to_pack);
                if (oid_object_info(the_repository, &e->idx.oid, &size) < 0)
                        die(_("unable to get size of %s"),
                            oid_to_hex(&e->idx.oid));
diff --cc cache.h
index d3c89e7a53e85d044b903b81b73e56eb0cb7a03e,fce53fe620cc7cae7d9fb047ba77f2cf61d530a9..8870d8f0ceb5de53df64339a15aef0efe647c4e7
+++ b/cache.h
@@@ -41,8 -40,22 +41,8 @@@ void git_deflate_end(git_zstream *)
  int git_deflate_abort(git_zstream *);
  int git_deflate_end_gently(git_zstream *);
  int git_deflate(git_zstream *, int flush);
unsigned long git_deflate_bound(git_zstream *, unsigned long);
size_t git_deflate_bound(git_zstream *, size_t);
  
 -/* The length in bytes and in hex digits of an object name (SHA-1 value). */
 -#define GIT_SHA1_RAWSZ 20
 -#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
 -
 -/* The length in byte and in hex digits of the largest possible hash value. */
 -#define GIT_MAX_RAWSZ GIT_SHA1_RAWSZ
 -#define GIT_MAX_HEXSZ GIT_SHA1_HEXSZ
 -
 -struct object_id {
 -      unsigned char hash[GIT_MAX_RAWSZ];
 -};
 -
 -#define the_hash_algo the_repository->hash_algo
 -
  #if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
  #define DTYPE(de)     ((de)->d_type)
  #else
diff --cc pack-check.c
Simple merge
diff --cc packfile.c
Simple merge
diff --cc packfile.h
index ec536a4ae51fc94db9c4c94397bd9177ff34c1c2,e2daf6342654c3284d2ad8b14823d940272ebd7d..0866a464c0e3b504f608f874eb1b9c2bd0ab5e6f
@@@ -81,26 -74,17 +81,26 @@@ int open_pack_index(struct packed_git *
   * munmap the index file for the specified packfile (if it is
   * currently mmapped).
   */
 -extern void close_pack_index(struct packed_git *);
 +void close_pack_index(struct packed_git *);
  
 -extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
 +int close_pack_fd(struct packed_git *p);
  
 -extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, size_t *);
 -extern void close_pack_windows(struct packed_git *);
 -extern void close_pack(struct packed_git *);
 -extern void close_all_packs(struct raw_object_store *o);
 -extern void unuse_pack(struct pack_window **);
 -extern void clear_delta_base_cache(void);
 -extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
 +uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
 +
- unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
++unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, size_t *);
 +void close_pack_windows(struct packed_git *);
 +void close_pack(struct packed_git *);
 +void close_object_store(struct raw_object_store *o);
 +void unuse_pack(struct pack_window **);
 +void clear_delta_base_cache(void);
 +struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
 +
 +/*
 + * Unlink the .pack and associated extension files.
 + * Does not unlink if 'force_delete' is false and the pack-file is
 + * marked as ".keep".
 + */
 +void unlink_pack_path(const char *pack_name, int force_delete);
  
  /*
   * Make sure that a pointer access into an mmap'd index file is within bounds,