Revision: 17389
http://svn.sourceforge.net/gaim/?rev=17389&view=rev
Author: thekingant
Date: 2006-09-28 00:01:47 -0700 (Thu, 28 Sep 2006)
Log Message:
-----------
Fix sf bug #1469293
Checking if a va_list != NULL is not valid because va_list is not a pointer
on some platforms. Conveniently the check wasn't necessary.
Modified Paths:
--------------
trunk/libgaim/account.c
trunk/libgaim/account.h
trunk/libgaim/status.c
Modified: trunk/libgaim/account.c
===================================================================
--- trunk/libgaim/account.c 2006-09-28 06:32:53 UTC (rev 17388)
+++ trunk/libgaim/account.c 2006-09-28 07:01:47 UTC (rev 17389)
@@ -1369,32 +1369,21 @@
gaim_account_set_status(GaimAccount *account, const char *status_id,
gboolean active, ...)
{
- va_list args;
-
- va_start(args, active);
- gaim_account_set_status_vargs(account, status_id, active, args);
- va_end(args);
-}
-
-void
-gaim_account_set_status_vargs(GaimAccount *account, const char *status_id,
- gboolean active, va_list args)
-{
GList *attrs = NULL;
const gchar *id;
gpointer data;
+ va_list args;
- if (args != NULL)
+ va_start(args, active);
+ while ((id = va_arg(args, const char *)) != NULL)
{
- while ((id = va_arg(args, const char *)) != NULL)
- {
- attrs = g_list_append(attrs, (char *)id);
- data = va_arg(args, void *);
- attrs = g_list_append(attrs, data);
- }
+ attrs = g_list_append(attrs, (char *)id);
+ data = va_arg(args, void *);
+ attrs = g_list_append(attrs, data);
}
gaim_account_set_status_list(account, status_id, active, attrs);
g_list_free(attrs);
+ va_end(args);
}
void
Modified: trunk/libgaim/account.h
===================================================================
--- trunk/libgaim/account.h 2006-09-28 06:32:53 UTC (rev 17388)
+++ trunk/libgaim/account.h 2006-09-28 07:01:47 UTC (rev 17389)
@@ -287,8 +287,7 @@
/**
* Activates or deactivates a status. All changes to the statuses of
- * an account go through this function or gaim_account_set_status_vargs
- * or gaim_account_set_status_list.
+ * an account go through this function or gaim_account_set_status_list.
*
* Only independent statuses can be deactivated with this. To deactivate
* an exclusive status, activate a different (and exclusive?) status.
@@ -296,8 +295,8 @@
* @param account The account.
* @param status_id The ID of the status.
* @param active The active state.
- * @param ... Optional NULL-terminated attributes passed for the
- * new status, in an id, value pair.
+ * @param ... Pairs of attributes for the new status passed in
+ * as a NULL-terminated list of id/value pairs.
*/
void gaim_account_set_status(GaimAccount *account, const char *status_id,
gboolean active, ...);
@@ -305,8 +304,7 @@
/**
* Activates or deactivates a status. All changes to the statuses of
- * an account go through this function or gaim_account_set_status or
- * gaim_account_set_status_list.
+ * an account go through this function or gaim_account_set_status.
*
* Only independent statuses can be deactivated with this. To deactivate
* an exclusive status, activate a different (and exclusive?) status.
@@ -314,23 +312,6 @@
* @param account The account.
* @param status_id The ID of the status.
* @param active The active state.
- * @param args The va_list of attributes.
- */
-void gaim_account_set_status_vargs(GaimAccount *account,
- const char *status_id,
- gboolean active, va_list args);
-
-/**
- * Activates or deactivates a status. All changes to the statuses of
- * an account go through this function or gaim_account_set_status or
- * gaim_account_set_status_vargs.
- *
- * Only independent statuses can be deactivated with this. To deactivate
- * an exclusive status, activate a different (and exclusive?) status.
- *
- * @param account The account.
- * @param status_id The ID of the status.
- * @param active The active state.
* @param attrs A list of attributes in key/value pairs
*/
void gaim_account_set_status_list(GaimAccount *account,
Modified: trunk/libgaim/status.c
===================================================================
--- trunk/libgaim/status.c 2006-09-28 06:32:53 UTC (rev 17388)
+++ trunk/libgaim/status.c 2006-09-28 07:01:47 UTC (rev 17389)
@@ -718,14 +718,11 @@
const gchar *id;
gpointer data;
- if (args != NULL)
+ while ((id = va_arg(args, const char *)) != NULL)
{
- while ((id = va_arg(args, const char *)) != NULL)
- {
- attrs = g_list_append(attrs, (char *)id);
- data = va_arg(args, void *);
- attrs = g_list_append(attrs, data);
- }
+ attrs = g_list_append(attrs, (char *)id);
+ data = va_arg(args, void *);
+ attrs = g_list_append(attrs, data);
}
gaim_status_set_active_with_attrs_list(status, active, attrs);
g_list_free(attrs);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|