summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-12-10 18:57:43 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-12-10 18:57:43 +0100
commit638b86f0b67a482e250144a3ef66fe40f6e90f8d (patch)
treecc7bbc8341817b3fc787a00afe422e4f38ac2579 /src
parent452a06da96c0b92ed7c6361a1350ffc7a8d33f2f (diff)
downloadweechat-638b86f0b67a482e250144a3ef66fe40f6e90f8d.zip
Fix compilation warning "dereferencing type-punned pointer will break strict-aliasing rules"
Diffstat (limited to 'src')
-rw-r--r--src/plugins/aspell/weechat-aspell.c4
-rw-r--r--src/plugins/irc/irc-server.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c
index 0b8558c73..7b15a4309 100644
--- a/src/plugins/aspell/weechat-aspell.c
+++ b/src/plugins/aspell/weechat-aspell.c
@@ -714,6 +714,7 @@ char *
weechat_aspell_modifier_cb (void *data, const char *modifier,
const char *modifier_data, const char *string)
{
+ long unsigned int value;
struct t_gui_buffer *buffer;
char *result, *ptr_string, *pos_space;
const char *color_normal, *color_error;
@@ -727,7 +728,8 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
if (!string || !string[0])
return NULL;
- sscanf (modifier_data, "%lx", (long unsigned int *)&buffer);
+ sscanf (modifier_data, "%lx", &value);
+ buffer = (struct t_gui_buffer *)value;
if (!weechat_aspell_spellers)
return NULL;
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 18bc20224..e87b4685b 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -2762,6 +2762,7 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
{
struct t_infolist *infolist;
struct t_irc_server *server, *ptr_server;
+ long unsigned int value;
const char *plugin_name, *plugin_id, *type, *filename;
int spaces_in_name;
@@ -2778,7 +2779,8 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
plugin_id = weechat_infolist_string (infolist, "plugin_id");
if (plugin_name && (strcmp (plugin_name, IRC_PLUGIN_NAME) == 0) && plugin_id)
{
- sscanf (plugin_id, "%lx", (long unsigned int *)&server);
+ sscanf (plugin_id, "%lx", &value);
+ server = (struct t_irc_server *)value;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
@@ -2835,6 +2837,7 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
{
struct t_infolist *infolist;
struct t_irc_server *server, *ptr_server;
+ long unsigned int value;
const char *plugin_name, *plugin_id, *filename;
int spaces_in_name;
@@ -2851,7 +2854,8 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
plugin_id = weechat_infolist_string (infolist, "plugin_id");
if (plugin_name && (strcmp (plugin_name, IRC_PLUGIN_NAME) == 0) && plugin_id)
{
- sscanf (plugin_id, "%lx", (long unsigned int *)&server);
+ sscanf (plugin_id, "%lx", &value);
+ server = (struct t_irc_server *)value;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
@@ -2892,6 +2896,7 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
{
struct t_infolist *infolist;
struct t_irc_server *server, *ptr_server;
+ long unsigned int value;
const char *plugin_name, *plugin_id, *filename;
int spaces_in_name;
@@ -2908,7 +2913,8 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
plugin_id = weechat_infolist_string (infolist, "plugin_id");
if (plugin_name && (strcmp (plugin_name, IRC_PLUGIN_NAME) == 0) && plugin_id)
{
- sscanf (plugin_id, "%lx", (long unsigned int *)&server);
+ sscanf (plugin_id, "%lx", &value);
+ server = (struct t_irc_server *)value;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{