pidgin.2.x.y: 2a8f5a99: jabber: Add a few extra g_return_if_fail...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Oct 22 18:05:42 EDT 2011


----------------------------------------------------------------------
Revision: 2a8f5a999d371863f3387a4f18dd7f29e1ffa93b
Parent:   02284171de47bfc34efd7551e77e9d86849fb8ad
Author:   darkrain42 at pidgin.im
Date:     10/22/11 17:55:51
Branch:   im.pidgin.pidgin.2.x.y
URL: http://d.pidgin.im/viewmtn/revision/info/2a8f5a999d371863f3387a4f18dd7f29e1ffa93b

Changelog: 

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

Changes against parent 02284171de47bfc34efd7551e77e9d86849fb8ad

  patched  libpurple/protocols/jabber/jingle/content.c
  patched  libpurple/protocols/jabber/jingle/iceudp.c
  patched  libpurple/protocols/jabber/jingle/rawudp.c
  patched  libpurple/protocols/jabber/jingle/session.c
  patched  libpurple/protocols/jabber/jingle/transport.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/content.c	c776283c4144965fbcbbe694234ca16b983002ac
+++ libpurple/protocols/jabber/jingle/content.c	10ba84c087cc2297450e5c223e3195dfef507627
@@ -181,6 +181,8 @@ jingle_content_set_property (GObject *ob
 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 *ob
 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 @@ jingle_content_to_xml(JingleContent *con
 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 @@ jingle_content_handle_action(JingleConte
 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);
 }
============================================================
--- libpurple/protocols/jabber/jingle/session.c	c1b4c4eb938cf774840df8d92780271917d3c2a5
+++ libpurple/protocols/jabber/jingle/session.c	00e7dd7888866a805129a8f17a545159c7e6e378
@@ -189,6 +189,8 @@ jingle_session_set_property (GObject *ob
 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 *ob
 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);
============================================================
--- libpurple/protocols/jabber/jingle/transport.c	0c669021e6fd078cec7fa3ff99a103fbae0d0d82
+++ libpurple/protocols/jabber/jingle/transport.c	bd9d70bcb9b26e54d3caee73384c208fbb03becf
@@ -108,6 +108,7 @@ jingle_transport_set_property (GObject *
 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 @@ jingle_transport_get_property (GObject *
 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 @@ jingle_transport_to_xml(JingleTransport 
 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);
 }
============================================================
--- libpurple/protocols/jabber/jingle/rawudp.c	89032bac19cf6b7ee32fd0248f1241b62ba8dc66
+++ libpurple/protocols/jabber/jingle/rawudp.c	77ad5da7fb7c36d4cf53c3e7d5132352ac4d346c
@@ -174,6 +174,8 @@ jingle_rawudp_set_property (GObject *obj
 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 *obj
 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);
============================================================
--- libpurple/protocols/jabber/jingle/iceudp.c	342d9053ce0f4e60537a2baef51ab5c5a89444cc
+++ libpurple/protocols/jabber/jingle/iceudp.c	373ea820d0f0d3d19ce457da17a1339b0e6a3c80
@@ -202,6 +202,8 @@ jingle_iceudp_set_property (GObject *obj
 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 *obj
 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);


More information about the Commits mailing list