Skip to content

Commit

Permalink
use ptrdiff_t
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Nov 6, 2017
1 parent 1fc5edb commit 08661a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libasn1common/genhash.c
Expand Up @@ -58,6 +58,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stddef.h>
#include <errno.h>
#include "genhash.h"

Expand Down Expand Up @@ -767,7 +768,7 @@ genhash_empty(genhash_t *h, int freekeys, int freevalues) {

unsigned int
hashf_int (const void *key) {
return (*(const int *)key ^ (*(const int *)key >> 16));
return (*(const ptrdiff_t *)key ^ (*(const ptrdiff_t *)key >> 16));
}

int
Expand All @@ -777,7 +778,7 @@ cmpf_int (const void *key1, const void *key2) {

unsigned int
hashf_void (const void *key) {
return ((int)key ^ ((int)key >> 16));
return ((ptrdiff_t)key ^ ((ptrdiff_t)key >> 16));
}

int
Expand Down

0 comments on commit 08661a6

Please sign in to comment.