--- cvsroot/liblzf/lzf_c.c 2002/06/09 22:41:34 1.1 +++ cvsroot/liblzf/lzf_c.c 2002/11/17 11:39:26 1.3 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Marc Alexander Lehmann + * Copyright (c) 2000-2002 Marc Alexander Lehmann * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: @@ -38,7 +38,7 @@ */ #define FRST(p) (((p[0]) << 8) + p[1]) #define NEXT(v,p) (((v) << 8) + p[2]) -#define IDX(h) ((((h ^ (h << 4)) >> (3*8 - HLOG)) + h*3) & (HSIZE - 1)) +#define IDX(h) ((((h ^ (h << 5)) >> (3*8 - HLOG)) + h*3) & (HSIZE - 1)) /* * IDX works because it is very similar to a multiplicative hash, e.g. * (h * 57321 >> (3*8 - HLOG)) @@ -49,8 +49,8 @@ #if 0 /* original lzv-like hash function */ # define FRST(p) (p[0] << 5) ^ p[1] -# define NEXT(v,p) (v << 5) ^ p[2] -# define IDX(h) (h) & (HSIZE - 1) +# define NEXT(v,p) ((v) << 5) ^ p[2] +# define IDX(h) ((h) & (HSIZE - 1)) #endif #define MAX_LIT (1 << 5)