changeset 23772:750d700098c1

Fix the prplinfo structs and get rid of some compile warnings.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 29 Dec 2007 16:54:15 +0000
parents b20e24fcae47
children 1ec6a26cfefc
files libpurple/media.c libpurple/media.h libpurple/mediamanager.c libpurple/protocols/bonjour/Makefile.am libpurple/protocols/bonjour/bonjour.c libpurple/protocols/gg/gg.c libpurple/protocols/irc/irc.c libpurple/protocols/jabber/libxmpp.c libpurple/protocols/msn/msn.c libpurple/protocols/msnp9/Makefile.am libpurple/protocols/msnp9/msn.c libpurple/protocols/myspace/myspace.c libpurple/protocols/novell/novell.c libpurple/protocols/null/nullprpl.c libpurple/protocols/oscar/libaim.c libpurple/protocols/oscar/libicq.c libpurple/protocols/qq/qq.c libpurple/protocols/silc/silc.c libpurple/protocols/silc10/silc.c libpurple/protocols/simple/simple.c libpurple/protocols/yahoo/yahoo.c libpurple/prpl.h
diffstat 22 files changed, 85 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/media.c	Sat Dec 29 16:54:15 2007 +0000
@@ -99,7 +99,8 @@
 			NULL,
 			sizeof(PurpleMedia),
 			0,
-			(GInstanceInitFunc) purple_media_init
+			(GInstanceInitFunc) purple_media_init,
+			NULL
 		};
 		type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0);
 	}
--- a/libpurple/media.h	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/media.h	Sat Dec 29 16:54:15 2007 +0000
@@ -69,7 +69,7 @@
 	PurpleMediaPrivate *priv;
 };
 
-GType purple_media_get_type();
+GType purple_media_get_type(void);
 
 void purple_media_get_elements(PurpleMedia *media, GstElement **audio_src, GstElement **audio_sink,
 						  GstElement **video_src, GstElement **video_sink);
--- a/libpurple/mediamanager.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/mediamanager.c	Sat Dec 29 16:54:15 2007 +0000
@@ -78,7 +78,8 @@
 			NULL,
 			sizeof(PurpleMediaManager),
 			0,
-			(GInstanceInitFunc) purple_media_manager_init
+			(GInstanceInitFunc) purple_media_manager_init,
+			NULL
 		};
 		type = g_type_register_static(G_TYPE_OBJECT, "PurpleMediaManager", &info, 0);
 	}
--- a/libpurple/protocols/bonjour/Makefile.am	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/bonjour/Makefile.am	Sat Dec 29 16:54:15 2007 +0000
@@ -52,6 +52,7 @@
 	$(DEBUG_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(FARSIGHT_CFLAGS)
+
 if MDNS_AVAHI
   AM_CPPFLAGS += $(AVAHI_CFLAGS)
 else
--- a/libpurple/protocols/bonjour/bonjour.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/bonjour/bonjour.c	Sat Dec 29 16:54:15 2007 +0000
@@ -482,12 +482,11 @@
 	NULL,                                                    /* whiteboard_prpl_ops */
 	NULL,                                                    /* send_raw */
 	NULL,                                                    /* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	sizeof(PurplePluginProtocolInfo)
+	NULL,                                                    /* unregister_user */
+	NULL,                                                    /* send_attention */
+	NULL,                                                    /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),                        /* struct_size */
+	NULL                                                     /* initiate_media */
 };
 
 static PurplePluginInfo info =
--- a/libpurple/protocols/gg/gg.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/gg/gg.c	Sat Dec 29 16:54:15 2007 +0000
@@ -2147,12 +2147,11 @@
 	NULL,				/* whiteboard_prpl_ops */
 	NULL,				/* send_raw */
 	NULL,				/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL,				/* unregister_user */
+	NULL,				/* send_attention */
+	NULL,				/* get_attention_types */
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL				/* initiate_media */
 };
 /* }}} */
 
--- a/libpurple/protocols/irc/irc.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/irc/irc.c	Sat Dec 29 16:54:15 2007 +0000
@@ -899,12 +899,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	irc_send_raw,			/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
+	NULL,                   /* unregister_user */
+	NULL,                   /* send_attention */
+	NULL,                   /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),    /* struct_size */
+	NULL                    /* initiate_media */
 };
 
 static gboolean load_plugin (PurplePlugin *plugin) {
@@ -953,7 +952,7 @@
 	NULL,
 	NULL,
 	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL
 };
 
 static void _init_plugin(PurplePlugin *plugin)
--- a/libpurple/protocols/jabber/libxmpp.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Sat Dec 29 16:54:15 2007 +0000
@@ -115,7 +115,8 @@
 	jabber_unregister_account,		/* unregister_user */
 	jabber_send_attention,			/* send_attention */
 	jabber_attention_types,			/* attention_types */
-	jabber_media_initiate           /* initiate_media */
+	sizeof(PurplePluginProtocolInfo),       /* struct_size */
+	jabber_media_initiate                   /* initiate_media */
 };
 
 static gboolean load_plugin(PurplePlugin *plugin)
--- a/libpurple/protocols/msn/msn.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat Dec 29 16:54:15 2007 +0000
@@ -2283,10 +2283,9 @@
 	NULL,					/* roomlist_room_serialize */
 	NULL,					/* unregister_user */
 	msn_send_attention,                     /* send_attention */
-	msn_attention_types,                    /* attention_types */
-
-	/* padding */
-        sizeof(PurplePluginProtocolInfo)
+	msn_attention_types,                    /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),       /* struct_size */
+	NULL                                    /* initiate_media */
 };
 
 static PurplePluginInfo info =
--- a/libpurple/protocols/msnp9/Makefile.am	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/msnp9/Makefile.am	Sat Dec 29 16:54:15 2007 +0000
@@ -87,4 +87,6 @@
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	$(GLIB_CFLAGS) \
-	$(DEBUG_CFLAGS)
+	$(DEBUG_CFLAGS) \
+	$(FARSIGHT_CFLAGS)
+
--- a/libpurple/protocols/msnp9/msn.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/msnp9/msn.c	Sat Dec 29 16:54:15 2007 +0000
@@ -2136,9 +2136,8 @@
 	NULL,					/* unregister_user */
 	msn_send_attention,                     /* send_attention */
 	msn_attention_types,                    /* attention_types */
-
-	/* padding */
-	NULL
+	sizeof(PurplePluginProtocolInfo),       /* struct_size */
+	NULL                                    /* initiate_media */
 };
 
 static PurplePluginInfo info =
--- a/libpurple/protocols/myspace/myspace.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Sat Dec 29 16:54:15 2007 +0000
@@ -2990,7 +2990,8 @@
 	NULL,                  /* unregister_user */
 	msim_send_attention,   /* send_attention */
 	msim_attention_types,  /* attention_types */
-        sizeof(PurplePluginProtocolInfo)
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL                   /* initiate_media */
 };
 
 
--- a/libpurple/protocols/novell/novell.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/novell/novell.c	Sat Dec 29 16:54:15 2007 +0000
@@ -3511,12 +3511,11 @@
 	NULL,						/* whiteboard_prpl_ops */
 	NULL,						/* send_raw */
 	NULL,						/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL,						/* unregister_user */
+	NULL,						/* send_attention */
+	NULL,						/* get_attention_types */
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL						/* initiate_media */
 };
 
 static PurplePluginInfo info = {
--- a/libpurple/protocols/null/nullprpl.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/null/nullprpl.c	Sat Dec 29 16:54:15 2007 +0000
@@ -1122,10 +1122,11 @@
   NULL,                                /* whiteboard_prpl_ops */
   NULL,                                /* send_raw */
   NULL,                                /* roomlist_room_serialize */
-  NULL,                                /* padding... */
-  NULL,
-  NULL,
-  sizeof(PurpleProtocolPluginInfo)
+  NULL,                                /* unregister_user */
+  NULL,                                /* send_attention */
+  NULL,                                /* get_attention_types */
+  sizeof(PurplePluginProtocolInfo),    /* struct_size */
+  NULL                                 /* initiate_media */
 };
 
 static void nullprpl_init(PurplePlugin *plugin)
--- a/libpurple/protocols/oscar/libaim.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/oscar/libaim.c	Sat Dec 29 16:54:15 2007 +0000
@@ -92,12 +92,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL,                   /* unregister_user */
+	NULL,                   /* send_attention */
+	NULL,                   /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),    /* struct_size */
+	NULL                    /* initiate_media */
 };
 
 static PurplePluginInfo info =
--- a/libpurple/protocols/oscar/libicq.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/oscar/libicq.c	Sat Dec 29 16:54:15 2007 +0000
@@ -92,12 +92,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL,                   /* unregister_user */
+	NULL,                   /* send_attention */
+	NULL,                   /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),    /* struct_size */
+	NULL                    /* initiate_media */
 };
 
 static PurplePluginInfo info =
--- a/libpurple/protocols/qq/qq.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/qq/qq.c	Sat Dec 29 16:54:15 2007 +0000
@@ -701,12 +701,11 @@
 	NULL,							/* PurpleWhiteboardPrplOps */
 	NULL,							/* send_raw */
 	NULL,							/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
+	NULL,							/* unregister_user */
+	NULL,							/* send_attention */
+	NULL,							/* get_attention_types */
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL							/* initiate_media */
 };
 
 static PurplePluginInfo info = {
@@ -742,7 +741,7 @@
 	NULL,
 	NULL,
 	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL
 };
 
 
--- a/libpurple/protocols/silc/silc.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/silc/silc.c	Sat Dec 29 16:54:15 2007 +0000
@@ -1993,12 +1993,11 @@
 	&silcpurple_wb_ops,			/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,				        /* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
+	NULL,				        /* unregister_user */
+	NULL,				        /* send_attention */
+	NULL,				        /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo),       /* struct_size */
+	NULL				        /* initiate_media */
 };
 
 static PurplePluginInfo info =
@@ -2035,7 +2034,7 @@
 	NULL,
 	NULL,
 	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL
 };
 
 static void
--- a/libpurple/protocols/silc10/silc.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/silc10/silc.c	Sat Dec 29 16:54:15 2007 +0000
@@ -1793,12 +1793,11 @@
 	&silcpurple_wb_ops,			/* whiteboard_prpl_ops */
 	NULL,                       /* send_raw */
 	NULL,                       /* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
+	NULL,                   /* unregister_user */
+	NULL,                   /* send_attention */
+	NULL,                   /* get_attention_types */
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL                    /* initiate_media */
 };
 
 static PurplePluginInfo info =
@@ -1835,7 +1834,7 @@
 	NULL,
 	NULL,
 	NULL,
-        sizeof(PurpleProtocolPluginInfo)
+	NULL
 };
 
 static void
--- a/libpurple/protocols/simple/simple.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/simple/simple.c	Sat Dec 29 16:54:15 2007 +0000
@@ -2031,12 +2031,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	simple_send_raw,		/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-        sizeof(PurplePluginProtocolInfo)
+	NULL,					/* unregister_user */
+	NULL,					/* send_attention */
+	NULL,					/* get_attention_types */
+	sizeof(PurplePluginProtocolInfo), /* struct_size */
+	NULL					/* initiate_media */
 };
 
 
--- a/libpurple/protocols/yahoo/yahoo.c	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sat Dec 29 16:54:15 2007 +0000
@@ -4345,12 +4345,10 @@
 	NULL, /* send_raw */
 	NULL, /* roomlist_room_serialize */
 	NULL, /* unregister_user */
-
 	yahoo_send_attention,
 	yahoo_attention_types,
-
-	/* padding */
-        sizeof(PurplePluginProtocolInfo)
+	sizeof(PurplePluginProtocolInfo),
+	NULL
 };
 
 static PurplePluginInfo info =
--- a/libpurple/prpl.h	Sat Dec 29 06:41:04 2007 +0000
+++ b/libpurple/prpl.h	Sat Dec 29 16:54:15 2007 +0000
@@ -394,24 +394,23 @@
 	 * reasons.
 	 */
 	void (*unregister_user)(PurpleAccount *, PurpleAccountUnregistrationCb cb, void *user_data);
-	
+
 	/* Attention API for sending & receiving zaps/nudges/buzzes etc. */
 	gboolean (*send_attention)(PurpleConnection *gc, const char *username, guint type);
 	GList *(*get_attention_types)(PurpleAccount *acct);
 
-	void (*_purple_reserved4)(void);
-	GList *(*attention_types)(PurpleAccount *acct);
+	/* Make sure you do not try to dereference anything past struct_size! */
+	int struct_size;
+
 #ifdef USE_FARSIGHT
 	PurpleMedia  *(*initiate_media)(PurpleConnection *conn, const char *who, PurpleMediaStreamType type);
 #else
-	void (*initiate_media)(void)
+	void (*initiate_media)(void);
 #endif
-	/* Make sure you do not try to dereference anything past struct_size! */
-	int struct_size;
 };
 
 #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \
-	((G_STRUCT_OFFSET(PurpleProtocolPluginInfo, member) < prpl->struct_size) && \
+	((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->struct_size) && \
 	 prpl->member != NULL)
 
 #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \