r19462 - gnucash/trunk/src - And more const-correctnes in SchedXaction.h

Christian Stimming cstim at code.gnucash.org
Sun Aug 22 07:10:12 EDT 2010


Author: cstim
Date: 2010-08-22 07:10:12 -0400 (Sun, 22 Aug 2010)
New Revision: 19462
Trac: http://svn.gnucash.org/trac/changeset/19462

Modified:
   gnucash/trunk/src/backend/xml/gnc-schedxaction-xml-v2.c
   gnucash/trunk/src/engine/SchedXaction.c
   gnucash/trunk/src/engine/SchedXaction.h
   gnucash/trunk/src/engine/test-core/test-engine-stuff.c
   gnucash/trunk/src/engine/test-core/test-engine-stuff.h
Log:
And more const-correctnes in SchedXaction.h

Modified: gnucash/trunk/src/backend/xml/gnc-schedxaction-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/gnc-schedxaction-xml-v2.c	2010-08-21 23:52:27 UTC (rev 19461)
+++ gnucash/trunk/src/backend/xml/gnc-schedxaction-xml-v2.c	2010-08-22 11:10:12 UTC (rev 19462)
@@ -312,7 +312,7 @@
 static
 gboolean
 sx_set_date( xmlNodePtr node, SchedXaction *sx,
-             void (*settor)( SchedXaction *sx, GDate *d ) )
+             void (*settor)( SchedXaction *sx, const GDate *d ) )
 {
     GDate *date;
     date = dom_tree_to_gdate( node );

Modified: gnucash/trunk/src/engine/SchedXaction.c
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.c	2010-08-21 23:52:27 UTC (rev 19461)
+++ gnucash/trunk/src/engine/SchedXaction.c	2010-08-22 11:10:12 UTC (rev 19462)
@@ -581,7 +581,7 @@
 }
 
 void
-xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart )
+xaccSchedXactionSetStartDate( SchedXaction *sx, const GDate* newStart )
 {
     gnc_sx_begin_edit(sx);
     sx->start_date = *newStart;
@@ -602,7 +602,7 @@
 }
 
 void
-xaccSchedXactionSetEndDate( SchedXaction *sx, GDate *newEnd )
+xaccSchedXactionSetEndDate( SchedXaction *sx, const GDate *newEnd )
 {
     if ( g_date_valid( newEnd )
             && g_date_compare( newEnd, &sx->start_date ) < 0 )
@@ -629,7 +629,7 @@
 }
 
 void
-xaccSchedXactionSetLastOccurDate(SchedXaction *sx, GDate* new_last_occur)
+xaccSchedXactionSetLastOccurDate(SchedXaction *sx, const GDate* new_last_occur)
 {
     if (g_date_valid(&sx->last_date)
             && g_date_compare(&sx->last_date, new_last_occur) == 0)

Modified: gnucash/trunk/src/engine/SchedXaction.h
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.h	2010-08-21 23:52:27 UTC (rev 19461)
+++ gnucash/trunk/src/engine/SchedXaction.h	2010-08-22 11:10:12 UTC (rev 19462)
@@ -161,7 +161,7 @@
 void xaccSchedXactionSetName( SchedXaction *sx, const gchar *newName );
 
 const GDate* xaccSchedXactionGetStartDate(const SchedXaction *sx );
-void xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart );
+void xaccSchedXactionSetStartDate( SchedXaction *sx, const GDate* newStart );
 
 int xaccSchedXactionHasEndDate( const SchedXaction *sx );
 /**
@@ -171,10 +171,10 @@
 /**
  * Set to an invalid GDate to turn off 'end-date' definition.
 */
-void xaccSchedXactionSetEndDate( SchedXaction *sx, GDate* newEnd );
+void xaccSchedXactionSetEndDate( SchedXaction *sx, const GDate* newEnd );
 
 const GDate* xaccSchedXactionGetLastOccurDate(const SchedXaction *sx );
-void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur );
+void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, const GDate* newLastOccur );
 
 /**
  * Returns true if the scheduled transaction has a defined number of

Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.c
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-stuff.c	2010-08-21 23:52:27 UTC (rev 19461)
+++ gnucash/trunk/src/engine/test-core/test-engine-stuff.c	2010-08-22 11:10:12 UTC (rev 19462)
@@ -2189,7 +2189,7 @@
 }
 
 static Recurrence*
-daily_freq(GDate* start, int multiplier)
+daily_freq(const GDate* start, int multiplier)
 {
     Recurrence *r = g_new0(Recurrence, 1);
     recurrenceSet(r, multiplier, PERIOD_DAY, start, WEEKEND_ADJ_NONE);
@@ -2197,7 +2197,7 @@
 }
 
 static Recurrence*
-once_freq(GDate *when)
+once_freq(const GDate *when)
 {
     Recurrence *r = g_new0(Recurrence, 1);
     recurrenceSet(r, 1, PERIOD_ONCE, when, WEEKEND_ADJ_NONE);
@@ -2205,7 +2205,7 @@
 }
 
 static SchedXaction*
-add_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur, Recurrence *r)
+add_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur, Recurrence *r)
 {
     QofBook *book = qof_session_get_book(gnc_get_current_session());
     SchedXaction *sx = xaccSchedXactionMalloc(book);
@@ -2227,13 +2227,13 @@
 }
 
 SchedXaction*
-add_daily_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur)
+add_daily_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur)
 {
     return add_sx(name, start, end, last_occur, daily_freq(start, 1));
 }
 
 SchedXaction*
-add_once_sx(gchar *name, GDate *when)
+add_once_sx(gchar *name, const GDate *when)
 {
     return add_sx(name, when, NULL, NULL, once_freq(when));
 }

Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.h
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-stuff.h	2010-08-21 23:52:27 UTC (rev 19461)
+++ gnucash/trunk/src/engine/test-core/test-engine-stuff.h	2010-08-22 11:10:12 UTC (rev 19462)
@@ -89,8 +89,8 @@
 void make_random_changes_to_book (QofBook *book);
 void make_random_changes_to_session (QofSession *session);
 
-SchedXaction* add_daily_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur);
-SchedXaction* add_once_sx(gchar *name, GDate *when);
+SchedXaction* add_daily_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur);
+SchedXaction* add_once_sx(gchar *name, const GDate *when);
 void remove_sx(SchedXaction *sx);
 
 #endif



More information about the gnucash-changes mailing list