# HG changeset patch # User Mark Doliner # Date 1159426907 0 # Node ID 4df2827fc2eb9fc05c15fc11af51897750b7f55d # Parent 426383e5b45deec7e09e33e94108b1ef84ce9c84 [gaim-migrate @ 17389] 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. committer: Tailor Script diff -r 426383e5b45d -r 4df2827fc2eb libgaim/account.c --- a/libgaim/account.c Thu Sep 28 06:32:53 2006 +0000 +++ b/libgaim/account.c Thu Sep 28 07:01:47 2006 +0000 @@ -1369,32 +1369,21 @@ gaim_account_set_status(GaimAccount *account, const char *status_id, gboolean active, ...) { + GList *attrs = NULL; + const gchar *id; + gpointer data; 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; - - 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_account_set_status_list(account, status_id, active, attrs); g_list_free(attrs); + va_end(args); } void diff -r 426383e5b45d -r 4df2827fc2eb libgaim/account.h --- a/libgaim/account.h Thu Sep 28 06:32:53 2006 +0000 +++ b/libgaim/account.h Thu Sep 28 07:01:47 2006 +0000 @@ -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,25 +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. - * - * 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 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. + * 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. diff -r 426383e5b45d -r 4df2827fc2eb libgaim/status.c --- a/libgaim/status.c Thu Sep 28 06:32:53 2006 +0000 +++ b/libgaim/status.c Thu Sep 28 07:01:47 2006 +0000 @@ -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);