From: tomo Date: Fri, 14 Apr 2006 16:39:44 +0000 (+0000) Subject: (concord_name_table_put): Use instead of for X-Git-Tag: libconcord-0_0_0~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d74df18bfc19daa897225522e9c5d89b2be849ee;p=chise%2Fconcord.git (concord_name_table_put): Use instead of for key. (concord_name_table_get): Likewise. --- diff --git a/concord-name.h b/concord-name.h index c2eeeaa..8b0f68b 100644 --- a/concord-name.h +++ b/concord-name.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003,2005 MORIOKA Tomohiko +/* Copyright (C) 2003,2005,2006 MORIOKA Tomohiko This file is part of the CONCORD Library. The CONCORD Library is free software; you can redistribute it and/or @@ -28,9 +28,8 @@ typedef CONCORD_HASH_TABLE_ENTRY CONCORD_NAME_TABLE_ENTRY; CONCORD_NAME_TABLE* concord_make_name_table (void); void concord_destroy_name_table (CONCORD_NAME_TABLE* table); int concord_name_table_put (CONCORD_NAME_TABLE* table, - const unsigned char *key, void *value); -void* -concord_name_table_get (CONCORD_NAME_TABLE* table, const unsigned char *key); + const char *key, void *value); +void* concord_name_table_get (CONCORD_NAME_TABLE* table, const char *key); int concord_name_table_grow (CONCORD_NAME_TABLE* table); #endif /* !_CONCORD_NAME_H */ diff --git a/name.c b/name.c index 517c6b2..41ca2ec 100644 --- a/name.c +++ b/name.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003,2004,2005 MORIOKA Tomohiko +/* Copyright (C) 2003,2004,2005,2006 MORIOKA Tomohiko This file is part of the CONCORD Library. The CONCORD Library is free software; you can redistribute it and/or @@ -114,7 +114,7 @@ concord_destroy_name_table (CONCORD_NAME_TABLE* table) int concord_name_table_put (CONCORD_NAME_TABLE* table, - const unsigned char *key, void *value) + const char *key, void *value) { int i, index; CONCORD_NAME_TABLE_ENTRY* entry; @@ -122,7 +122,7 @@ concord_name_table_put (CONCORD_NAME_TABLE* table, if (table == NULL) return -1; - index = concord_hash_c_string (key) % table->size; + index = concord_hash_c_string ((unsigned char*)key) % table->size; for (i = index; i < table->size; i++) { entry = &table->data[i]; @@ -149,8 +149,7 @@ concord_name_table_put (CONCORD_NAME_TABLE* table, } void * -concord_name_table_get (CONCORD_NAME_TABLE* table, - const unsigned char *key) +concord_name_table_get (CONCORD_NAME_TABLE* table, const char *key) { int i, index; CONCORD_NAME_TABLE_ENTRY entry; @@ -158,7 +157,7 @@ concord_name_table_get (CONCORD_NAME_TABLE* table, if (table == NULL) return NULL; - index = concord_hash_c_string (key) % table->size; + index = concord_hash_c_string ((unsigned char*)key) % table->size; for (i = index; i < table->size; i++) { entry = table->data[i];