X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fmeasure.c;h=358958550199c43f148ba638f9afcf2e56eab03a;hb=232b19c50410590a705a9f4917c20500fb15c100;hp=3376de8fbd05c4be2b134a1d73f2ddc859e701b2;hpb=e2da62d735c597afeef2e0e9b36e5a4a83d7da94;p=pspp diff --git a/src/output/measure.c b/src/output/measure.c index 3376de8fbd..3589585501 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" @@ -296,9 +297,12 @@ get_default_paper_size (int *h, int *v) return read_paper_conf (getenv ("PAPERCONF"), h, 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); + /* LC_PAPER is a non-standard glibc extension. + The (int)(intptr_t) cast is for 64 Bit Systems where intptr_t + translates to 64 Bit long int but the upper 32 Bits have wrong + values. The result from nl_langinfo is integer (32 Bit) */ + *h = (int)(intptr_t) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4); + *v = (int)(intptr_t) nl_langinfo(_NL_PAPER_HEIGHT) * (72000 / 25.4); if (*h > 0 && *v > 0) return true; #endif