diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-hashtable.c | 24 | ||||
-rw-r--r-- | src/core/wee-hashtable.h | 10 | ||||
-rw-r--r-- | src/core/wee-string.c | 2 | ||||
-rw-r--r-- | src/plugins/weechat-plugin.h | 6 |
4 files changed, 21 insertions, 21 deletions
diff --git a/src/core/wee-hashtable.c b/src/core/wee-hashtable.c index e77d4c624..9ec9546b7 100644 --- a/src/core/wee-hashtable.c +++ b/src/core/wee-hashtable.c @@ -72,10 +72,10 @@ hashtable_get_type (const char *type) * Returns the hash of the string. */ -unsigned long +unsigned long long hashtable_hash_key_djb2 (const char *string) { - unsigned long hash; + unsigned long long hash; const char *ptr_string; hash = 5381; @@ -93,28 +93,28 @@ hashtable_hash_key_djb2 (const char *string) * Returns the hash of the key, depending on the type. */ -unsigned long +unsigned long long hashtable_hash_key_default_cb (struct t_hashtable *hashtable, const void *key) { - unsigned long hash; + unsigned long long hash; hash = 0; switch (hashtable->type_keys) { case HASHTABLE_INTEGER: - hash = (unsigned long)(*((int *)key)); + hash = (unsigned long long)(*((int *)key)); break; case HASHTABLE_STRING: hash = hashtable_hash_key_djb2 ((const char *)key); break; case HASHTABLE_POINTER: - hash = (unsigned long)((void *)key); + hash = (unsigned long long)((unsigned long)((void *)key)); break; case HASHTABLE_BUFFER: break; case HASHTABLE_TIME: - hash = (unsigned long)(*((time_t *)key)); + hash = (unsigned long long)(*((time_t *)key)); break; case HASHTABLE_NUM_TYPES: break; @@ -375,7 +375,7 @@ hashtable_set_with_size (struct t_hashtable *hashtable, const void *key, int key_size, const void *value, int value_size) { - unsigned long hash; + unsigned long long hash; struct t_hashtable_item *ptr_item, *pos_item, *new_item; if (!hashtable || !key @@ -469,9 +469,9 @@ hashtable_set (struct t_hashtable *hashtable, struct t_hashtable_item * hashtable_get_item (struct t_hashtable *hashtable, const void *key, - unsigned long *hash) + unsigned long long *hash) { - unsigned long key_hash; + unsigned long long key_hash; struct t_hashtable_item *ptr_item; if (!hashtable || !key) @@ -1109,7 +1109,7 @@ hashtable_add_to_infolist (struct t_hashtable *hashtable, void hashtable_remove_item (struct t_hashtable *hashtable, struct t_hashtable_item *item, - unsigned long hash) + unsigned long long hash) { if (!hashtable || !item) return; @@ -1139,7 +1139,7 @@ void hashtable_remove (struct t_hashtable *hashtable, const void *key) { struct t_hashtable_item *ptr_item; - unsigned long hash; + unsigned long long hash; if (!hashtable || !key) return; diff --git a/src/core/wee-hashtable.h b/src/core/wee-hashtable.h index 0473f796f..20f6ec05b 100644 --- a/src/core/wee-hashtable.h +++ b/src/core/wee-hashtable.h @@ -23,8 +23,8 @@ struct t_hashtable; struct t_infolist_item; -typedef unsigned long (t_hashtable_hash_key)(struct t_hashtable *hashtable, - const void *key); +typedef unsigned long long (t_hashtable_hash_key)(struct t_hashtable *hashtable, + const void *key); typedef int (t_hashtable_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2); typedef void (t_hashtable_free_key)(struct t_hashtable *hashtable, @@ -40,7 +40,7 @@ typedef void (t_hashtable_map_string)(void *data, /* * Hashtable is a structure with an array "htable", each entry is a pointer - * to a linked list, and it is read with hashed key (as unsigned long). + * to a linked list, and it is read with hashed key (as unsigned long long). * Keys with same hashed key are grouped in a linked list pointed by htable. * The htable is not sorted, the linked list is sorted. * @@ -112,7 +112,7 @@ struct t_hashtable /* never asked) */ }; -extern unsigned long hashtable_hash_key_djb2 (const char *string); +extern unsigned long long hashtable_hash_key_djb2 (const char *string); extern struct t_hashtable *hashtable_new (int size, const char *type_keys, const char *type_values, @@ -128,7 +128,7 @@ extern struct t_hashtable_item *hashtable_set (struct t_hashtable *hashtable, const void *value); extern struct t_hashtable_item *hashtable_get_item (struct t_hashtable *hashtable, const void *key, - unsigned long *hash); + unsigned long long *hash); extern void *hashtable_get (struct t_hashtable *hashtable, const void *key); extern int hashtable_has_key (struct t_hashtable *hashtable, const void *key); extern void hashtable_map (struct t_hashtable *hashtable, diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 8a2c643d1..79e757db9 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -2779,7 +2779,7 @@ string_replace_with_callback (const char *string, * Returns the hash of the shared string (variant of djb2). */ -unsigned long +unsigned long long string_shared_hash_key (struct t_hashtable *hashtable, const void *key) { diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index f37dd76c4..ad619e9c2 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -57,7 +57,7 @@ struct timeval; * please change the date with current one; for a second change at same * date, increment the 01, otherwise please keep 01. */ -#define WEECHAT_PLUGIN_API_VERSION "20140610-01" +#define WEECHAT_PLUGIN_API_VERSION "20140802-01" /* macros for defining plugin infos */ #define WEECHAT_PLUGIN_NAME(__name) \ @@ -339,8 +339,8 @@ struct t_weechat_plugin struct t_hashtable *(*hashtable_new) (int size, const char *type_keys, const char *type_values, - unsigned long (*callback_hash_key)(struct t_hashtable *hashtable, - const void *key), + unsigned long long (*callback_hash_key)(struct t_hashtable *hashtable, + const void *key), int (*callback_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2)); |