diff options
Diffstat (limited to 'src/hashsig.c')
| -rw-r--r-- | src/hashsig.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/hashsig.c b/src/hashsig.c index 60649fd11..e9c5164a4 100644 --- a/src/hashsig.c +++ b/src/hashsig.c @@ -19,7 +19,7 @@ typedef uint64_t hashsig_state; #define HASHSIG_HEAP_SIZE ((1 << 7) - 1) -typedef int (*hashsig_cmp)(const void *a, const void *b); +typedef int (GIT_STDLIB_CALL *hashsig_cmp)(const void *a, const void *b); typedef struct { int size, asize; @@ -53,13 +53,13 @@ static void hashsig_heap_init(hashsig_heap *h, hashsig_cmp cmp) h->cmp = cmp; } -static int hashsig_cmp_max(const void *a, const void *b) +static int GIT_STDLIB_CALL hashsig_cmp_max(const void *a, const void *b) { hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b; return (av < bv) ? -1 : (av > bv) ? 1 : 0; } -static int hashsig_cmp_min(const void *a, const void *b) +static int GIT_STDLIB_CALL hashsig_cmp_min(const void *a, const void *b) { hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b; return (av > bv) ? -1 : (av < bv) ? 1 : 0; @@ -183,8 +183,8 @@ static void hashsig_initial_window( /* insert initial hash if we just finished */ if (win_len == HASHSIG_HASH_WINDOW) { - hashsig_heap_insert(&sig->mins, state); - hashsig_heap_insert(&sig->maxs, state); + hashsig_heap_insert(&sig->mins, (hashsig_t)state); + hashsig_heap_insert(&sig->maxs, (hashsig_t)state); sig->considered = 1; } @@ -224,8 +224,8 @@ static int hashsig_add_hashes( state = (state * HASHSIG_HASH_SHIFT) & HASHSIG_HASH_MASK; state = (state + ch) & HASHSIG_HASH_MASK; - hashsig_heap_insert(&sig->mins, state); - hashsig_heap_insert(&sig->maxs, state); + hashsig_heap_insert(&sig->mins, (hashsig_t)state); + hashsig_heap_insert(&sig->maxs, (hashsig_t)state); sig->considered++; prog->window[prog->win_pos] = ch; @@ -307,7 +307,7 @@ int git_hashsig_create_fromfile( while (!error) { if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) { - if ((error = buflen) < 0) + if ((error = (int)buflen) < 0) giterr_set(GITERR_OS, "Read error on '%s' calculating similarity hashes", path); break; |
