[libgda] Code indentation and some corrections
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Code indentation and some corrections
- Date: Sun, 7 Apr 2013 20:27:16 +0000 (UTC)
commit 560b15423f97016d7948aa113f121e08e3ec76cc
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Apr 7 22:26:48 2013 +0200
Code indentation and some corrections
libgda/gda-config.c | 6 +++---
libgda/gda-connection.c | 6 +++---
libgda/gda-data-model-import.c | 3 ++-
libgda/gda-data-model.c | 2 +-
libgda/gda-data-proxy.c | 8 ++++----
libgda/gda-data-select.c | 2 +-
libgda/gda-meta-store.c | 4 ++--
libgda/gda-meta-struct-io.c | 5 +++--
libgda/gda-value.c | 8 ++++----
9 files changed, 23 insertions(+), 21 deletions(-)
---
diff --git a/libgda/gda-config.c b/libgda/gda-config.c
index 752c611..de3c6e5 100644
--- a/libgda/gda-config.c
+++ b/libgda/gda-config.c
@@ -705,7 +705,7 @@ gda_config_constructor (GType type,
gda_log_message (_("User specific "
"configuration directory '%s' exists and is not a
directory"),
confdir);
- g_free (conffile);
+ g_free (conffile);
}
else
unique_instance->priv->user_file = conffile;
@@ -1654,7 +1654,7 @@ load_all_providers (void)
gchar *pdir;
pdir = g_build_path (G_DIR_SEPARATOR_S, dirname, "providers", NULL);
load_providers_from_dir (pdir, TRUE);
- g_free (pdir);
+ g_free (pdir);
}
else {
gchar *str;
@@ -1827,7 +1827,7 @@ load_providers_from_dir (const gchar *dirname, gboolean recurs)
}
else {
g_module_close (handle);
- g_free (path);
+ g_free (path);
continue;
}
g_module_symbol (handle, "plugin_get_name",
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index 4e0c332..5e0381b 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -1613,9 +1613,9 @@ gda_connection_open_sqlite (const gchar *directory, const gchar *filename, gbool
g_object_set_data_full (G_OBJECT (cnc), "__gda_fname", fname, g_free);
g_signal_connect (cnc, "conn-closed",
G_CALLBACK (sqlite_connection_closed_cb), NULL);
- } else {
- g_free (fname);
- }
+ }
+ else
+ g_free (fname);
return cnc;
}
diff --git a/libgda/gda-data-model-import.c b/libgda/gda-data-model-import.c
index 651519e..09e524a 100644
--- a/libgda/gda-data-model-import.c
+++ b/libgda/gda-data-model-import.c
@@ -1017,10 +1017,11 @@ csv_parser_field_read_cb (char *s, size_t len, void *data)
/* compute column's type */
if (! model->priv->extract.csv.initializing) {
- if (pdata->field_next_col >= pdata->nb_cols)
+ if (pdata->field_next_col >= pdata->nb_cols) {
/* ignore extra fields */
g_free (copy);
return;
+ }
column = gda_data_model_describe_column ((GdaDataModel *) model,
pdata->field_next_col);
pdata->field_next_col++;
diff --git a/libgda/gda-data-model.c b/libgda/gda-data-model.c
index 8ddcbc0..d64c150 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -2023,7 +2023,7 @@ add_xml_row (GdaDataModel *model, xmlNodePtr xml_row, GError **error)
if (g_ptr_array_index (values, i))
gda_value_free ((GValue *) g_ptr_array_index (values, i));
- g_ptr_array_unref (values);
+ g_ptr_array_free (values, TRUE);
return retval;
}
diff --git a/libgda/gda-data-proxy.c b/libgda/gda-data-proxy.c
index cbcdb29..1c7e2bb 100644
--- a/libgda/gda-data-proxy.c
+++ b/libgda/gda-data-proxy.c
@@ -3336,9 +3336,9 @@ gda_data_proxy_set_ordering_column (GdaDataProxy *proxy, gint col, GError **erro
order_by->asc = TRUE;
expr->value = gda_value_new (G_TYPE_STRING);
g_value_take_string (expr->value, colname);
- } else {
- g_free (colname);
- }
+ }
+ else
+ g_free (colname);
g_object_set (G_OBJECT (proxy->priv->filter_stmt), "structure", sqlst, NULL);
#ifdef GDA_DEBUG_NO
@@ -3354,7 +3354,7 @@ gda_data_proxy_set_ordering_column (GdaDataProxy *proxy, gint col, GError **erro
gchar *str;
str = g_strdup_printf ("ORDER BY _%d", col + 1);
retval = gda_data_proxy_set_filter_expr (proxy, str, error);
- g_free (str);
+ g_free (str);
}
gda_mutex_unlock (proxy->priv->mutex);
diff --git a/libgda/gda-data-select.c b/libgda/gda-data-select.c
index 5dc6b6e..9c656e3 100644
--- a/libgda/gda-data-select.c
+++ b/libgda/gda-data-select.c
@@ -3711,7 +3711,7 @@ gda_data_select_rerun (GdaDataSelect *model, GError **error)
memcpy (copy, (gint8*) new_model + offset, size); /* Flawfinder: ignore */
memcpy ((gint8*) new_model + offset, (gint8*) model + offset, size); /* Flawfinder: ignore */
memcpy ((gint8*) model + offset, copy, size); /* Flawfinder: ignore */
- g_free (copy);
+ g_free (copy);
/* we need to keep some data from the old model */
GdaDataSelectInternals *mi;
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index c855e5d..3960c33 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -3566,9 +3566,9 @@ prepare_tables_infos (GdaMetaStore *store, TableInfo **out_table_infos, TableCon
if (! *out_cond_infos) {
*out_cond_infos = create_custom_set (store, table_name, condition, error);
if (! *out_cond_infos) {
- g_free (key);
+ g_free (key);
return FALSE;
- }
+ }
g_hash_table_insert (klass->cpriv->table_cond_info_hash, key, *out_cond_infos);
}
else
diff --git a/libgda/gda-meta-struct-io.c b/libgda/gda-meta-struct-io.c
index e9d619c..16077d0 100644
--- a/libgda/gda-meta-struct-io.c
+++ b/libgda/gda-meta-struct-io.c
@@ -169,7 +169,7 @@ create_table_object (GdaMetaStruct *mstruct, const GValue *catalog, const gchar
xmlChar *table_name, *table_schema;
GString *full_table_name;
GValue *v1 = NULL, *v2 = NULL, *v3 = NULL;
- GArray *pk_cols_array = NULL;
+ GArray *pk_cols_array = NULL;
gchar *tmp;
table_name = xmlGetProp (node, BAD_CAST "name");
@@ -408,7 +408,8 @@ create_table_object (GdaMetaStruct *mstruct, const GValue *catalog, const gchar
if (v2) gda_value_free (v2);
gda_value_free (v3);
- if (pk_cols_array) g_array_unref (pk_cols_array);
+ if (pk_cols_array)
+ g_array_free (pk_cols_array, TRUE);
return NULL;
}
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index e79ac57..cf4b5c6 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -867,15 +867,15 @@ GdaNumeric*
gda_numeric_copy (GdaNumeric *src)
{
GdaNumeric *copy;
- gchar *str;
+ gchar *str;
g_return_val_if_fail (src, NULL);
copy = gda_numeric_new ();
- str = gda_numeric_get_string (src);
- gda_numeric_set_from_string (copy, gda_numeric_get_string (src));
- g_free (str);
+ str = gda_numeric_get_string (src);
+ gda_numeric_set_from_string (copy, str);
+ g_free (str);
gda_numeric_set_width (copy, gda_numeric_get_width (src));
gda_numeric_set_precision (copy, gda_numeric_get_precision (src));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]