From 9bb4ff8cfa803518fe0f2e7377e16caf5878f7b8 Mon Sep 17 00:00:00 2001 From: degomme Date: Fri, 11 Mar 2016 15:34:34 +0100 Subject: [PATCH] try to fix that for 32 bits platforms --- examples/smpi/NAS/nas_common.c | 8 ++++---- examples/smpi/NAS/nas_common.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/smpi/NAS/nas_common.c b/examples/smpi/NAS/nas_common.c index 51ac28f479..5783e8c839 100644 --- a/examples/smpi/NAS/nas_common.c +++ b/examples/smpi/NAS/nas_common.c @@ -117,8 +117,8 @@ double timer_read(int n) double vranlc(int n, double x, double a, double *y) { int i; - long i246m1=0x00003FFFFFFFFFFF; - long LLx, Lx, La; + uint64_t i246m1=0x00003FFFFFFFFFFF; + uint64_t LLx, Lx, La; double d2m46; // This doesn't work, because the compiler does the calculation in 32 bits and overflows. No standard way (without @@ -127,8 +127,8 @@ double vranlc(int n, double x, double a, double *y) d2m46=pow(0.5,46); - Lx = (long)x; - La = (long)a; + Lx = (uint64_t)x; + La = (uint64_t)a; //fprintf(stdout,("================== Vranlc ================"); //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La); LLx = Lx; diff --git a/examples/smpi/NAS/nas_common.h b/examples/smpi/NAS/nas_common.h index 1990c0d1cc..4d7f29c2f8 100644 --- a/examples/smpi/NAS/nas_common.h +++ b/examples/smpi/NAS/nas_common.h @@ -8,6 +8,7 @@ #include #include +#include #include #include "mpi.h" -- 2.20.1