From d7a8159acf53f6bf70940d711b32348b6ae75f16 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 9 Mar 2014 16:02:10 -0700 Subject: [PATCH] Fix warnings about casts between pointers and differently sized integers. Doesn't seem to fix any real problems, but GCC on x86-64 complained. --- src/output/measure.c | 7 ++++--- src/ui/gui/psppire-spreadsheet-model.c | 16 +++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/output/measure.c b/src/output/measure.c index 3376de8fbd..35e5fb3f45 100644 --- a/src/output/measure.c +++ b/src/output/measure.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #if HAVE_LC_PAPER #include #endif +#include #include #include "data/file-name.h" @@ -297,8 +298,8 @@ get_default_paper_size (int *h, int *v) #if HAVE_LC_PAPER /* LC_PAPER is a non-standard glibc extension. */ - *h = (int) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4); - *v = (int) nl_langinfo(_NL_PAPER_HEIGHT) * (72000 / 25.4); + *h = (intptr_t) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4); + *v = (intptr_t) nl_langinfo(_NL_PAPER_HEIGHT) * (72000 / 25.4); if (*h > 0 && *v > 0) return true; #endif diff --git a/src/ui/gui/psppire-spreadsheet-model.c b/src/ui/gui/psppire-spreadsheet-model.c index f5be69d870..d02c1c558c 100644 --- a/src/ui/gui/psppire-spreadsheet-model.c +++ b/src/ui/gui/psppire-spreadsheet-model.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2013 Free Software Foundation + Copyright (C) 2013, 2014 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,8 @@ #include #include +#include + #include #define _(msgid) gettext (msgid) #define N_(msgid) msgid @@ -210,7 +212,7 @@ tree_model_get_iter (GtkTreeModel * model, GtkTreeIter * iter, n = indices[0]; iter->stamp = spreadsheetModel->stamp; - iter->user_data = (gpointer) n; + iter->user_data = (gpointer) (intptr_t) n; return TRUE; } @@ -225,7 +227,7 @@ tree_model_iter_next (GtkTreeModel *model, GtkTreeIter *iter) if (iter == NULL) return FALSE; - if ((gint) iter->user_data >= spreadsheetModel->spreadsheet->n_sheets - 1) + if ((intptr_t) iter->user_data >= spreadsheetModel->spreadsheet->n_sheets - 1) { iter->user_data = NULL; iter->stamp = 0; @@ -254,7 +256,7 @@ tree_model_get_value (GtkTreeModel * model, GtkTreeIter * iter, { const char *x = spreadsheet_get_sheet_name (spreadsheetModel->spreadsheet, - (gint) iter->user_data); + (intptr_t) iter->user_data); g_value_set_string (value, x); } @@ -263,7 +265,7 @@ tree_model_get_value (GtkTreeModel * model, GtkTreeIter * iter, { char *x = spreadsheet_get_sheet_range (spreadsheetModel->spreadsheet, - (gint) iter->user_data); + (intptr_t) iter->user_data); g_value_set_string (value, x ? x : _("(empty)")); g_free (x); @@ -290,7 +292,7 @@ tree_model_nth_child (GtkTreeModel * model, GtkTreeIter * iter, return FALSE; iter->stamp = spreadsheetModel->stamp; - iter->user_data = (gpointer) n; + iter->user_data = (gpointer) (intptr_t) n; return TRUE; } @@ -319,7 +321,7 @@ tree_model_get_path (GtkTreeModel * model, GtkTreeIter * iter) PsppireSpreadsheetModel *spreadsheetModel = PSPPIRE_SPREADSHEET_MODEL (model); GtkTreePath *path; - gint index = (gint) iter->user_data; + gint index = (intptr_t) iter->user_data; g_return_val_if_fail (iter->stamp == spreadsheetModel->stamp, NULL); -- 2.30.2