]> saetta.ns0.it Git - zakaudit/libzakaudit/commitdiff
Wrong pass of vararg.
authorAndrea Zagli <azagli@libero.it>
Sat, 28 Dec 2019 12:01:42 +0000 (13:01 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 28 Dec 2019 12:01:42 +0000 (13:01 +0100)
src/audit.c

index 870730ef5cac64cba497da10c623f9fc2ecbdef5..88290b368674bdd6b99b2ccafe3c5cc758f0434b 100644 (file)
@@ -715,6 +715,56 @@ zak_audit_finalize (GObject *gobject)
        G_OBJECT_CLASS (zak_audit_parent_class)->finalize (gobject);
 }
 
+static gboolean
+zak_audit_set_gda_connection_with_datasources_v (ZakAudit *zak_audit, GdaConnection *gda_connection, va_list ap)
+{
+       ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
+
+       priv->gdaex = gdaex_new_from_connection (gda_connection);
+
+       if (priv->gdaex == NULL)
+               {
+                       /* TODO */
+                       g_warning (_("Error creating GdaEx object."));
+                       return FALSE;
+               }
+
+       /* loading datasources */
+       if (!load_datasources (zak_audit, ap))
+               {
+                       /* TODO */
+                       g_warning (_("Error loading datasources."));
+                       return FALSE;
+               }
+
+       return TRUE;
+}
+
+static gboolean
+zak_audit_set_cnc_string_with_datasources_v (ZakAudit *zak_audit, const gchar *cnc_string, va_list ap)
+{
+       ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
+
+       priv->gdaex = gdaex_new_from_string (cnc_string);
+
+       if (priv->gdaex == NULL)
+               {
+                       /* TODO */
+                       g_warning (_("Error creating GdaEx object."));
+                       return FALSE;
+               }
+
+       /* loading datasources */
+       if (!load_datasources (zak_audit, ap))
+               {
+                       /* TODO */
+                       g_warning (_("Error loading datasources."));
+                       return FALSE;
+               }
+
+       return TRUE;
+}
+
 /* PUBLIC */
 /**
  * zak_audit_new_with_datasources:
@@ -733,7 +783,7 @@ ZakAudit
 
        va_start (ap, gda_connection);
 
-       if (!zak_audit_set_gda_connection_with_datasources (zak_audit, gda_connection, ap))
+       if (!zak_audit_set_gda_connection_with_datasources_v (zak_audit, gda_connection, ap))
                {
                        g_clear_object (&zak_audit);
                }
@@ -757,7 +807,7 @@ ZakAudit
 
        va_start (ap, cnc_string);
 
-       if (!zak_audit_set_cnc_string_with_datasources (zak_audit, cnc_string, ap))
+       if (!zak_audit_set_cnc_string_with_datasources_v (zak_audit, cnc_string, ap))
                {
                        g_clear_object (&zak_audit);
                }
@@ -792,34 +842,19 @@ ZakAudit
 gboolean
 zak_audit_set_gda_connection_with_datasources (ZakAudit *zak_audit, GdaConnection *gda_connection, ...)
 {
+       gboolean ret;
+
        va_list ap;
 
        g_return_val_if_fail (IS_ZAK_AUDIT (zak_audit), FALSE);
 
-       ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
-
-       priv->gdaex = gdaex_new_from_connection (gda_connection);
-
-       if (priv->gdaex == NULL)
-               {
-                       /* TODO */
-                       g_warning (_("Error creating GdaEx object."));
-                       return FALSE;
-               }
-
        va_start (ap, gda_connection);
 
-       /* carico i datasource */
-       if (!load_datasources (zak_audit, ap))
-               {
-                       /* TODO */
-                       g_warning (_("Error loading datasources."));
-                       return FALSE;
-               }
+       ret = zak_audit_set_gda_connection_with_datasources_v (zak_audit, gda_connection, ap);
 
        va_end (ap);
 
-       return TRUE;
+       return ret;
 }
 
 gboolean
@@ -831,34 +866,19 @@ zak_audit_set_gda_connection (ZakAudit *zak_audit, GdaConnection *gda_connection
 gboolean
 zak_audit_set_cnc_string_with_datasources (ZakAudit *zak_audit, const gchar *cnc_string, ...)
 {
+       gboolean ret;
+
        va_list ap;
 
        g_return_val_if_fail (IS_ZAK_AUDIT (zak_audit), FALSE);
 
-       ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
-
-       priv->gdaex = gdaex_new_from_string (cnc_string);
-
-       if (priv->gdaex == NULL)
-               {
-                       /* TODO */
-                       g_warning (_("Error creating GdaEx object."));
-                       return FALSE;
-               }
-
        va_start (ap, cnc_string);
 
-       /* carico i datasource */
-       if (!load_datasources (zak_audit, ap))
-               {
-                       /* TODO */
-                       g_warning (_("Error loading datasources."));
-                       return FALSE;
-               }
+       ret = zak_audit_set_cnc_string_with_datasources_v (zak_audit, cnc_string, ap);
 
        va_end (ap);
 
-       return TRUE;
+       return ret;
 }
 
 /**