X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff-delta.c;h=9f998d0a73e0127d3a68a7caecb3727569149871;hb=7da3bf372cfcd25ea44164afb90c306836b62e23;hp=7da9205a5da6a4f016bc6b556bee01895cdcc19d;hpb=e40e0135f24a140935c218af43d0bf8b7b07067b;p=git.git diff --git a/diff-delta.c b/diff-delta.c index 7da9205a5..9f998d0a7 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -18,11 +18,8 @@ * licensing gets turned into GPLv2 within this project. */ -#include -#include -#include "delta.h" - #include "git-compat-util.h" +#include "delta.h" /* maximum hash entry list for the same hash bucket */ #define HASH_LIMIT 64 @@ -152,7 +149,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize) initialization in create_delta(). */ entries = (bufsize - 1) / RABIN_WINDOW; hsize = entries / 4; - for (i = 4; (1 << i) < hsize && i < 31; i++); + for (i = 4; (1u << i) < hsize && i < 31; i++); hsize = 1 << i; hmask = hsize - 1; @@ -392,7 +389,7 @@ create_delta(const struct delta_index *index, outsize = max_size + MAX_OP_SIZE + 1; if (max_size && outpos > max_size) break; - out = realloc(out, outsize); + out = xrealloc(out, outsize); if (!out) { free(tmp); return NULL;