[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_4-102-g889a412

Philippe Delorme nobody at users.sourceforge.net
Tue Nov 8 23:07:08 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  889a41230e9db203951afc8e58827d80933a9c36 (commit)
       via  be2cc6b5ffc9735cf7c15889906da76193089801 (commit)
      from  3d552d745ef67b6446242cd1f1b72bb63ec87d22 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 889a41230e9db203951afc8e58827d80933a9c36
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Tue Nov 8 23:05:44 2011 +0100

    Remove unnecessary NULL checks before g_free calls

commit be2cc6b5ffc9735cf7c15889906da76193089801
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Tue Nov 8 22:54:26 2011 +0100

    Remove unnecessary NULL checks before g_free calls

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_data_finance.c b/src/bet_data_finance.c
index aa553dc..c8c238c 100644
--- a/src/bet_data_finance.c
+++ b/src/bet_data_finance.c
@@ -257,12 +257,9 @@ gdouble bet_data_finance_get_total_cost ( struct_echeance *s_echeance )
  * */
 void bet_data_finance_structure_amortissement_free ( struct_amortissement *s_amortissement )
 {
-    if ( s_amortissement -> str_date )
-        g_free ( s_amortissement -> str_date );
-    if ( s_amortissement -> str_echeance )
-        g_free ( s_amortissement -> str_echeance );
-    if ( s_amortissement -> str_frais )
-        g_free ( s_amortissement -> str_frais );
+    g_free ( s_amortissement -> str_date );
+    g_free ( s_amortissement -> str_echeance );
+    g_free ( s_amortissement -> str_frais );
 
     g_free ( s_amortissement );
 }
diff --git a/src/bet_hist.c b/src/bet_hist.c
index 589ed6c..4018c66 100644
--- a/src/bet_hist.c
+++ b/src/bet_hist.c
@@ -338,12 +338,10 @@ gboolean bet_historical_div_toggle_clicked ( GtkCellRendererToggle *renderer,
                 if ( bet_historical_get_full_div ( model, &parent ) )
                 {
                     amount = bet_historical_get_children_amount ( model, &parent );
-                    if ( str_amount )
-                        g_free ( str_amount );
+                    g_free ( str_amount );
                     str_amount = gsb_real_safe_real_to_string ( amount,
                                 gsb_data_account_get_currency_floating_point ( account_number ) );
-                    if ( str_average )
-                        g_free ( str_average );
+                    g_free ( str_average );
                     str_average = utils_real_get_string_with_currency ( amount,
                                 gsb_data_account_get_currency ( account_number ), TRUE );
                     gtk_tree_store_set ( GTK_TREE_STORE ( model ),
@@ -892,8 +890,7 @@ void bet_historical_populate_div_model ( gpointer key,
       g_hash_table_size ( sh -> list_sub_div ) < 1 ) )
     {
         retained = bet_data_hist_get_div_amount ( account_nb, div_number, 0 );
-        if ( str_amount )
-            g_free ( str_amount );
+        g_free ( str_amount );
         str_amount = gsb_real_safe_real_to_string ( retained,
                         gsb_data_currency_get_floating_point ( currency_number ) );
         str_retained = utils_real_get_string_with_currency ( retained, currency_number, TRUE );
@@ -976,8 +973,7 @@ void bet_historical_populate_div_model ( gpointer key,
             {
                 /* printf ("account_nb = %d div_number = %d sub_sh -> div = %d\n", account_nb, div_number, sub_sh -> div ); */
                 retained = bet_data_hist_get_div_amount ( account_nb, div_number, sub_sh -> div );
-                if ( str_amount )
-                    g_free ( str_amount );
+                g_free ( str_amount );
                 str_amount = gsb_real_safe_real_to_string ( retained,
                         gsb_data_currency_get_floating_point ( currency_number ) );
                 str_retained = utils_real_get_string_with_currency ( retained, currency_number, TRUE );
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 26e8f23..f3ee40c 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -912,10 +912,8 @@ void bet_array_refresh_scheduled_data ( GtkTreeModel *tab_model,
         }
 
         g_free ( str_amount );
-        if ( str_credit )
-            g_free ( str_credit );
-        if ( str_debit )
-            g_free ( str_debit );
+        g_free ( str_credit );
+        g_free ( str_debit );
     }
 }
 
@@ -1059,10 +1057,8 @@ void bet_array_refresh_transactions_data ( GtkTreeModel *tab_model,
         g_free ( str_date );
         g_free ( str_amount );
         g_free ( str_description );
-        if ( str_debit )
-            g_free ( str_debit );
-        if ( str_credit )
-            g_free ( str_credit );
+        g_free ( str_debit );
+        g_free ( str_credit );
     }
 }
 
@@ -1168,8 +1164,7 @@ void bet_array_list_add_new_hist_line ( GtkTreeModel *tab_model,
     }
 
     g_free ( str_description );
-    if ( str_debit )
-        g_free ( str_debit );
+    g_free ( str_debit );
     g_free ( str_value );
     g_free ( str_amount );
 }
@@ -1282,10 +1277,8 @@ gboolean bet_array_refresh_futur_data ( GtkTreeModel *tab_model,
         g_free ( str_date );
         g_free ( str_description );
         g_free ( str_amount );
-        if ( str_debit )
-            g_free ( str_debit );
-        if ( str_credit )
-            g_free ( str_credit );
+        g_free ( str_debit );
+        g_free ( str_credit );
     }
 
     return TRUE;
@@ -1843,10 +1836,8 @@ void bet_array_adjust_hist_amount ( gint div_number,
                         sign = bet_data_get_div_type ( div_number );
                         number = gsb_real_sub ( number, amount );
 
-                        if ( str_amount )
-                            g_free ( str_amount );
-                        if ( str_desc )
-                            g_free ( str_desc );
+                        g_free ( str_amount );
+                        g_free ( str_desc );
                         if ( sign == 1 )
                         {
                             if ( number.mantissa < 0 )
@@ -2693,10 +2684,8 @@ gboolean bet_array_refresh_transfert_data ( GtkTreeModel *tab_model,
         g_free ( str_date );
         g_free ( str_description );
         g_free ( str_amount );
-        if ( str_debit )
-            g_free ( str_debit );
-        if ( str_credit )
-            g_free ( str_credit );
+        g_free ( str_debit );
+        g_free ( str_credit );
     }
 
     return FALSE;
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index bdf2fc7..0982482 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -842,8 +842,7 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
 
                 else if ( !strcmp ( attribute_names[i], "CSV_separator" ))
                 {
-                    if ( etat.csv_separator )
-                        g_free ( etat.csv_separator );
+                    g_free ( etat.csv_separator );
                     etat.csv_separator = my_strdup ( attribute_values[i] );
                 }
 
@@ -890,8 +889,7 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
             case 'F':
                 if ( !strcmp ( attribute_names[i], "File_version" ))
                 {
-                    if ( download_tmp_values.file_version )
-                        g_free ( download_tmp_values.file_version );
+                    g_free ( download_tmp_values.file_version );
                     download_tmp_values.file_version = my_strdup (attribute_values[i]);
                 }
 
@@ -905,15 +903,13 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
             case 'G':
                 if ( !strcmp ( attribute_names[i], "Grisbi_version" ))
                 {
-                    if ( download_tmp_values.grisbi_version )
-                        g_free ( download_tmp_values.grisbi_version );
+                    g_free ( download_tmp_values.grisbi_version );
                     download_tmp_values.grisbi_version = my_strdup (attribute_values[i]);
                 }
 
                 else if ( !strcmp ( attribute_names[i], "General_address" ))
                 {
-                    if ( adresse_commune )
-                        g_free ( adresse_commune );
+                    g_free ( adresse_commune );
                     adresse_commune = my_strdup (attribute_values[i]);
                 }
 
@@ -1022,8 +1018,7 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
             case 'S':
                 if ( !strcmp ( attribute_names[i], "Second_general_address" ))
                 {
-                    if ( adresse_secondaire )
-                        g_free ( adresse_secondaire );
+                    g_free ( adresse_secondaire );
                     adresse_secondaire = my_strdup (attribute_values[i]);
                 }
 
@@ -2686,8 +2681,7 @@ void gsb_file_load_category ( const gchar **attribute_names,
 {
     gint i=0;
 
-    if ( buffer_new_div_sous_div )
-        g_free ( buffer_new_div_sous_div );
+    g_free ( buffer_new_div_sous_div );
     buffer_new_div_sous_div = g_malloc0 ( sizeof ( struct new_div_sous_div_struct ) );
 
     if ( !attribute_names[i] )
@@ -5602,7 +5596,7 @@ void gsb_file_load_start_element_before_0_6 ( GMarkupParseContext *context,
                         number.mantissa, number.exponent); */
             gsb_data_transaction_set_amount ( transaction_number,
                                   utils_real_get_from_string (tmp_string));
-            if (tmp_string) g_free (tmp_string);
+            g_free (tmp_string);
         }
 
         if ( !strcmp ( attribute_names[i],
@@ -5773,7 +5767,7 @@ void gsb_file_load_start_element_before_0_6 ( GMarkupParseContext *context,
             tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_scheduled_set_amount ( scheduled_number,
                                 utils_real_get_from_string (tmp_string));
-            if (tmp_string) g_free (tmp_string);
+            g_free (tmp_string);
         }
 
         if ( !strcmp ( attribute_names[i],
@@ -6496,7 +6490,7 @@ void gsb_file_load_start_element_before_0_6 ( GMarkupParseContext *context,
             tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_report_amount_comparison_set_first_amount ( amount_comparison_number,
                                          utils_real_get_from_string (tmp_string));
-            if (tmp_string) g_free (tmp_string);
+            g_free (tmp_string);
         }
 
         if ( !strcmp ( attribute_names[i],
@@ -6509,7 +6503,7 @@ void gsb_file_load_start_element_before_0_6 ( GMarkupParseContext *context,
             tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_report_amount_comparison_set_second_amount ( amount_comparison_number,
                                           utils_real_get_from_string (tmp_string));
-            if (tmp_string) g_free (tmp_string);
+            g_free (tmp_string);
         }
 
         i++;
@@ -6617,7 +6611,6 @@ void gsb_file_load_general_part_before_0_6 ( GMarkupParseContext *context,
     if ( !strcmp ( element_name,
            "Version_grisbi" ))
     {
-    if ( download_tmp_values.grisbi_version )
         g_free ( download_tmp_values.grisbi_version );
     download_tmp_values.grisbi_version = my_strdup (text);
     return;
@@ -6626,7 +6619,6 @@ void gsb_file_load_general_part_before_0_6 ( GMarkupParseContext *context,
     if ( !strcmp ( element_name,
            "Titre" ))
     {
-    if ( titre_fichier )
         g_free ( titre_fichier );
     titre_fichier = my_strdup (text);
     return;
@@ -6635,7 +6627,6 @@ void gsb_file_load_general_part_before_0_6 ( GMarkupParseContext *context,
     if ( !strcmp ( element_name,
            "Adresse_commune" ))
     {
-    if ( adresse_commune )
         g_free ( adresse_commune );
     adresse_commune = my_strdup (text);
     return;
@@ -6644,7 +6635,6 @@ void gsb_file_load_general_part_before_0_6 ( GMarkupParseContext *context,
     if ( !strcmp ( element_name,
            "Adresse_secondaire" ))
     {
-    if ( adresse_secondaire )
         g_free ( adresse_secondaire );
     adresse_secondaire = my_strdup (text);
     return;
@@ -6933,8 +6923,7 @@ void gsb_file_load_account_part_before_0_6 ( GMarkupParseContext *context,
                         number.mantissa, number.exponent,
                         utils_real_get_string ( gsb_data_account_get_init_balance ( account_number, 2))); */
 
-    if (tmp_string) 
-        g_free (tmp_string);
+    g_free (tmp_string);
     return;
     }
 
@@ -6953,8 +6942,7 @@ void gsb_file_load_account_part_before_0_6 ( GMarkupParseContext *context,
     else
         gsb_data_account_set_mini_balance_wanted ( account_number, number );
 
-    if (tmp_string) 
-        g_free (tmp_string);
+    g_free (tmp_string);
     return;
     }
 
@@ -6973,8 +6961,7 @@ void gsb_file_load_account_part_before_0_6 ( GMarkupParseContext *context,
     else
         gsb_data_account_set_mini_balance_authorized ( account_number, number );
 
-    if (tmp_string)
-        g_free (tmp_string);
+    g_free (tmp_string);
     return;
     }
 
@@ -7009,8 +6996,7 @@ void gsb_file_load_account_part_before_0_6 ( GMarkupParseContext *context,
     tmp_string = utils_str_reduce_exponant_from_string ( text, 2 );
     if (buffer_reconcile_conversion)
         buffer_reconcile_conversion -> final_balance = utils_real_get_from_string (tmp_string);
-    if (tmp_string) 
-        g_free (tmp_string);
+    g_free (tmp_string);
     return;
     }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list