From affa42bf9fc730ec7ab16adc34a9f3ecf8a3efe3 Mon Sep 17 00:00:00 2001 From: tradke Date: Sun, 20 Jun 2004 12:27:58 +0000 Subject: Renamed local variable 'index' into 'vindex' to get rid of gcc compiler warnings about naming variables after global functions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWaveC/trunk@33 071ba4cb-2270-47cd-a45a-3e542e115664 --- src/InitialData.c | 94 +++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 52 deletions(-) diff --git a/src/InitialData.c b/src/InitialData.c index 2261b97..18cee00 100644 --- a/src/InitialData.c +++ b/src/InitialData.c @@ -1,17 +1,17 @@ /*@@ - @file InitialData.c - @date - @author Werner Benger - @desc - Initial data for the 3D Wave Equation - Derived from Tom Goodale - @enddesc - @version $Header$ + @file InitialData.c + @date + @author Werner Benger + @desc + Initial data for the 3D Wave Equation + Derived from Tom Goodale + @enddesc + @version $Id$ @@*/ #include -#include "cctk.h" +#include "cctk.h" #include "cctk_Parameters.h" #include "cctk_Arguments.h" @@ -19,31 +19,26 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusWave_IDScalarWaveC_InitialData_c) -static CCTK_REAL sqr(CCTK_REAL val) -{ - return val*val; -} +#define SQR(val) ((val) * (val)) void IDScalarWaveC_InitialData(CCTK_ARGUMENTS); /*@@ @routine IDScalarWaveC_InitialData - @date + @date @author Tom Goodale - @desc + @desc Set up initial data for the wave equation - @enddesc - @calls - @calledby - @history + @enddesc + @history @hdate Mon Oct 11 11:48:03 1999 @hauthor Werner Benger @hdesc Converted to C++ @hdate Mon Oct 11 11:48:20 1999 @hauthor Tom Goodale @hdesc Added the rest of the initial data. @hdate Thu Feb 17 09:22:01 2000 @hauthor Tom Goodale @hdesc Converted to C - @endhistory + @endhistory @@*/ @@ -51,12 +46,12 @@ void IDScalarWaveC_InitialData(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS - + int i,j,k; CCTK_REAL dt; CCTK_REAL omega; - int index; + int vindex; CCTK_REAL X, Y, Z, R; CCTK_REAL pi; @@ -64,7 +59,7 @@ void IDScalarWaveC_InitialData(CCTK_ARGUMENTS) if(CCTK_Equals(initial_data, "plane")) { - omega = sqrt(sqr(kx)+sqr(ky)+sqr(kz)); + omega = sqrt(SQR(kx)+SQR(ky)+SQR(kz)); for(k=0; k