diff options
author | tradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2000-11-23 21:39:04 +0000 |
---|---|---|
committer | tradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2000-11-23 21:39:04 +0000 |
commit | 8817019f6d31f718986aed295b2af6ca97e404e7 (patch) | |
tree | 298ec1175e7d718fb8bf17c683ae316fd0f280bb /src/Write1D.c | |
parent | c0ae07722d68be265a8d8a8be6583ab78348f95a (diff) |
Fixed gcc verbose warnings about missing prototypes and use of variables
named 'index' which hides a global function index(3).
Also polished grdocs, added missing version and rcs IDs.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@32 94b1c47f-dcfd-45ef-a468-0854c0e9e350
Diffstat (limited to 'src/Write1D.c')
-rw-r--r-- | src/Write1D.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/Write1D.c b/src/Write1D.c index 6213b96..ecc5fd5 100644 --- a/src/Write1D.c +++ b/src/Write1D.c @@ -40,26 +40,26 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write1D_c) cctk_type, cctk_extract_fn, c_type, data, \ format, file) \ { \ - int i; \ + int h; \ cctk_type *typed_data = (cctk_type *) data; \ \ \ if (grouptype == CCTK_GF) \ { \ - for (i = 0; i < hsize; i++) \ + for (h = 0; h < hsize; h++) \ { \ fprintf (file, format, \ - (double) (coord_data[i] + stagger_offset), \ - (c_type) cctk_extract_fn (typed_data[i])); \ + (double) (coord_data[h] + stagger_offset), \ + (c_type) cctk_extract_fn (typed_data[h])); \ } \ } \ else \ { \ - for (i = 0; i < hsize; i++) \ + for (h = 0; h < hsize; h++) \ { \ fprintf (file, format, \ - (double) i, \ - (c_type) cctk_extract_fn (typed_data[i])); \ + (double) h, \ + (c_type) cctk_extract_fn (typed_data[h])); \ } \ } \ } @@ -90,7 +90,7 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write1D_c) @vtype cGH * @vio in @endvar - @var index + @var vindex @vdesc global index of variable to output @vtype int @vio in @@ -102,7 +102,7 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write1D_c) @endvar @@*/ -void IOASCII_Write1D (cGH *GH, int index, const char *alias) +void IOASCII_Write1D (cGH *GH, int vindex, const char *alias) { DECLARE_CCTK_PARAMETERS asciiioGH *myGH; /* IOASCII extension handle */ @@ -128,18 +128,18 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) int upper, lower; struct stat fileinfo; const char *openmode; - const char *extensions[] = {"xl", "yl", "zl", "dl"}; + static char *extensions[] = {"xl", "yl", "zl", "dl"}; char *filename, *type_extension; ioAdvertisedFileDesc advertisedFile; /* get the variable's group index */ - groupindex = CCTK_GroupIndexFromVarI (index); + groupindex = CCTK_GroupIndexFromVarI (vindex); /* check if variable has storage assigned */ if (! CCTK_QueryGroupStorageI (GH, groupindex)) { - fullname = CCTK_FullName (index); + fullname = CCTK_FullName (vindex); CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, "IOASCII_Write1D: No IOASCII_1D output for '%s' (no storage)", fullname); @@ -193,7 +193,7 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) #ifdef DEBUG_IOASCII printf ("\nIn IOASCII Write1D\n------------------\n"); - printf (" Variable index is %d\n",index); + printf (" Variable index is %d\n",vindex); printf (" Alias is -%s-\n",alias); fflush (stdout); #endif @@ -307,9 +307,9 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) { /* FIXME: this can go after the old filename scheme has gone */ advertisedFile.slice = new_filename_scheme ? - slicename : (char *) extensions[i % 4]; + slicename : extensions[i % 4]; advertisedFile.thorn = CCTK_THORNSTRING; - advertisedFile.varname = CCTK_FullName (index); + advertisedFile.varname = CCTK_FullName (vindex); advertisedFile.description = "One-dimensional line plots"; advertisedFile.mimetype = CCTK_Equals (out_style, "gnuplot") ? "application/gnuplot" : "application/x-graph"; @@ -338,7 +338,7 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) { CCTK_VWarn (8, __LINE__, __FILE__, CCTK_THORNSTRING, "IOASCII_Write1D: No coordinate system '%s' found for '%s'", - coord_system, CCTK_VarName (index)); + coord_system, CCTK_VarName (vindex)); } } else @@ -348,7 +348,7 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) } /* get the current time level */ - timelevel = CCTK_NumTimeLevelsFromVarI (index) - 1; + timelevel = CCTK_NumTimeLevelsFromVarI (vindex) - 1; if (timelevel > 0) { timelevel--; @@ -446,11 +446,11 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) } /* get the variable's 1D data */ - if (Hyperslab_GetHyperslab (GH, 0, index, timelevel, 1, origin, + if (Hyperslab_GetHyperslab (GH, 0, vindex, timelevel, 1, origin, directions, &length, &downsample, &data, &hsize) < 0) { - fullname = CCTK_FullName (index); + fullname = CCTK_FullName (vindex); CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOASCII_Write1D: Failed to extract hyperslab for " "variable '%s'", fullname); @@ -465,7 +465,7 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) /* And write it out on processor 0 */ if (myproc == 0 && file[dir] != NULL) { - CCTK_REAL lower, offset; + CCTK_REAL coord_lower, offset; if (group_static_data.grouptype == CCTK_GF) @@ -496,8 +496,8 @@ void IOASCII_Write1D (cGH *GH, int index, const char *alias) } if (have_coords) { - CCTK_CoordRange (GH, &lower, &offset, 1, NULL, "cart3d"); - offset = lower * sqrt (3); + CCTK_CoordRange (GH, &coord_lower, &offset, 1, NULL, "cart3d"); + offset = coord_lower * sqrt (3); } else { |