diff options
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | lib/ssl_gnutls.c | 10 | ||||
-rw-r--r-- | protocols/nogaim.c | 10 | ||||
-rw-r--r-- | root_commands.c | 4 | ||||
-rw-r--r-- | storage_xml.c | 4 |
5 files changed, 19 insertions, 11 deletions
@@ -136,7 +136,7 @@ if [ "$debug" = "1" ]; then echo 'DEBUG=1' >> Makefile.settings echo '#define DEBUG' >> config.h else - [ -z "$CFLAGS" ] && CFLAGS=-O3 + [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" fi echo CFLAGS=$CFLAGS >> Makefile.settings diff --git a/lib/ssl_gnutls.c b/lib/ssl_gnutls.c index fbd1d0c0..221a2862 100644 --- a/lib/ssl_gnutls.c +++ b/lib/ssl_gnutls.c @@ -35,6 +35,14 @@ int ssl_errno = 0; static gboolean initialized = FALSE; +#include <limits.h> + +#if defined(ULONG_MAX) && ULONG_MAX > 4294967295UL +#define GNUTLS_STUPID_CAST (long) +#else +#define GNUTLS_STUPID_CAST (int) +#endif + struct scd { ssl_input_function func; @@ -124,7 +132,7 @@ static gboolean ssl_connected( gpointer data, gint source, b_input_condition con gnutls_credentials_set( conn->session, GNUTLS_CRD_CERTIFICATE, conn->xcred ); sock_make_nonblocking( conn->fd ); - gnutls_transport_set_ptr( conn->session, (gnutls_transport_ptr) conn->fd ); + gnutls_transport_set_ptr( conn->session, (gnutls_transport_ptr) GNUTLS_STUPID_CAST conn->fd ); return ssl_handshake( data, source, cond ); } diff --git a/protocols/nogaim.c b/protocols/nogaim.c index e0f04c0b..5e698902 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -698,7 +698,7 @@ void imcb_chat_free( struct groupchat *c ) GList *ir; if( set_getbool( &ic->irc->set, "debug" ) ) - imcb_log( ic, "You were removed from conversation 0x%x", (int) c ); + imcb_log( ic, "You were removed from conversation %p", c ); if( c ) { @@ -754,7 +754,7 @@ void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, } else { - imcb_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, wrapped ); + imcb_log( ic, "Message from/to conversation %s@%p (unknown conv/user): %s", who, c, wrapped ); } g_free( wrapped ); } @@ -802,7 +802,7 @@ struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle ) c->topic = g_strdup_printf( "%s :BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->channel, c->title ); if( set_getbool( &ic->irc->set, "debug" ) ) - imcb_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle ); + imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle ); return c; } @@ -816,7 +816,7 @@ void imcb_chat_add_buddy( struct groupchat *b, char *handle ) int me = 0; if( set_getbool( &b->ic->irc->set, "debug" ) ) - imcb_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b ); + imcb_log( b->ic, "User %s added to conversation %p", handle, b ); /* It might be yourself! */ if( b->ic->acc->prpl->handle_cmp( handle, b->ic->acc->user ) == 0 ) @@ -851,7 +851,7 @@ void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason ) int me = 0; if( set_getbool( &b->ic->irc->set, "debug" ) ) - imcb_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" ); + imcb_log( b->ic, "User %s removed from conversation %p (%s)", handle, b, reason ? reason : "" ); /* It might be yourself! */ if( g_strcasecmp( handle, b->ic->acc->user ) == 0 ) diff --git a/root_commands.c b/root_commands.c index e9c71f04..642f5374 100644 --- a/root_commands.c +++ b/root_commands.c @@ -744,7 +744,7 @@ static void cmd_yesno( irc_t *irc, char **cmd ) static void cmd_set( irc_t *irc, char **cmd ) { - char *set_name; + char *set_name = NULL; if( cmd[1] && cmd[2] ) { @@ -764,7 +764,7 @@ static void cmd_set( irc_t *irc, char **cmd ) set_name = cmd[1]; } } - if( cmd[1] ) /* else 'forgotten' on purpose.. Must show new value after changing */ + if( set_name ) /* else 'forgotten' on purpose.. Must show new value after changing */ { char *s = set_getstr( &irc->set, set_name ); if( s ) diff --git a/storage_xml.c b/storage_xml.c index 8618c5fe..4c372cde 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -455,7 +455,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite ) errors, so instead let's use the _find function and return TRUE on write errors. Which means, if we found something, there was an error. :-) */ - if( g_hash_table_find( acc->nicks, xml_save_nick, (gpointer) fd ) ) + if( g_hash_table_find( acc->nicks, xml_save_nick, & fd ) ) goto write_error; if( !xml_printf( fd, 1, "</account>\n" ) ) @@ -493,7 +493,7 @@ write_error: static gboolean xml_save_nick( gpointer key, gpointer value, gpointer data ) { - return !xml_printf( (int) data, 2, "<buddy handle=\"%s\" nick=\"%s\" />\n", key, value ); + return !xml_printf( *( (int*) data ), 2, "<buddy handle=\"%s\" nick=\"%s\" />\n", key, value ); } static storage_status_t xml_remove( const char *nick, const char *password ) |