From 4a55590001dee960815ebb476c877568514cdafa Mon Sep 17 00:00:00 2001
From: Jan Thorbecke <janth@xs4all.nl>
Date: Thu, 7 Mar 2019 17:56:53 +0100
Subject: [PATCH] general

---
 FFTlib/ccmfft.c       | 5 +++--
 FFTlib/cr1fft.c       | 3 ++-
 FFTlib/crmfft.c       | 5 +++--
 FFTlib/rc1fft.c       | 3 ++-
 FFTlib/rcmfft.c       | 5 +++--
 Make_include_template | 2 +-
 6 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/FFTlib/ccmfft.c b/FFTlib/ccmfft.c
index b9f47f3..cca95cb 100644
--- a/FFTlib/ccmfft.c
+++ b/FFTlib/ccmfft.c
@@ -67,6 +67,7 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign)
     static DFTI_DESCRIPTOR_HANDLE handle=0;
     static int nprev=0;
     MKL_LONG Status;
+	int j;
 #endif
 
 #if defined(HAVE_LIBSCS)
@@ -114,12 +115,12 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign)
         nprev = n1;
     }
     if (sign < 0) {
-    	for (int j=0; j<n2; j++) {
+    	for (j=0; j<n2; j++) {
         	Status = DftiComputeBackward(handle, &data[j*ld1]);
 		}
     }
     else {
-    	for (int j=0; j<n2; j++) {
+    	for (j=0; j<n2; j++) {
         	Status = DftiComputeForward(handle, &data[j*ld1]);
 		}
     }
diff --git a/FFTlib/cr1fft.c b/FFTlib/cr1fft.c
index 2881d00..1182f3c 100644
--- a/FFTlib/cr1fft.c
+++ b/FFTlib/cr1fft.c
@@ -61,6 +61,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign)
     static int nprev=0;
 	REAL *tmp;
     MKL_LONG Status;
+	int i;
 #endif
 
 #if defined(HAVE_LIBSCS)
@@ -132,7 +133,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign)
         printf(" DftiComputeBackward FAIL\n");
     }
     rdata[0] = tmp[0];
-    for (int i=1; i<n; i++) {
+    for (i=1; i<n; i++) {
         rdata[i] = -sign*tmp[n-i];
     }
 	free(tmp);
diff --git a/FFTlib/crmfft.c b/FFTlib/crmfft.c
index 0e3242c..cfc8feb 100644
--- a/FFTlib/crmfft.c
+++ b/FFTlib/crmfft.c
@@ -75,6 +75,7 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s
     static int nprev=0;
     REAL *tmp;
     MKL_LONG Status;
+	int i, j;
 #endif
 
 #if defined(HAVE_LIBSCS)
@@ -166,10 +167,10 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s
         nprev = n1;
     }
     tmp = (float *)malloc(n1*sizeof(float));
-    for (int j=0; j<n2; j++) {
+    for (j=0; j<n2; j++) {
     	Status = DftiComputeBackward(handle, (MKL_Complex8 *)&cdata[j*ldc], tmp);
     	rdata[j*ldr] = tmp[0];
-    	for (int i=1; i<n1; i++) {
+    	for (i=1; i<n1; i++) {
         	rdata[j*ldr+i] = -sign*tmp[n1-i];
     	}
 	}
diff --git a/FFTlib/rc1fft.c b/FFTlib/rc1fft.c
index 77cae6a..6373d17 100644
--- a/FFTlib/rc1fft.c
+++ b/FFTlib/rc1fft.c
@@ -60,6 +60,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign)
 	static DFTI_DESCRIPTOR_HANDLE handle=0;
 	static int nprev=0;
     MKL_LONG Status;
+	int i;
 #endif
 
 #if defined(HAVE_LIBSCS)
@@ -132,7 +133,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign)
 		dfti_status_print(Status);
 		printf(" DftiComputeForward FAIL\n");
 	}
-	for (int i=1; i<((n-1)/2)+1; i++) {
+	for (i=1; i<((n-1)/2)+1; i++) {
 		cdata[i].i *= -sign;
 	}
 
diff --git a/FFTlib/rcmfft.c b/FFTlib/rcmfft.c
index c2d2524..5c492fa 100644
--- a/FFTlib/rcmfft.c
+++ b/FFTlib/rcmfft.c
@@ -72,6 +72,7 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s
     static DFTI_DESCRIPTOR_HANDLE handle=0;
     static int nprev=0;
     MKL_LONG Status;
+	int i,j;
 #endif
 
 #if defined(HAVE_LIBSCS)
@@ -160,9 +161,9 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s
         dfti_status_print(Status);
         printf(" DftiComputeForward FAIL\n");
     }
-	for (int j=0; j<n2; j++) {
+	for (j=0; j<n2; j++) {
     	Status = DftiComputeForward(handle, &rdata[j*ldr], (MKL_Complex8 *)&cdata[j*ldc]);
-    	for (int i=1; i<((n1-1)/2)+1; i++) {
+    	for (i=1; i<((n1-1)/2)+1; i++) {
         	cdata[j*ldc+i].i *= -sign;
     	}
     }
diff --git a/Make_include_template b/Make_include_template
index 44f672f..0add2e1 100644
--- a/Make_include_template
+++ b/Make_include_template
@@ -47,7 +47,7 @@ OPTC += -fopenmp
 ### Linux
 ##OPTC = -O3 -no-prec-div -qopt-report-phase=vec,openmp
 ##OPTF = -O3 -no-prec-div -qopt-report-phase=vec,openmp
-#OPTC = -O3 -no-prec-div -xCORE-AVX2
+#OPTC = -O3 -no-prec-div -xCORE-AVX2 
 #OPTF = -O3 -no-prec-div -xCORE-AVX2
 ##to include parallelisation with OpenMP
 #OPTC += -qopenmp
-- 
GitLab