Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Fix hash function in xdiff library
  • Loading branch information
Junio C Hamano committed Oct 17, 2006
2 parents b32db4d + 9de0834 commit 3453f86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xdiff/xmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
#define XMACROS_H


#define GR_PRIME 0x9e370001UL


#define XDL_MIN(a, b) ((a) < (b) ? (a): (b))
#define XDL_MAX(a, b) ((a) > (b) ? (a): (b))
#define XDL_ABS(v) ((v) >= 0 ? (v): -(v))
#define XDL_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
#define XDL_HASHLONG(v, b) (((unsigned long)(v) * GR_PRIME) >> ((CHAR_BIT * sizeof(unsigned long)) - (b)))
#define XDL_ADDBITS(v,b) ((v) + ((v) >> (b)))
#define XDL_MASKBITS(b) ((1UL << (b)) - 1)
#define XDL_HASHLONG(v,b) (XDL_ADDBITS((unsigned long)(v), b) & XDL_MASKBITS(b))
#define XDL_PTRFREE(p) do { if (p) { xdl_free(p); (p) = NULL; } } while (0)
#define XDL_LE32_PUT(p, v) \
do { \
Expand Down

0 comments on commit 3453f86

Please sign in to comment.