Index: protocols/Makefile
===================================================================
--- protocols/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -25,5 +25,4 @@
 # Expansion of variables
 subdirobjs := $(join $(subdirs),$(addprefix /,$(subdirobjs)))
-CFLAGS += -Wall
 LFLAGS += -r
 
Index: protocols/jabber/Makefile
===================================================================
--- protocols/jabber/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/jabber/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -15,5 +15,4 @@
 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o s5bytestream.o sasl.o si.o
 
-CFLAGS += -Wall
 LFLAGS += -r
 
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/jabber/jabber.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -381,5 +381,5 @@
 		if( bud->away_state )
 			imcb_log( ic, "Away state: %s", bud->away_state->full_name );
-		imcb_log( ic, "Status message: %s", bud->away_message ? : "(none)" );
+		imcb_log( ic, "Status message: %s", bud->away_message ? bud->away_message : "(none)" );
 		
 		bud = bud->next;
@@ -395,6 +395,8 @@
 	/* state_txt == NULL -> Not away.
 	   Unknown state -> fall back to the first defined away state. */
-	jd->away_state = state_txt ? jabber_away_state_by_name( state_txt )
-	                 ? : jabber_away_state_list : NULL;
+	if( state_txt == NULL )
+		jd->away_state = NULL;
+	else if( ( jd->away_state = jabber_away_state_by_name( state_txt ) ) == NULL )
+		jd->away_state = jabber_away_state_list;
 	
 	g_free( jd->away_message );
Index: protocols/jabber/message.c
===================================================================
--- protocols/jabber/message.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/jabber/message.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -59,5 +59,6 @@
 			{
 				room = from;
-				from = xt_find_attr( inv, "from" ) ? : from;
+				if( ( from = xt_find_attr( inv, "from" ) ) == NULL )
+					from = room;
 
 				g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Invitation to chatroom %s >>\n", room );
@@ -72,5 +73,5 @@
 			{
 				bud->last_msg = time( NULL );
-				from = bud->ext_jid ? : bud->bare_jid;
+				from = bud->ext_jid ? bud->ext_jid : bud->bare_jid;
 			}
 			else
Index: protocols/msn/Makefile
===================================================================
--- protocols/msn/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/msn/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -15,5 +15,4 @@
 objects = msn.o msn_util.o ns.o passport.o sb.o tables.o
 
-CFLAGS += -Wall
 LFLAGS += -r
 
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/msn/msn.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -176,9 +176,8 @@
 	struct msn_data *md = ic->proto_data;
 	
-	if( state )
-		md->away_state = msn_away_state_by_name( state ) ? :
-		                 msn_away_state_list + 1;
-	else
+	if( state == NULL )
 		md->away_state = msn_away_state_list;
+	else if( ( md->away_state = msn_away_state_by_name( state ) ) == NULL )
+		md->away_state = msn_away_state_list + 1;
 	
 	g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/nogaim.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -468,5 +468,5 @@
 	
 	s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.",
-	                     handle, realname_ ?: "" );
+	                     handle, realname_ ? realname_ : "" );
 	
 	g_free( realname_ );
@@ -491,5 +491,5 @@
 	cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL );
 	
-	return imcb_ask_add_cb_no( data );
+	imcb_ask_add_cb_no( data );
 }
 
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/nogaim.h	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -39,5 +39,11 @@
 #define _NOGAIM_H
 
+#if(__sun)
+#include <inttypes.h>
+#else
 #include <stdint.h>
+#endif
+
+#include "lib/events.h"
 
 #include "bitlbee.h"
Index: protocols/oscar/Makefile
===================================================================
--- protocols/oscar/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/oscar/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -16,5 +16,4 @@
 objects = admin.o auth.o bos.o buddylist.o chat.o chatnav.o conn.o icq.o im.o info.o misc.o msgcookie.o rxhandlers.o rxqueue.o search.o service.o snac.o ssi.o stats.o tlv.o txqueue.o oscar_util.o oscar.o
 
-CFLAGS += -Wall
 LFLAGS += -r
 
Index: protocols/twitter/Makefile
===================================================================
--- protocols/twitter/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/twitter/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -15,5 +15,4 @@
 objects = twitter.o twitter_http.o twitter_lib.o
 
-CFLAGS += -Wall
 LFLAGS += -r
 
Index: protocols/twitter/twitter_lib.c
===================================================================
--- protocols/twitter/twitter_lib.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/twitter/twitter_lib.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -23,5 +23,8 @@
 
 /* For strptime(): */
+#if(__sun)
+#else
 #define _XOPEN_SOURCE
+#endif
 
 #include "twitter_http.h"
Index: protocols/yahoo/Makefile
===================================================================
--- protocols/yahoo/Makefile	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/yahoo/Makefile	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -15,5 +15,5 @@
 objects = yahoo.o crypt.o libyahoo2.o yahoo_fn.o yahoo_httplib.o yahoo_util.o
 
-CFLAGS += -Wall -DSTDC_HEADERS -DHAVE_STRING_H -DHAVE_STRCHR -DHAVE_MEMCPY -DHAVE_GLIB
+CFLAGS += -DSTDC_HEADERS -DHAVE_STRING_H -DHAVE_STRCHR -DHAVE_MEMCPY -DHAVE_GLIB
 LFLAGS += -r
 
Index: protocols/yahoo/libyahoo2.c
===================================================================
--- protocols/yahoo/libyahoo2.c	(revision e193aeb224c2d0d39033ca543235f6530edc0445)
+++ protocols/yahoo/libyahoo2.c	(revision daae10fbfe16bac26f74af91faf253d377f1b166)
@@ -1859,5 +1859,6 @@
 	}
 	
-	return yahoo_https_auth_init(had);
+	yahoo_https_auth_init(had);
+	return;
 	
 fail:
