X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Freckeys.c;h=01bf31747ea4f10b60bb58bf4af60d852657a681;hp=bf83a65f8db5b8ad2bdea6caa36fb214df1201eb;hb=c401b3a1421e31b3d6b77bc7bac6ffb934207df1;hpb=296574b8e825da3594047d8d63c9639d90866047 diff --git a/index/reckeys.c b/index/reckeys.c index bf83a65..01bf317 100644 --- a/index/reckeys.c +++ b/index/reckeys.c @@ -1,4 +1,4 @@ -/* $Id: reckeys.c,v 1.5 2006-05-22 13:28:00 adam Exp $ +/* $Id: reckeys.c,v 1.8 2006-10-29 17:20:01 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include @@ -58,10 +58,11 @@ struct zebra_rec_key_entry **zebra_rec_keys_mk_hash(zebra_rec_keys_t p, { unsigned h = 0; size_t i; + int j; for (i = 0; ilen; i++) - h = h * 65509 + key->mem[i]; + for (j = 0; jlen; j++) + h = h * 65509 + CAST_ZINT_TO_INT(key->mem[j]); return &p->entries[h % (unsigned) p->hash_size]; } @@ -78,7 +79,7 @@ static void init_hash(zebra_rec_keys_t p) } } -zebra_rec_keys_t zebra_rec_keys_open() +zebra_rec_keys_t zebra_rec_keys_open(void) { zebra_rec_keys_t p = xmalloc(sizeof(*p)); p->buf_used = 0;