r15207 - gnucash/trunk/src/gnome-utils - Rename private min/max functions to avoid name collisions with existing functions of macros, as suggested by Jon Arney

Christian Stimming cstim at cvs.gnucash.org
Tue Dec 12 06:28:09 EST 2006


Author: cstim
Date: 2006-12-12 06:28:08 -0500 (Tue, 12 Dec 2006)
New Revision: 15207
Trac: http://svn.gnucash.org/trac/changeset/15207

Modified:
   gnucash/trunk/src/gnome-utils/gnc-frequency.c
Log:
Rename private min/max functions to avoid name collisions with existing functions of macros, as suggested by Jon Arney

Modified: gnucash/trunk/src/gnome-utils/gnc-frequency.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-frequency.c	2006-12-12 11:24:14 UTC (rev 15206)
+++ gnucash/trunk/src/gnome-utils/gnc-frequency.c	2006-12-12 11:28:08 UTC (rev 15207)
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include <glib/gtypes.h>
 #include "glib-compat.h"
 #include <math.h>
 #include <time.h>
@@ -977,7 +978,7 @@
         tmptm->tm_mday = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
 
         /* FIXME: correct for
-           option_menu_selected_day > min(31,correct_days_in_month)
+           option_menu_selected_day > minn(31,correct_days_in_month)
            problem */
         while ( ! g_date_valid_dmy( tmptm->tm_mday,
                                     tmptm->tm_mon+1,
@@ -991,12 +992,12 @@
         g_signal_emit_by_name( gf, "changed" );
 }
 
-static inline guint32 min( guint32 a, guint32 b )
+static inline guint32 minn( guint32 a, guint32 b )
 {
         return a > b ? b : a;
 }
 
-static inline guint32 max( guint32 a, guint32 b )
+static inline guint32 maxn( guint32 a, guint32 b )
 {
         return a > b ? a : b;
 }
@@ -1031,10 +1032,10 @@
                 tmpDate = mktime( tmpTm );
                 tmpTm = localtime( &tmpDate );
                 gtk_combo_box_set_active( GTK_COMBO_BOX(o),
-					  min( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
+					  minn( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
                 gtk_combo_box_set_active( GTK_COMBO_BOX(o),
-					  max( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
+					  maxn( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
         }
         break;
         case UIFREQ_MONTHLY:



More information about the gnucash-changes mailing list