changeset 32785:c9da7f5fbd0e

jabber: Add a few extra g_return_if_fails to the Jingle code These are entirely superfluous (the JINGLE_IS_* macros check for non-nullness), but they silence some false-positives from clang
author Paul Aurich <paul@darkrain42.org>
date Sat, 22 Oct 2011 21:55:51 +0000
parents 5aca97a40e53
children 75e1758925bc edf3504ca95a
files libpurple/protocols/jabber/jingle/content.c libpurple/protocols/jabber/jingle/iceudp.c libpurple/protocols/jabber/jingle/rawudp.c libpurple/protocols/jabber/jingle/session.c libpurple/protocols/jabber/jingle/transport.c
diffstat 5 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/content.c	Fri Oct 21 14:38:35 2011 +0000
+++ b/libpurple/protocols/jabber/jingle/content.c	Sat Oct 22 21:55:51 2011 +0000
@@ -181,6 +181,8 @@
 jingle_content_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	JingleContent *content;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_CONTENT(object));
 
 	content = JINGLE_CONTENT(object);
@@ -225,6 +227,8 @@
 jingle_content_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
 	JingleContent *content;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_CONTENT(object));
 
 	content = JINGLE_CONTENT(object);
@@ -454,6 +458,7 @@
 xmlnode *
 jingle_content_to_xml(JingleContent *content, xmlnode *jingle, JingleActionType action)
 {
+	g_return_val_if_fail(content != NULL, NULL);
 	g_return_val_if_fail(JINGLE_IS_CONTENT(content), NULL);
 	return JINGLE_CONTENT_GET_CLASS(content)->to_xml(content, jingle, action);
 }
@@ -461,6 +466,7 @@
 void
 jingle_content_handle_action(JingleContent *content, xmlnode *xmlcontent, JingleActionType action)
 {
+	g_return_if_fail(content != NULL);
 	g_return_if_fail(JINGLE_IS_CONTENT(content));
 	JINGLE_CONTENT_GET_CLASS(content)->handle_action(content, xmlcontent, action);
 }
--- a/libpurple/protocols/jabber/jingle/iceudp.c	Fri Oct 21 14:38:35 2011 +0000
+++ b/libpurple/protocols/jabber/jingle/iceudp.c	Sat Oct 22 21:55:51 2011 +0000
@@ -202,6 +202,8 @@
 jingle_iceudp_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	JingleIceUdp *iceudp;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_ICEUDP(object));
 
 	iceudp = JINGLE_ICEUDP(object);
@@ -225,6 +227,8 @@
 jingle_iceudp_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
 	JingleIceUdp *iceudp;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_ICEUDP(object));
 
 	iceudp = JINGLE_ICEUDP(object);
--- a/libpurple/protocols/jabber/jingle/rawudp.c	Fri Oct 21 14:38:35 2011 +0000
+++ b/libpurple/protocols/jabber/jingle/rawudp.c	Sat Oct 22 21:55:51 2011 +0000
@@ -174,6 +174,8 @@
 jingle_rawudp_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	JingleRawUdp *rawudp;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_RAWUDP(object));
 
 	rawudp = JINGLE_RAWUDP(object);
@@ -197,6 +199,8 @@
 jingle_rawudp_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
 	JingleRawUdp *rawudp;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_RAWUDP(object));
 
 	rawudp = JINGLE_RAWUDP(object);
--- a/libpurple/protocols/jabber/jingle/session.c	Fri Oct 21 14:38:35 2011 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Sat Oct 22 21:55:51 2011 +0000
@@ -189,6 +189,8 @@
 jingle_session_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	JingleSession *session;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_SESSION(object));
 
 	session = JINGLE_SESSION(object);
@@ -231,6 +233,8 @@
 jingle_session_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
 	JingleSession *session;
+
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_SESSION(object));
 
 	session = JINGLE_SESSION(object);
--- a/libpurple/protocols/jabber/jingle/transport.c	Fri Oct 21 14:38:35 2011 +0000
+++ b/libpurple/protocols/jabber/jingle/transport.c	Sat Oct 22 21:55:51 2011 +0000
@@ -108,6 +108,7 @@
 static void
 jingle_transport_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_TRANSPORT(object));
 
 	switch (prop_id) {
@@ -120,6 +121,7 @@
 static void
 jingle_transport_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
+	g_return_if_fail(object != NULL);
 	g_return_if_fail(JINGLE_IS_TRANSPORT(object));
 
 	switch (prop_id) {
@@ -170,6 +172,7 @@
 xmlnode *
 jingle_transport_to_xml(JingleTransport *transport, xmlnode *content, JingleActionType action)
 {
+	g_return_val_if_fail(transport != NULL, NULL);
 	g_return_val_if_fail(JINGLE_IS_TRANSPORT(transport), NULL);
 	return JINGLE_TRANSPORT_GET_CLASS(transport)->to_xml(transport, content, action);
 }