]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff-delta.c
Merge commit 'jc/maint' into gfi-maint
[thirdparty/git.git] / diff-delta.c
index 7da9205a5da6a4f016bc6b556bee01895cdcc19d..9f998d0a73e0127d3a68a7caecb3727569149871 100644 (file)
  *  licensing gets turned into GPLv2 within this project.
  */
 
-#include <stdlib.h>
-#include <string.h>
-#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;