summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-17 10:39:51 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-17 10:39:51 +0200
commitebf94445b9a49318122392d7fc7b098027706d97 (patch)
tree325f5a9a56fb4607b0531a3501195059b5736c97 /src/plugins
parenteff0f9abdb53b0c0e1c2060a6f9598c51347e1bb (diff)
downloadweechat-ebf94445b9a49318122392d7fc7b098027706d97.zip
Use const void * for keys and values in some hashtable functions
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/relay/relay-client-irc.c2
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c4
-rw-r--r--src/plugins/scripts/python/weechat-python.c2
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl.c4
-rw-r--r--src/plugins/weechat-plugin.h10
5 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/relay/relay-client-irc.c b/src/plugins/relay/relay-client-irc.c
index 1e7404180..e0ae75210 100644
--- a/src/plugins/relay/relay-client-irc.c
+++ b/src/plugins/relay/relay-client-irc.c
@@ -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)
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 3486239d4..f22fa9389 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -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);
}
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index fb8d46779..dadf38fb7 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -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;
diff --git a/src/plugins/scripts/tcl/weechat-tcl.c b/src/plugins/scripts/tcl/weechat-tcl.c
index 9dfd05a0e..27a3190d1 100644
--- a/src/plugins/scripts/tcl/weechat-tcl.c
+++ b/src/plugins/scripts/tcl/weechat-tcl.c
@@ -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);
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 6b340f677..d8a080000 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -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,