[gnumeric] Fixed double/gnm_float issues.



commit fd375aa55e77ec9dbfe6256e81843102bac7980a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Dec 24 08:26:14 2009 +0100

    Fixed double/gnm_float issues.

 plugins/excel/ChangeLog                       |    8 ++++++++
 plugins/excel/xlsx-read-pivot.c               |    4 ++--
 plugins/excel/xlsx-read.c                     |   18 +++++++++---------
 plugins/sample_datasource/ChangeLog           |    4 ++++
 plugins/sample_datasource/sample_datasource.c |    2 +-
 src/tools/ChangeLog                           |    7 +++++++
 src/tools/analysis-anova.c                    |    4 ++--
 src/tools/analysis-chi-squared.c              |    2 +-
 8 files changed, 34 insertions(+), 15 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index dfed1ee..e9b29d4 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-24  Jean Brefort  <jean brefort normalesup org>
+
+	* xlsx-read-pivot.c (xlsx_CT_Number),
+	(xlsx_CT_pivotCacheDefinition): fixed double/gnm_float issues.
+	* xlsx-read.c (xlsx_axis_bound), (elem_color), (xlsx_CT_Row),
+	(xlsx_CT_Col), (xlsx_CT_SheetFormatPr), (xlsx_CT_PageMargins),
+	(xlsx_CT_Top10), (xlsx_CT_Pane), (xlsx_CT_FontSize): ditto.
+
 2009-12-21  Jean Brefort  <jean brefort normalesup org>
 
 	* ms-chart.c (lineformat), (chart_write_LINEFORMAT): fix import export
diff --git a/plugins/excel/xlsx-read-pivot.c b/plugins/excel/xlsx-read-pivot.c
index 87b13e3..9abef67 100644
--- a/plugins/excel/xlsx-read-pivot.c
+++ b/plugins/excel/xlsx-read-pivot.c
@@ -708,7 +708,7 @@ xlsx_CT_Missing (GsfXMLIn *xin, xmlChar const **attrs)
 static void
 xlsx_CT_Number (GsfXMLIn *xin, xmlChar const **attrs)
 {
-	double v;
+	gnm_float v;
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
 		if (attr_float (xin, attrs, "v", &v))
@@ -855,7 +855,7 @@ xlsx_CT_pivotCacheDefinition (GsfXMLIn *xin, xmlChar const **attrs)
 	unsigned int createdVersion = 0;
 	unsigned int refreshedVersion = 0;
 	gboolean upgradeOnRefresh = FALSE;
-	double v;
+	gnm_float v;
 
 	state->pivot.cache_record_part_id = NULL;
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 9364d9d..398b94f 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1173,7 +1173,7 @@ static void
 xlsx_axis_bound (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
-	double val;
+	gnm_float val;
 	if (state->axis.info && simple_float (xin, attrs, &val))
 		gog_dataset_set_dim (GOG_DATASET (state->axis.obj),
 			xin->node->user_data.v_int,
@@ -2458,7 +2458,7 @@ elem_color (GsfXMLIn *xin, xmlChar const **attrs)
 	XLSXReadState	*state = (XLSXReadState *)xin->user_state;
 	int indx;
 	GOColor c;
-	double tint = 0.;
+	gnm_float tint = 0.;
 	gboolean has_color = FALSE;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
@@ -2696,7 +2696,7 @@ xlsx_CT_Row (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
 	int row = -1, xf_index;
-	double h = -1.;
+	gnm_float h = -1.;
 	int cust_fmt = FALSE, cust_height = FALSE, collapsed = FALSE;
 	int hidden = -1;
 	int outline = -1;
@@ -2739,7 +2739,7 @@ xlsx_CT_Col (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
 	int first = -1, last = -1, xf_index;
-	double width = -1.;
+	gnm_float width = -1.;
 	gboolean cust_width = FALSE, best_fit = FALSE, collapsed = FALSE;
 	int i, hidden = -1;
 	int outline = -1;
@@ -2847,7 +2847,7 @@ static void
 xlsx_CT_SheetFormatPr (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
-	double h;
+	gnm_float h;
 	int i;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -2866,7 +2866,7 @@ static void
 xlsx_CT_PageMargins (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
-	double margin;
+	gnm_float margin;
 	PrintInformation *pi = state->sheet->print_info;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -3219,7 +3219,7 @@ xlsx_CT_Top10 (GsfXMLIn *xin, xmlChar const **attrs)
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
 	gboolean top = TRUE;
 	gboolean percent = FALSE;
-	double val = -1.;
+	gnm_float val = -1.;
 	GnmFilterCondition *cond;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -3810,7 +3810,7 @@ xlsx_CT_Pane (GsfXMLIn *xin, xmlChar const **attrs)
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
 	GnmCellPos topLeft;
 	int tmp;
-	double xSplit = -1., ySplit = -1.;
+	gnm_float xSplit = -1., ySplit = -1.;
 	gboolean frozen = FALSE;
 
 	g_return_if_fail (state->sv != NULL);
@@ -4494,7 +4494,7 @@ static void
 xlsx_CT_FontSize (GsfXMLIn *xin, xmlChar const **attrs)
 {
 	XLSXReadState *state = (XLSXReadState *)xin->user_state;
-	double val;
+	gnm_float val;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
 		if (attr_float (xin, attrs, "val", &val))
diff --git a/plugins/sample_datasource/ChangeLog b/plugins/sample_datasource/ChangeLog
index 20d50f2..0fbe99a 100644
--- a/plugins/sample_datasource/ChangeLog
+++ b/plugins/sample_datasource/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-24  Jean Brefort  <jean brefort normalesup org>
+
+	* sample_datasource.c (cb_atl_input): fixed double/gnm_float issues.
+
 2009-12-15  Morten Welinder <terra gnome org>
 
 	* Release 1.9.17
diff --git a/plugins/sample_datasource/sample_datasource.c b/plugins/sample_datasource/sample_datasource.c
index 21b24cd..6755bee 100644
--- a/plugins/sample_datasource/sample_datasource.c
+++ b/plugins/sample_datasource/sample_datasource.c
@@ -133,7 +133,7 @@ cb_atl_input (GIOChannel *gioc, GIOCondition cond, gpointer ignored)
 
 				g_hash_table_foreach (wv->deps,
 					cb_watcher_queue_recalc, NULL);
-				g_printerr ("'%s' <= %f\n", sym, val);
+				g_printerr ("'%s' <= %" GNM_FORMAT_f "\n", sym, val);
 			}
 		}
 	}
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 6b9bfdd..a12080a 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-24  Jean Brefort  <jean brefort normalesup org>
+
+	* analysis-anova.c
+	(analysis_tool_anova_two_factor_no_rep_engine_run),
+	(analysis_tool_anova_two_factor_engine_run): fixed double/gnm_float issues.
+	* analysis-chi-squared.c (analysis_tool_chi_squared_engine_run): ditto.
+
 2009-12-22 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* analysis-tools.c (analysis_tool_regression_engine_run): try to
diff --git a/src/tools/analysis-anova.c b/src/tools/analysis-anova.c
index 1a1e527..f3fa841 100644
--- a/src/tools/analysis-anova.c
+++ b/src/tools/analysis-anova.c
@@ -379,7 +379,7 @@ analysis_tool_anova_two_factor_no_rep_engine_run (data_analysis_output_t *dao,
 			  gnm_expr_new_constant (value_new_float (info->alpha)),
 			  make_cellref (-4, 0),
 			  make_cellref (-4, 1)));
-		cc = g_strdup_printf ("%s = %.2f", "\xce\xb1", info->alpha);
+		cc = g_strdup_printf ("%s = %.2" GNM_FORMAT_f, "\xce\xb1", info->alpha);
 		dao_set_cell_comment (dao, 5, 0, cc);
 		dao_set_cell_comment (dao, 5, 1, cc);
 		g_free (cc);
@@ -784,7 +784,7 @@ analysis_tool_anova_two_factor_engine_run (data_analysis_output_t *dao,
 			  gnm_expr_new_constant (value_new_float (info->alpha)),
 			  make_cellref (-4, 0),
 			  make_cellref (-4, 1)));
-		cc = g_strdup_printf ("%s = %.2f", "\xce\xb1", info->alpha);
+		cc = g_strdup_printf ("%s = %.2" GNM_FORMAT_f, "\xce\xb1", info->alpha);
 		dao_set_cell_comment (dao, 5, 0, cc);
 		dao_set_cell_comment (dao, 5, 1, cc);
 		dao_set_cell_comment (dao, 5, 2, cc);
diff --git a/src/tools/analysis-chi-squared.c b/src/tools/analysis-chi-squared.c
index 4d7c9f5..a5060a9 100644
--- a/src/tools/analysis-chi-squared.c
+++ b/src/tools/analysis-chi-squared.c
@@ -82,7 +82,7 @@ analysis_tool_chi_squared_engine_run (data_analysis_output_t *dao,
 					"/Degrees of Freedom:"
 					"/p-Value:"
 					"/Critical Value:"));
-	cc = g_strdup_printf ("%s = %.2f", "\xce\xb1", info->alpha);
+	cc = g_strdup_printf ("%s = %.2" GNM_FORMAT_f, "\xce\xb1", info->alpha);
 	dao_set_cell_comment (dao, 0, 4, cc);
 	g_free (cc);
 



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