[gnumeric] compilation: no more float.



commit d2cc4b804f6fa85e05d1cddbe45bc1fd129151f5
Author: Morten Welinder <terra gnome org>
Date:   Mon Nov 30 11:08:54 2009 -0500

    compilation: no more float.

 plugins/excel/ms-excel-read.c        |   14 +++++++-------
 plugins/excel/ms-excel-util.h        |    2 +-
 plugins/excel/ms-excel-write.c       |    2 +-
 plugins/openoffice/openoffice-read.c |    2 +-
 src/sheet-control-gui.c              |    2 +-
 src/sheet-filter.c                   |    2 +-
 src/sheet-object-cell-comment.c      |    2 +-
 src/sheet-object.c                   |    8 ++++----
 src/sheet-object.h                   |    4 ++--
 src/workbook-view.c                  |    2 +-
 src/xml-sax-read.c                   |    4 ++--
 11 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index b22550b..e4e50f0 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -383,10 +383,10 @@ ms_sheet_map_color (ExcelReadSheet const *esheet, MSObj const *obj, MSObjAttrID
 static gboolean
 ms_sheet_obj_anchor_to_pos (Sheet const * sheet, MsBiffVersion const ver,
 			    guint8 const *raw_anchor,
-			    GnmRange *range, float offset[4])
+			    GnmRange *range, double offset[4])
 {
 	/* NOTE :
-	 * float const row_denominator = (ver >= MS_BIFF_V8) ? 256. : 1024.;
+	 * gnm_float const row_denominator = (ver >= MS_BIFF_V8) ? 256. : 1024.;
 	 * damn damn damn
 	 * chap03-1.xls suggests that XL95 uses 256 too
 	 * Do we have any tests that confirm the docs contention of 1024 ?
@@ -491,7 +491,7 @@ handle_arrow_head (SheetObject *so, const char *prop_name,
 static gboolean
 ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
 {
-	float offsets[4];
+	double offsets[4];
 	PangoAttrList *markup;
 	GnmRange range;
 	ExcelReadSheet *esheet;
@@ -3808,7 +3808,7 @@ excel_read_XCT (BiffQuery *q, GnmXLImporter *importer)
 }
 
 static XL_font_width const *
-xl_find_fontspec (ExcelReadSheet *esheet, float *size20)
+xl_find_fontspec (ExcelReadSheet *esheet, double *size20)
 {
 	/* Use the 'Normal' Style which is by definition the 0th */
 	BiffXFData const *xf = excel_get_xf (esheet, 0);
@@ -3955,7 +3955,7 @@ static void
 excel_read_COLINFO (BiffQuery *q, ExcelReadSheet *esheet)
 {
 	int i;
-	float scale, width;
+	double scale, width;
 	guint16 const  firstcol	  = GSF_LE_GET_GUINT16 (q->data);
 	guint16        lastcol	  = GSF_LE_GET_GUINT16 (q->data + 2);
 	int            charwidths = GSF_LE_GET_GUINT16 (q->data + 4);
@@ -3984,7 +3984,7 @@ excel_read_COLINFO (BiffQuery *q, ExcelReadSheet *esheet)
 	 * NOTE: These measurements do NOT correspond to what is shown to the
 	 * user */
 	width = 8. * spec->defcol_unit +
-		(float)(charwidths - spec->colinfo_baseline) / spec->colinfo_step;
+		(double)(charwidths - spec->colinfo_baseline) / spec->colinfo_step;
 	width *= scale * 72./96.;
 
 	if (width <= 0) {	/* Columns are of default width */
@@ -4232,7 +4232,7 @@ static void
 excel_read_DEF_COL_WIDTH (BiffQuery *q, ExcelReadSheet *esheet)
 {
 	guint16 charwidths;
-	float scale;
+	double scale;
 	XL_font_width const *spec = xl_find_fontspec (esheet, &scale);
 
 	XL_CHECK_CONDITION (q->length >= 2);
diff --git a/plugins/excel/ms-excel-util.h b/plugins/excel/ms-excel-util.h
index a087210..7dcbcf9 100644
--- a/plugins/excel/ms-excel-util.h
+++ b/plugins/excel/ms-excel-util.h
@@ -85,7 +85,7 @@ typedef struct {
 	char const *name;
 	int	defcol_unit;
 	int	colinfo_baseline;
-	float	colinfo_step;
+	double	colinfo_step;
 } XL_font_width;
 
 /* Measures base character width for column sizing. Returns width. */
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 61a2f2e..f3a06c5 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -4289,7 +4289,7 @@ excel_write_textbox_or_widget_v8 (ExcelWriteSheet *esheet,
 		: NULL;
 
 	if (IS_CELL_COMMENT (so)) {
-		static float const offset[4] = { .5, .5, .5, .5 };
+		static double const offset[4] = { .5, .5, .5, .5 };
 		GnmRange r;
 
 		r.start = real_anchor->cell_bound.start;
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index a7b5682..4587709 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -3181,7 +3181,7 @@ od_draw_frame (GsfXMLIn *xin, xmlChar const **attrs)
 
 	OOParseState *state = (OOParseState *)xin->user_state;
 	GnmRange cell_base;
-	gfloat frame_offset [4];
+	double frame_offset[4];
 	gchar const *aux = NULL;
 	gdouble height = 0., width = 0., x = 0., y = 0., end_x = 0., end_y = 0.;
 	ColRowInfo const *col, *row;
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index b768977..f98e9ed 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -2032,7 +2032,7 @@ scg_mode_edit_virt (SheetControl *sc)
 
 static int
 calc_obj_place (GnmPane *pane, gint64 canvas_coord, gboolean is_col,
-		float *offset)
+		double *offset)
 {
 	gint64 origin;
 	int colrow;
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index 05678d2..f2eeda6 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -546,7 +546,7 @@ static void
 gnm_filter_add_field (GnmFilter *filter, int i)
 {
 	/* pretend to fill the cell, then clip the X start later */
-	static float const a_offsets[4] = { .0, .0, 1., 1. };
+	static double const a_offsets[4] = { .0, .0, 1., 1. };
 	int n;
 	GnmRange tmp;
 	SheetObjectAnchor anchor;
diff --git a/src/sheet-object-cell-comment.c b/src/sheet-object-cell-comment.c
index af03be2..b141cf9 100644
--- a/src/sheet-object-cell-comment.c
+++ b/src/sheet-object-cell-comment.c
@@ -395,7 +395,7 @@ void
 cell_comment_set_pos (GnmComment *cc, GnmCellPos const *pos)
 {
 	/* top right */
-	static float const a_offsets [4] = { 1., 0., 1., 0. };
+	static double const a_offsets [4] = { 1., 0., 1., 0. };
 	SheetObjectAnchor anchor;
 	GnmRange	  r;
 
diff --git a/src/sheet-object.c b/src/sheet-object.c
index c397b9e..25d6151 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -1044,7 +1044,7 @@ sheet_object_rubber_band_directly (SheetObject const *so)
  * sheet_object_anchor_init :
  * @anchor : #SheetObjectAnchor
  * @r : #GnmRange
- * @offsets : float[4]
+ * @offsets : double[4]
  * @direction : #GODrawingAnchorDir
  *
  * A utility routine to initialize an anchor.  Useful in case we change fields
@@ -1052,7 +1052,7 @@ sheet_object_rubber_band_directly (SheetObject const *so)
  **/
 void
 sheet_object_anchor_init (SheetObjectAnchor *anchor,
-			  GnmRange const *r, float const *offsets,
+			  GnmRange const *r, const double *offsets,
 			  GODrawingAnchorDir direction)
 {
 	int i;
@@ -1064,11 +1064,11 @@ sheet_object_anchor_init (SheetObjectAnchor *anchor,
 	anchor->cell_bound = *r;
 
 	if (offsets == NULL) {
-		static float const defaultVal [4] = { 0., 0., 0., 0. };
+		static double const defaultVal [4] = { 0., 0., 0., 0. };
 		offsets = defaultVal;
 	}
 	for (i = 4; i-- > 0 ; )
-		anchor->offset [i] = offsets [i];
+		anchor->offset[i] = offsets [i];
 
 	anchor->base.direction = direction;
 	/* TODO : add sanity checking to handle offsets past edges of col/row */
diff --git a/src/sheet-object.h b/src/sheet-object.h
index ff7ae39..5cf3730 100644
--- a/src/sheet-object.h
+++ b/src/sheet-object.h
@@ -41,7 +41,7 @@ struct _SheetObjectAnchor {
 	GODrawingAnchor	base;
 
 	GnmRange cell_bound; /* cellpos containing corners */
-	float	 offset [4]; /* offsets from the top left (in LTR of cell_bound) */
+	double	 offset[4];  /* offsets from the top left (in LTR of cell_bound) */
 };
 
 #define SHEET_OBJECT_TYPE     (sheet_object_get_type ())
@@ -118,7 +118,7 @@ void sheet_object_anchor_to_offset_pts	(SheetObjectAnchor const *anchor,
 					 Sheet const *sheet, double *res_pts);
 void sheet_object_anchor_init	(SheetObjectAnchor *anchor,
 				 GnmRange const *cell_bound,
-				 float const	*offset,
+				 const double *offsets,
 				 GODrawingAnchorDir direction);
 SheetObjectAnchor *
      sheet_object_anchor_dup	(SheetObjectAnchor const *src);
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 1b9184c..04da4e1 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -311,7 +311,7 @@ wb_view_style_feedback (WorkbookView *wbv)
 
 	if (NULL != wbv->in_cell_combo)
 	{
-		float const a_offsets [4] = { 0., 0., 1., 1. };
+		const double a_offsets [4] = { 0., 0., 1., 1. };
 		SheetObjectAnchor  anchor;
 		GnmRange corner;
 		GnmRange const *r;
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index 030dfd2..5841618 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -2150,7 +2150,7 @@ xml_sax_read_obj (GsfXMLIn *xin, gboolean needs_cleanup,
 	GnmRange		anchor_r;
 	GODrawingAnchorDir	anchor_dir;
 	SheetObjectAnchor	anchor;
-	float			f_tmp[4], *anchor_offset = NULL;
+	double			f_tmp[4], *anchor_offset = NULL;
 
 	g_return_if_fail (state->so == NULL);
 
@@ -2217,7 +2217,7 @@ xml_sax_read_obj (GsfXMLIn *xin, gboolean needs_cleanup,
 		else if (attr_eq (attrs[i], "ObjectBound"))
 			range_parse (&anchor_r, CXML2C (attrs[i + 1]), gnm_sheet_get_size (state->sheet));
 		else if (attr_eq (attrs[i], "ObjectOffset") &&
-			4 == sscanf (CXML2C (attrs[i + 1]), "%g %g %g %g",
+			4 == sscanf (CXML2C (attrs[i + 1]), "%lg %lg %lg %lg",
 				     f_tmp + 0, f_tmp + 1, f_tmp + 2, f_tmp + 3))
 			anchor_offset = f_tmp;
 		else if (gnm_xml_attr_int (attrs+i, "Direction", &tmp_int))



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