X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fmeasure.c;h=358958550199c43f148ba638f9afcf2e56eab03a;hb=e0701896ff3fcdc18a26ca1881d8c657833dad77;hp=35e5fb3f451814cad4197bda4529b55a34055dc0;hpb=0df9cdd3df66caf4353128feff3008289cda8115;p=pspp diff --git a/src/output/measure.c b/src/output/measure.c index 35e5fb3f45..3589585501 100644 --- a/src/output/measure.c +++ b/src/output/measure.c @@ -297,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 = (intptr_t) nl_langinfo(_NL_PAPER_WIDTH) * (72000 / 25.4); - *v = (intptr_t) 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