[gupnp] Service: Remove _valist functions



commit 6b13ea26ae0330adbc7b7c67733f27a4b44de820
Author: Jens Georg <mail jensge org>
Date:   Thu Dec 30 13:38:39 2021 +0100

    Service: Remove _valist functions

 libgupnp/gupnp-service-action.c | 43 +++++------------------------------------
 libgupnp/gupnp-service.c        | 18 +----------------
 libgupnp/gupnp-service.h        | 12 ------------
 3 files changed, 6 insertions(+), 67 deletions(-)
---
diff --git a/libgupnp/gupnp-service-action.c b/libgupnp/gupnp-service-action.c
index 6e7c178..ddd7091 100644
--- a/libgupnp/gupnp-service-action.c
+++ b/libgupnp/gupnp-service-action.c
@@ -179,27 +179,9 @@ gupnp_service_action_get (GUPnPServiceAction *action, ...)
         g_return_if_fail (action != NULL);
 
         va_start (var_args, action);
-        gupnp_service_action_get_valist (action, var_args);
-        va_end (var_args);
-}
-
-/**
- * gupnp_service_action_get_valist:
- * @action: A #GUPnPServiceAction
- * @var_args: va_list of tuples of argument name, argument type, and argument
- * value location.
- *
- * See gupnp_service_action_get(); this version takes a va_list for
- * use by language bindings.
- **/
-void
-gupnp_service_action_get_valist (GUPnPServiceAction *action, va_list var_args)
-{
         const char *arg_name;
         GType arg_type;
-        GValue value = {
-                0,
-        };
+        GValue value = G_VALUE_INIT;
         char *copy_error;
 
         g_return_if_fail (action != NULL);
@@ -225,8 +207,10 @@ gupnp_service_action_get_valist (GUPnPServiceAction *action, va_list var_args)
 
                 arg_name = va_arg (var_args, const char *);
         }
+        va_end (var_args);
 }
 
+
 /**
  * gupnp_service_action_get_values:
  * @action: A #GUPnPServiceAction
@@ -371,27 +355,9 @@ gupnp_service_action_set (GUPnPServiceAction *action, ...)
         g_return_if_fail (action != NULL);
 
         va_start (var_args, action);
-        gupnp_service_action_set_valist (action, var_args);
-        va_end (var_args);
-}
-
-/**
- * gupnp_service_action_set_valist:
- * @action: A #GUPnPServiceAction
- * @var_args: va_list of tuples of return value name, return value type, and
- * actual return value.
- *
- * See gupnp_service_action_set(); this version takes a va_list for
- * use by language bindings.
- **/
-void
-gupnp_service_action_set_valist (GUPnPServiceAction *action, va_list var_args)
-{
         const char *arg_name;
         GType arg_type;
-        GValue value = {
-                0,
-        };
+        GValue value = G_VALUE_INIT;
         char *collect_error;
 
         g_return_if_fail (action != NULL);
@@ -423,6 +389,7 @@ gupnp_service_action_set_valist (GUPnPServiceAction *action, va_list var_args)
 
                 arg_name = va_arg (var_args, const char *);
         }
+        va_end (var_args);
 }
 
 /**
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 0f2f876..212b972 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1321,23 +1321,6 @@ gupnp_service_notify (GUPnPService *service,
         g_return_if_fail (GUPNP_IS_SERVICE (service));
 
         va_start (var_args, service);
-        gupnp_service_notify_valist (service, var_args);
-        va_end (var_args);
-}
-
-/**
- * gupnp_service_notify_valist:
- * @service: A #GUPnPService
- * @var_args: A va_list of tuples of variable name, variable type, and variable
- * value, terminated with %NULL.
- *
- * See gupnp_service_notify(); this version takes a va_list for
- * use by language bindings.
- **/
-void
-gupnp_service_notify_valist (GUPnPService *service,
-                             va_list       var_args)
-{
         const char *var_name;
         GType var_type;
         GValue value = {0, };
@@ -1368,6 +1351,7 @@ gupnp_service_notify_valist (GUPnPService *service,
 
                 var_name = va_arg (var_args, const char *);
         }
+        va_end (var_args);
 }
 
 
diff --git a/libgupnp/gupnp-service.h b/libgupnp/gupnp-service.h
index dc0d808..088bf47 100644
--- a/libgupnp/gupnp-service.h
+++ b/libgupnp/gupnp-service.h
@@ -69,10 +69,6 @@ void
 gupnp_service_action_get          (GUPnPServiceAction *action,
                                    ...) G_GNUC_NULL_TERMINATED;
 
-void
-gupnp_service_action_get_valist   (GUPnPServiceAction *action,
-                                   va_list             var_args);
-
 GList *
 gupnp_service_action_get_values (GUPnPServiceAction *action,
                                  GList              *arg_names,
@@ -92,10 +88,6 @@ void
 gupnp_service_action_set          (GUPnPServiceAction *action,
                                    ...) G_GNUC_NULL_TERMINATED;
 
-void
-gupnp_service_action_set_valist   (GUPnPServiceAction *action,
-                                   va_list             var_args);
-
 void
 gupnp_service_action_set_values   (GUPnPServiceAction *action,
                                    GList              *arg_names,
@@ -125,10 +117,6 @@ void
 gupnp_service_notify              (GUPnPService *service,
                                    ...) G_GNUC_NULL_TERMINATED;
 
-void
-gupnp_service_notify_valist       (GUPnPService *service,
-                                   va_list       var_args);
-
 void
 gupnp_service_notify_value        (GUPnPService *service,
                                    const char   *variable,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]