Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-10 02:01:44 +0400
committerRussell Belfer <rb@github.com>2012-11-10 02:01:44 +0400
commit757b406504021b3a73e52ce9f95d590d65c7dce5 (patch)
tree8603837628030ae68b3bbc054f9bcf55eae53f43 /src/pack-objects.c
parent0f3def715dc9af442f5f025c50a041c6319df1e8 (diff)
Fix warnings and valgrind issues
This fixes some various warnings that showed up in Travis and a couple uses of uninitialized memory and one memory leak.
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r--src/pack-objects.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c
index 7acc93328..af7472aff 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -73,16 +73,16 @@ static int packbuilder_config(git_packbuilder *pb)
{
git_config *config;
int ret;
+ int64_t val;
if (git_repository_config__weakptr(&config, pb->repo) < 0)
return -1;
-#define config_get(key, dst, default) \
- ret = git_config_get_int64((int64_t *)&dst, config, key); \
- if (ret == GIT_ENOTFOUND) \
- dst = default; \
- else if (ret < 0) \
- return -1;
+#define config_get(KEY,DST,DFLT) do { \
+ ret = git_config_get_int64(&val, config, KEY); \
+ if (!ret) (DST) = val; \
+ else if (ret == GIT_ENOTFOUND) (DST) = (DFLT); \
+ else if (ret < 0) return -1; } while (0)
config_get("pack.deltaCacheSize", pb->max_delta_cache_size,
GIT_PACK_DELTA_CACHE_SIZE);