r15560 - gnucash/trunk/src/gnome - fix compilation warnings; only leak these strings if we're debugging, though. :p

Josh Sled jsled at cvs.gnucash.org
Sat Feb 10 16:52:05 EST 2007


Author: jsled
Date: 2007-02-10 16:52:04 -0500 (Sat, 10 Feb 2007)
New Revision: 15560
Trac: http://svn.gnucash.org/trac/changeset/15560

Modified:
   gnucash/trunk/src/gnome/dialog-sx-editor.c
Log:
fix compilation warnings; only leak these strings if we're debugging, though. :p


Modified: gnucash/trunk/src/gnome/dialog-sx-editor.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-editor.c	2007-02-10 21:32:26 UTC (rev 15559)
+++ gnucash/trunk/src/gnome/dialog-sx-editor.c	2007-02-10 21:52:04 UTC (rev 15560)
@@ -472,8 +472,7 @@
   g_free( tcds );
 }
 
-static
-void
+static void
 check_credit_debit_balance( gpointer key,
                             gpointer val,
                             gpointer ud )
@@ -483,22 +482,25 @@
         *unbalanced |= !(gnc_numeric_zero_p(
                                  gnc_numeric_sub_fixed( tcds->debitSum,
                                                         tcds->creditSum ) ));
-        
-        if ( gnc_numeric_zero_p( gnc_numeric_sub_fixed( tcds->debitSum,
-                                                        tcds->creditSum ) ) ) {
-             g_debug( "%.8x | true [%s - %s = %s]",
-                      (unsigned int)key,
-                      gnc_numeric_to_string( tcds->debitSum ),
-                      gnc_numeric_to_string( tcds->creditSum ),
-                      gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
-                                                                   tcds->creditSum )) );
-        } else {
-             g_debug( "%.8x | false [%s - %s = %s]",
-                      (unsigned int)key,
-                      gnc_numeric_to_string( tcds->debitSum ),
-                      gnc_numeric_to_string( tcds->creditSum ),
-                      gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
-                                                                   tcds->creditSum )) );
+
+        if (qof_log_check(G_LOG_DOMAIN, QOF_LOG_DEBUG))
+        {
+             if ( gnc_numeric_zero_p( gnc_numeric_sub_fixed( tcds->debitSum,
+                                                             tcds->creditSum ) ) ) {
+                  g_debug( "%p | true [%s - %s = %s]",
+                           key,
+                           gnc_numeric_to_string( tcds->debitSum ),
+                           gnc_numeric_to_string( tcds->creditSum ),
+                           gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
+                                                                        tcds->creditSum )) );
+             } else {
+                  g_debug( "%p | false [%s - %s = %s]",
+                           key,
+                           gnc_numeric_to_string( tcds->debitSum ),
+                           gnc_numeric_to_string( tcds->creditSum ),
+                           gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
+                                                                        tcds->creditSum )) );
+             }
         }
 }
 



More information about the gnucash-changes mailing list