datallah pointed out that using g_return_if_fail() is preferable to cpw.resiak.disconnectreason

Tue, 09 Oct 2007 15:03:48 +0000

author
Will Thompson <resiak@pidgin.im>
date
Tue, 09 Oct 2007 15:03:48 +0000
branch
cpw.resiak.disconnectreason
changeset 21153
610a45545a40
parent 21152
2357a7a795eb
child 21154
be1799decdb7

datallah pointed out that using g_return_if_fail() is preferable to
g_assert()ing.

libpurple/connection.c file | annotate | diff | comparison | revisions
--- a/libpurple/connection.c	Tue Oct 09 13:42:15 2007 +0000
+++ b/libpurple/connection.c	Tue Oct 09 15:03:48 2007 +0000
@@ -502,7 +502,7 @@
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(gc   != NULL);
-	g_assert (reason < PURPLE_NUM_REASONS);
+	g_return_if_fail(reason < PURPLE_NUM_REASONS);
 
 	if (description == NULL) {
 		purple_debug_error("connection", "purple_connection_error_reason: check `description != NULL' failed\n");
@@ -575,6 +575,8 @@
 		case PURPLE_REASON_INVALID_SETTINGS:
 		case PURPLE_REASON_OTHER_ERROR:
 			return TRUE;
+		default:
+			g_return_val_if_reached(TRUE);
 	}
 }
 

mercurial