[gnumeric] Constify.



commit e539c19e0a83517578d730556f43c1c8a7b4640f
Author: Morten Welinder <terra gnome org>
Date:   Sat May 2 18:39:55 2009 -0400

    Constify.
---
 ChangeLog      |    5 +++++
 NEWS           |    2 +-
 src/position.c |   11 ++++++-----
 src/position.h |    6 +++---
 src/sheet.c    |    3 +--
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0c035ec..3faff91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-02  Morten Welinder  <terra gnome org>
+
+	* src/position.c (eval_pos_init_sheet, parse_pos_init,
+	parse_pos_init_sheet): Constify.
+
 2009-05-02  Jean Brefort  <jean brefort normalesup org>
 
 	* src/graph.c (render_val): don't crash with a NULL value. [#581120]
diff --git a/NEWS b/NEWS
index c10af12..2363363 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Jean:
 Jody:
 	* XLSX start reading external refs.
 	* XL2003-XML enable the use of builtin formats, and drop '.sml' kludge.
-	* Add pref entry to set default value of autsave.
+	* Add pref entry to set default value of autosave.
 
 Morten:
 	* Fix xls save problem with sheets that are too big for the format.
diff --git a/src/position.c b/src/position.c
index 725587b..7dd707d 100644
--- a/src/position.c
+++ b/src/position.c
@@ -127,13 +127,13 @@ eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
 }
 
 GnmEvalPos *
-eval_pos_init_sheet (GnmEvalPos *ep, Sheet *sheet)
+eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet)
 {
 	g_return_val_if_fail (ep != NULL, NULL);
 	g_return_val_if_fail (IS_SHEET (sheet), NULL);
 
 	ep->eval.col = ep->eval.row = 0;
-	ep->sheet = sheet;
+	ep->sheet = (Sheet *)sheet;
 	ep->dep   = NULL;
 	ep->array = NULL;
 
@@ -153,7 +153,8 @@ eval_pos_init_sheet (GnmEvalPos *ep, Sheet *sheet)
  * ParsePosition.
  */
 GnmParsePos *
-parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet *sheet, int col, int row)
+parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet const *sheet,
+		int col, int row)
 {
 	/* Global */
 	if (wb == NULL && sheet == NULL)
@@ -161,7 +162,7 @@ parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet *sheet, int col, int row)
 
 	g_return_val_if_fail (pp != NULL, NULL);
 
-	pp->sheet = sheet;
+	pp->sheet = (Sheet *)sheet;
 	pp->wb = sheet ? sheet->workbook : wb;
 	pp->eval.col = col;
 	pp->eval.row = row;
@@ -219,7 +220,7 @@ parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
 }
 
 GnmParsePos *
-parse_pos_init_sheet (GnmParsePos *pp, Sheet *sheet)
+parse_pos_init_sheet (GnmParsePos *pp, Sheet const *sheet)
 {
 	g_return_val_if_fail (pp != NULL, NULL);
 	g_return_val_if_fail (IS_SHEET (sheet), NULL);
diff --git a/src/position.h b/src/position.h
index fe10135..fc9fd89 100644
--- a/src/position.h
+++ b/src/position.h
@@ -31,16 +31,16 @@ GnmEvalPos  *eval_pos_init_pos	   (GnmEvalPos *ep, Sheet *s, GnmCellPos const *p
 GnmEvalPos  *eval_pos_init_dep	   (GnmEvalPos *ep, GnmDependent const *dep);
 GnmEvalPos  *eval_pos_init_cell	   (GnmEvalPos *ep, GnmCell const *cell);
 GnmEvalPos  *eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv);
-GnmEvalPos  *eval_pos_init_sheet   (GnmEvalPos *ep, Sheet *sheet);
+GnmEvalPos  *eval_pos_init_sheet   (GnmEvalPos *ep, Sheet const *sheet);
 
 /* Initialization routines for Parse Positions */
 GnmParsePos *parse_pos_init         (GnmParsePos *pp, Workbook *wb,
-				     Sheet *sheet, int col, int row);
+				     Sheet const *sheet, int col, int row);
 GnmParsePos *parse_pos_init_dep	    (GnmParsePos *pp, GnmDependent const *dep);
 GnmParsePos *parse_pos_init_cell    (GnmParsePos *pp, GnmCell const *cell);
 GnmParsePos *parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *pos);
 GnmParsePos *parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv);
-GnmParsePos *parse_pos_init_sheet   (GnmParsePos *pp, Sheet *sheet);
+GnmParsePos *parse_pos_init_sheet   (GnmParsePos *pp, Sheet const *sheet);
 
 /*****************************************************************************/
 
diff --git a/src/sheet.c b/src/sheet.c
index 6f2c915..de9d42b 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -2056,8 +2056,7 @@ sheet_get_nominal_printarea (Sheet const *sheet)
 
 	g_return_val_if_fail (IS_SHEET (sheet), print_area);
 
-	/* GnmParsePos should really have Sheet const * */
-	parse_pos_init_sheet (&pos, (Sheet *) sheet);
+	parse_pos_init_sheet (&pos, sheet);
 	nexpr = expr_name_lookup (&pos, "Print_Area");
 	if (nexpr != NULL) {
 		val = gnm_expr_top_get_range (nexpr->texpr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]