mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
Use const void * for keys and values in some hashtable functions
This commit is contained in:
@@ -114,7 +114,7 @@ relay_client_irc_parse_message (const char *message)
|
||||
weechat_prefix ("error"), RELAY_PLUGIN_NAME);
|
||||
goto end;
|
||||
}
|
||||
weechat_hashtable_set (hash_msg, "message", (char *)message);
|
||||
weechat_hashtable_set (hash_msg, "message", message);
|
||||
hash_parsed = weechat_info_get_hashtable ("irc_parse_message",
|
||||
hash_msg);
|
||||
if (!hash_parsed)
|
||||
|
||||
@@ -131,8 +131,8 @@ weechat_lua_tohashtable (lua_State *interpreter, int index, int hashtable_size)
|
||||
while (lua_next (interpreter, index - 1) != 0)
|
||||
{
|
||||
weechat_hashtable_set (hashtable,
|
||||
(char *)lua_tostring (interpreter, -2),
|
||||
(char *)lua_tostring (interpreter, -1));
|
||||
lua_tostring (interpreter, -2),
|
||||
lua_tostring (interpreter, -1));
|
||||
/* remove value from stack (keep key for next iteration) */
|
||||
lua_pop (interpreter, 1);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ weechat_python_dict_to_hashtable (PyObject *dict, int hashtable_size)
|
||||
{
|
||||
str_key = PyString_AsString (key);
|
||||
str_value = PyString_AsString (value);
|
||||
weechat_hashtable_set (hashtable, (void *)str_key, (void *)str_value);
|
||||
weechat_hashtable_set (hashtable, str_key, str_value);
|
||||
}
|
||||
|
||||
return hashtable;
|
||||
|
||||
@@ -153,8 +153,8 @@ weechat_tcl_dict_to_hashtable (Tcl_Interp *interp, Tcl_Obj *dict,
|
||||
for (; !done ; Tcl_DictObjNext(&search, &key, &value, &done))
|
||||
{
|
||||
weechat_hashtable_set (hashtable,
|
||||
(void *)Tcl_GetString (key),
|
||||
(void *)Tcl_GetString (value));
|
||||
Tcl_GetString (key),
|
||||
Tcl_GetString (value));
|
||||
}
|
||||
}
|
||||
Tcl_DictObjDone(&search);
|
||||
|
||||
@@ -45,7 +45,7 @@ struct timeval;
|
||||
*/
|
||||
|
||||
/* API version (used to check that plugin has same API and can be loaded) */
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20101011-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20101017-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -260,10 +260,10 @@ struct t_weechat_plugin
|
||||
const void *key1,
|
||||
const void *key2));
|
||||
int (*hashtable_set_with_size) (struct t_hashtable *hashtable,
|
||||
void *key, int key_size,
|
||||
void *value, int value_size);
|
||||
int (*hashtable_set) (struct t_hashtable *hashtable, void *key,
|
||||
void *value);
|
||||
const void *key, int key_size,
|
||||
const void *value, int value_size);
|
||||
int (*hashtable_set) (struct t_hashtable *hashtable, const void *key,
|
||||
const void *value);
|
||||
void *(*hashtable_get) (struct t_hashtable *hashtable, const void *key);
|
||||
int (*hashtable_has_key) (struct t_hashtable *hashtable, const void *key);
|
||||
void (*hashtable_map) (struct t_hashtable *hashtable,
|
||||
|
||||
Reference in New Issue
Block a user