[Commits] [svn:einsteintoolkit] SphericalHarmonicDecomp/trunk/src/ (Rev. 10)
knarf at cct.lsu.edu
knarf at cct.lsu.edu
Sun Nov 25 21:24:15 CST 2012
User: knarf
Date: 2012/11/25 09:24 PM
Modified:
/trunk/src/
ExtractMetric.cc, SphericalHarmonicDecomp.h, alias.cc, h5read.cc, matrix.cc
Log:
remove a few compiler warnings
File Changes:
Directory: /trunk/src/
======================
File [modified]: ExtractMetric.cc
Delta lines: +9 -6
===================================================================
--- trunk/src/ExtractMetric.cc 2012-11-05 16:05:48 UTC (rev 9)
+++ trunk/src/ExtractMetric.cc 2012-11-26 03:24:14 UTC (rev 10)
@@ -46,10 +46,12 @@
+#ifdef TEST_DECOMP
static void fill_in_data(CCTK_REAL time, int s, int nl, int nn,
int npoints, CCTK_REAL Rin, CCTK_REAL Rout,
const CCTK_REAL xb[], const CCTK_REAL yb[],
const CCTK_REAL zb[], CCTK_REAL re[], CCTK_REAL im[]);
+#endif
static int interp_fields(const cGH* cctkGH,
@@ -92,7 +94,6 @@
static CCTK_REAL *yb[MAX_RADII];
static CCTK_REAL *zb[MAX_RADII];
static double *radius[MAX_RADII];
- static double *X = NULL;
static CCTK_REAL *re_f = NULL;
static CCTK_REAL *im_f = NULL;
@@ -108,7 +109,7 @@
myassert (ABS(spin) <= max_spin);
- myassert (num_radii <= sizeof(radius) / sizeof(*radius));
+ myassert (num_radii <= CCTK_INT(sizeof(radius) / sizeof(*radius)));
static int MyProc = CCTK_MyProc(cctkGH);
const char *outdir = *out_dir ? out_dir : io_out_dir;
@@ -118,7 +119,7 @@
if (FirstTime)
{
- for (int i=0; i < sizeof(radius) / sizeof(*radius); i++)
+ for (unsigned int i=0; i < sizeof(radius) / sizeof(*radius); i++)
{
xb[i] = NULL;
yb[i] = NULL;
@@ -274,7 +275,7 @@
if (FirstCall)
{
FirstCall = 0;
- for (int i=0; i < sizeof(last_dump) / sizeof(*last_dump); i++)
+ for (unsigned int i=0; i < sizeof(last_dump) / sizeof(*last_dump); i++)
{
last_dump[i] = -1000;
}
@@ -302,8 +303,8 @@
CCTK_WARN(hdf5_warn_level, "Failed to create hdf5 file");
}
- char name[]="/metadata";
- HDF5_ERROR(group_id = H5Gcreate(file_id, name, 0));
+ char metaname[]="/metadata";
+ HDF5_ERROR(group_id = H5Gcreate(file_id, metaname, 0));
int ds[2] = {nn, nlmmodes};
hsize_t oD2 = 2;
@@ -471,6 +472,7 @@
return 0;
}
+#ifdef TEST_DECOMP
static void fill_in_data(CCTK_REAL time, int s, int nl, int nn,
int npoints, CCTK_REAL Rin, CCTK_REAL Rout,
const CCTK_REAL xb[], const CCTK_REAL yb[],
@@ -514,6 +516,7 @@
im[i] = val.imag();
}
}
+#endif
extern "C"
{
File [modified]: SphericalHarmonicDecomp.h
Delta lines: +1 -1
===================================================================
--- trunk/src/SphericalHarmonicDecomp.h 2012-11-05 16:05:48 UTC (rev 9)
+++ trunk/src/SphericalHarmonicDecomp.h 2012-11-26 03:24:14 UTC (rev 10)
@@ -19,6 +19,6 @@
}
#ifdef USE_LEGENDRE
-# ERROR: Don't activate this option
+# ERROR: Do not activate this option
#endif
#endif
File [modified]: alias.cc
Delta lines: +26 -25
===================================================================
--- trunk/src/alias.cc 2012-11-05 16:05:48 UTC (rev 9)
+++ trunk/src/alias.cc 2012-11-26 03:24:14 UTC (rev 10)
@@ -30,10 +30,12 @@
+#ifdef TEST_DECOMP
static void fill_in_data(int s, int nl, int nn,
int npoints, CCTK_REAL Rin, CCTK_REAL Rout,
const CCTK_REAL xb[], const CCTK_REAL yb[],
const CCTK_REAL zb[], CCTK_REAL re[], CCTK_REAL im[]);
+#endif
static int interp_fields(const cGH* cctkGH,
@@ -416,7 +418,6 @@
char filename[BUFFSIZE];
hid_t file_id;
hsize_t dims[2];
- herr_t status;
DECLARE_CCTK_PARAMETERS;
@@ -437,7 +438,7 @@
H5P_DEFAULT, H5P_DEFAULT);
{
- hid_t dataset_id, attribute_id, dataspace_id;;
+ hid_t attribute_id, dataspace_id;;
int ds[2] = {nn, nlmmodes};
hsize_t oD2 = 2;
hsize_t oD1 = 1;
@@ -445,30 +446,30 @@
dataspace_id = H5Screate_simple(1, &oD2, NULL);
attribute_id = H5Acreate(file_id, "dim", H5T_NATIVE_INT,
dataspace_id, H5P_DEFAULT);
- status = H5Awrite(attribute_id, H5T_NATIVE_INT, ds);
- status = H5Aclose(attribute_id);
- status = H5Sclose(dataspace_id);
+ H5Awrite(attribute_id, H5T_NATIVE_INT, ds);
+ H5Aclose(attribute_id);
+ H5Sclose(dataspace_id);
dataspace_id = H5Screate_simple(1, &oD1, NULL);
attribute_id = H5Acreate(file_id, "spin", H5T_NATIVE_INT,
dataspace_id, H5P_DEFAULT);
- status = H5Awrite(attribute_id, H5T_NATIVE_INT, &s);
- status = H5Aclose(attribute_id);
- status = H5Sclose(dataspace_id);
+ H5Awrite(attribute_id, H5T_NATIVE_INT, &s);
+ H5Aclose(attribute_id);
+ H5Sclose(dataspace_id);
dataspace_id = H5Screate_simple(1, &oD1, NULL);
attribute_id = H5Acreate(file_id, "Rin", H5T_NATIVE_DOUBLE,
dataspace_id, H5P_DEFAULT);
- status = H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &Rin);
- status = H5Aclose(attribute_id);
- status = H5Sclose(dataspace_id);
+ H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &Rin);
+ H5Aclose(attribute_id);
+ H5Sclose(dataspace_id);
dataspace_id = H5Screate_simple(1, &oD1, NULL);
attribute_id = H5Acreate(file_id, "Rout", H5T_NATIVE_DOUBLE,
dataspace_id, H5P_DEFAULT);
- status = H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &Rout);
- status = H5Aclose(attribute_id);
- status = H5Sclose(dataspace_id);
+ H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &Rout);
+ H5Aclose(attribute_id);
+ H5Sclose(dataspace_id);
}
}
@@ -488,29 +489,27 @@
dataspace_id = H5Screate_simple(1, &oneD, NULL);
attribute_id = H5Acreate(group_id, "Time", H5T_NATIVE_DOUBLE,
dataspace_id, H5P_DEFAULT);
- status = H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &time);
- status = H5Aclose(attribute_id);
- status = H5Sclose(dataspace_id);
+ H5Awrite(attribute_id, H5T_NATIVE_DOUBLE, &time);
+ H5Aclose(attribute_id);
+ H5Sclose(dataspace_id);
H5Gclose(group_id);
snprintf(buff, BUFFSIZE-1, "/%d/re", it);
dataspace_id = H5Screate_simple(2, dims, NULL);
dataset_id = H5Dcreate(file_id, buff, H5T_NATIVE_DOUBLE,
dataspace_id, H5P_DEFAULT);
- status = H5Dwrite(dataset_id, H5T_NATIVE_DOUBLE, H5S_ALL,
- H5S_ALL, H5P_DEFAULT, re);
- status = H5Dclose(dataset_id);
- status = H5Sclose(dataspace_id);
+ H5Dwrite(dataset_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, re);
+ H5Dclose(dataset_id);
+ H5Sclose(dataspace_id);
snprintf(buff, BUFFSIZE-1, "/%d/im", it);
dataspace_id = H5Screate_simple(2, dims, NULL);
dataset_id = H5Dcreate(file_id, buff, H5T_NATIVE_DOUBLE,
dataspace_id, H5P_DEFAULT);
- status = H5Dwrite(dataset_id, H5T_NATIVE_DOUBLE, H5S_ALL,
- H5S_ALL, H5P_DEFAULT, im);
- status = H5Dclose(dataset_id);
- status = H5Sclose(dataspace_id);
+ H5Dwrite(dataset_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, im);
+ H5Dclose(dataset_id);
+ H5Sclose(dataspace_id);
}
H5Fclose(file_id);
@@ -589,6 +588,7 @@
return 0;
}
+#ifdef TEST_DECOMP
static void fill_in_data(int s, int nl, int nn,
int npoints, CCTK_REAL Rin, CCTK_REAL Rout,
const CCTK_REAL xb[], const CCTK_REAL yb[],
@@ -632,3 +632,4 @@
im[i] = val.imag();
}
}
+#endif
File [modified]: h5read.cc
Delta lines: +7 -8
===================================================================
--- trunk/src/h5read.cc 2012-11-05 16:05:48 UTC (rev 9)
+++ trunk/src/h5read.cc 2012-11-26 03:24:14 UTC (rev 10)
@@ -31,15 +31,14 @@
int spin;
int dim[2];
- hid_t file_id, dataset_id;
- herr_t status;
+ hid_t file_id;
file_id = H5Fopen(name, H5F_ACC_RDONLY, H5P_DEFAULT);
- status = H5LTget_attribute_int(file_id,"/","spin",&spin);
- status = H5LTget_attribute_int(file_id,"/","dim",dim);
- status = H5LTget_attribute_double(file_id,"/","Rin",&Rin);
- status = H5LTget_attribute_double(file_id,"/","Rout",&Rout);
+ H5LTget_attribute_int(file_id,"/","spin",&spin);
+ H5LTget_attribute_int(file_id,"/","dim",dim);
+ H5LTget_attribute_double(file_id,"/","Rin",&Rin);
+ H5LTget_attribute_double(file_id,"/","Rout",&Rout);
/* the order of the dimensions has changed to C
so dim[0] = nn
@@ -58,7 +57,7 @@
snprintf(buff, BUFFSIZE-1, "/%d", iteration);
- status = H5LTget_attribute_double(file_id,buff, "Time", p_time);
+ H5LTget_attribute_double(file_id,buff, "Time", p_time);
cout << "# Time = " << *p_time << endl;
if (!*p_re)
@@ -73,7 +72,7 @@
snprintf(buff, BUFFSIZE-1, "/%d/im", iteration);
H5LTread_dataset_double(file_id, buff, *p_im);
- status = H5Fclose(file_id);
+ H5Fclose(file_id);
for (int n=0; n < nn; n++)
{
File [modified]: matrix.cc
Delta lines: +1 -1
===================================================================
--- trunk/src/matrix.cc 2012-11-05 16:05:48 UTC (rev 9)
+++ trunk/src/matrix.cc 2012-11-26 03:24:14 UTC (rev 10)
@@ -342,7 +342,7 @@
for (int j = 0; j < ncolumns; j++)
{
complex<double> v = get_val(i,j);
- gsl_complex val = {v.real(), v.imag()};
+ gsl_complex val = {{v.real(), v.imag()}};
gsl_matrix_complex_set(mat, i, j, val);
}
}
More information about the Commits
mailing list