From de83edb3520e41434d6bc7c9c0193ecab0f533a3 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sun, 22 Aug 2010 11:10:12 +0000 Subject: [PATCH] And more const-correctnes in SchedXaction.h git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19462 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/xml/gnc-schedxaction-xml-v2.c | 2 +- src/engine/SchedXaction.c | 6 +++--- src/engine/SchedXaction.h | 6 +++--- src/engine/test-core/test-engine-stuff.c | 10 +++++----- src/engine/test-core/test-engine-stuff.h | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/backend/xml/gnc-schedxaction-xml-v2.c b/src/backend/xml/gnc-schedxaction-xml-v2.c index 793e6f90ae..53127e6792 100644 --- a/src/backend/xml/gnc-schedxaction-xml-v2.c +++ b/src/backend/xml/gnc-schedxaction-xml-v2.c @@ -312,7 +312,7 @@ sx_advRemind_handler( xmlNodePtr node, gpointer sx_pdata ) 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 ); diff --git a/src/engine/SchedXaction.c b/src/engine/SchedXaction.c index 4643a0bca0..714b274920 100644 --- a/src/engine/SchedXaction.c +++ b/src/engine/SchedXaction.c @@ -581,7 +581,7 @@ xaccSchedXactionGetStartDate(const SchedXaction *sx ) } 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 @@ xaccSchedXactionGetEndDate(const SchedXaction *sx ) } 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 @@ xaccSchedXactionGetLastOccurDate(const SchedXaction *sx ) } 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) diff --git a/src/engine/SchedXaction.h b/src/engine/SchedXaction.h index e57235d0fb..96b04ca96a 100644 --- a/src/engine/SchedXaction.h +++ b/src/engine/SchedXaction.h @@ -161,7 +161,7 @@ gchar *xaccSchedXactionGetName( const SchedXaction *sx ); 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 @@ const GDate* xaccSchedXactionGetEndDate(const SchedXaction *sx ); /** * 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 diff --git a/src/engine/test-core/test-engine-stuff.c b/src/engine/test-core/test-engine-stuff.c index 747186f04c..332638ab84 100644 --- a/src/engine/test-core/test-engine-stuff.c +++ b/src/engine/test-core/test-engine-stuff.c @@ -2189,7 +2189,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types) } 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 @@ daily_freq(GDate* start, int multiplier) } 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 @@ once_freq(GDate *when) } 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 @@ add_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur, Recurrence *r) } 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)); } diff --git a/src/engine/test-core/test-engine-stuff.h b/src/engine/test-core/test-engine-stuff.h index 49ff178f51..51cf4ca78c 100644 --- a/src/engine/test-core/test-engine-stuff.h +++ b/src/engine/test-core/test-engine-stuff.h @@ -89,8 +89,8 @@ void make_random_changes_to_level (QofBook *book, Account *parent); 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