summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2015-03-15 06:49:20 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2015-03-15 06:49:20 (GMT)
commit3b90bca5610a4d31f3a3b10c08b77d11ed36c457 (patch)
tree850d19724f17349ab3cba83c2321124f7ccb28b9 /c++
parenta382658282915afb7c288ef80b4d583a8ecc94fb (diff)
downloadhdf5-3b90bca5610a4d31f3a3b10c08b77d11ed36c457.zip
hdf5-3b90bca5610a4d31f3a3b10c08b77d11ed36c457.tar.gz
hdf5-3b90bca5610a4d31f3a3b10c08b77d11ed36c457.tar.bz2
[svn-r26458] Purpose: Fix warnings HDFFV-8658
Description: Fixed many type conversion warnings and unused variables. Platforms tested: Linux/64 (platypus) Linux/32 2.6 (jam) SunOS 5.11 (emu)
Diffstat (limited to 'c++')
-rw-r--r--c++/test/dsets.cpp12
-rw-r--r--c++/test/tattr.cpp52
-rw-r--r--c++/test/tfilter.cpp12
-rw-r--r--c++/test/tobject.cpp4
-rw-r--r--c++/test/trefer.cpp74
-rw-r--r--c++/test/ttypes.cpp2
-rw-r--r--c++/test/tvlstr.cpp40
7 files changed, 106 insertions, 90 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index fc0ea3a..e5c8bf0 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -56,11 +56,14 @@ const H5std_string DSET_TCONV_NAME ("tconv");
const H5std_string DSET_COMPRESS_NAME("compressed");
const H5std_string DSET_BOGUS_NAME ("bogus");
+/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
-// Local prototypes
+#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+#endif
+static size_t filter_bogus(size_t nbytes);
/*-------------------------------------------------------------------------
* Function: test_create
@@ -458,13 +461,12 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
-/*bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
- const unsigned int UNUSED cd_values[], size_t nbytes,
- size_t UNUSED *buf_size, void UNUSED **buf)
-BMR: removed UNUSED for now until asking Q. or R. to pass compilation*/
+#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[], size_t nbytes,
size_t *buf_size, void **buf)
+#endif
+filter_bogus(size_t nbytes)
{
return nbytes;
}
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index 29f50f8..407e6a8 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -53,9 +53,9 @@ const size_t ATTR_MAX_DIMS = 7;
/* 3-D dataset with fixed dimensions */
const int SPACE1_RANK = 3;
-const int SPACE1_DIM1 = 3;
-const int SPACE1_DIM2 = 15;
-const int SPACE1_DIM3 = 13;
+const hsize_t SPACE1_DIM1 = 3;
+const hsize_t SPACE1_DIM2 = 15;
+const hsize_t SPACE1_DIM3 = 13;
/* Object names */
const H5std_string DSET1_NAME("Dataset1");
@@ -65,7 +65,7 @@ const H5std_string TYPE1_NAME("/Type");
/* Attribute Rank & Dimensions */
const H5std_string ATTR1_NAME("Attr1");
const int ATTR1_RANK = 1;
-const int ATTR1_DIM1 = 3;
+const hsize_t ATTR1_DIM1 = 3;
int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */
// File attribute, using the same rank and dimensions as ATTR1_NAME's
@@ -74,8 +74,8 @@ const H5std_string FATTR2_NAME("File Attr2");
const H5std_string ATTR2_NAME("Attr2");
const int ATTR2_RANK = 2;
-const int ATTR2_DIM1 = 2;
-const int ATTR2_DIM2 = 2;
+const hsize_t ATTR2_DIM1 = 2;
+const hsize_t ATTR2_DIM2 = 2;
int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */
const H5std_string ATTR3_NAME("Attr3");
@@ -123,7 +123,7 @@ static void test_attr_basic_write()
hsize_t dims2[] = {ATTR1_DIM1};
hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
- int i;
+ hsize_t i;
// Output message about test being performed
SUBTEST("Basic Attribute Writing Functions");
@@ -384,7 +384,7 @@ static void test_attr_getname()
static void test_attr_rename()
{
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute
- int i;
+ hsize_t i;
// Output message about test being performed
SUBTEST("Checking for Existence and Renaming Attribute");
@@ -493,7 +493,7 @@ static void test_attr_rename()
********************************************************************/
static void test_attr_basic_read()
{
- int i, j;
+ hsize_t i, j;
// Output message about test being performed
SUBTEST("Basic Attribute Reading Functions");
@@ -624,7 +624,6 @@ static void test_attr_compound_read()
size_t size; // Attribute datatype size as stored in file
size_t offset; // Attribute datatype field offset
struct attr4_struct read_data4[ATTR4_DIM1][ATTR4_DIM2]; // Buffer for reading 4th attribute
- hsize_t i,j;
// Output message about test being performed
SUBTEST("Basic Attribute Functions");
@@ -654,7 +653,7 @@ static void test_attr_compound_read()
// Get the dims of the dataspace and verify them
int ndims = space.getSimpleExtentDims(dims);
- if(dims[0]!=ATTR4_DIM1)
+ verify_val(ndims, ATTR4_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
verify_val((long)dims[0], (long)ATTR4_DIM1, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
verify_val((long)dims[1], (long)ATTR4_DIM2, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
@@ -673,13 +672,14 @@ static void test_attr_compound_read()
// Verify that the fields have the same names as when the type
// was created
- for(i=0; i<fields; i++)
+ int j;
+ for(j=0; j<fields; j++)
{
- H5std_string fieldname = datatype.getMemberName(i);
+ H5std_string fieldname = datatype.getMemberName(j);
if(!((fieldname == ATTR4_FIELDNAME1) ||
(fieldname == ATTR4_FIELDNAME2) ||
(fieldname == ATTR4_FIELDNAME3)))
- TestErrPrintf("%d:invalid field name for field #%d: %s\n",__LINE__,i,fieldname.c_str());
+ TestErrPrintf("%d:invalid field name for field #%d: %s\n",__LINE__,j,fieldname.c_str());
} /* end for */
offset = datatype.getMemberOffset(0);
@@ -729,12 +729,13 @@ static void test_attr_compound_read()
attr.read(datatype, read_data4);
// Verify values read in
- for(i=0; i<ATTR4_DIM1; i++)
- for(j=0; j<ATTR4_DIM2; j++)
- if(HDmemcmp(&attr_data4[i][j],&read_data4[i][j],sizeof(struct attr4_struct))) {
- TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",__LINE__,i,j,attr_data4[i][j].i,i,j,read_data4[i][j].i);
- TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",__LINE__,i,j,attr_data4[i][j].d,i,j,read_data4[i][j].d);
- TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",__LINE__,i,j,attr_data4[i][j].c,i,j,read_data4[i][j].c);
+ hsize_t ii, jj;
+ for(ii=0; ii<ATTR4_DIM1; ii++)
+ for(jj=0; jj<ATTR4_DIM2; jj++)
+ if(HDmemcmp(&attr_data4[ii][jj],&read_data4[ii][jj],sizeof(struct attr4_struct))) {
+ TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",__LINE__,ii,jj,attr_data4[ii][jj].i,ii,jj,read_data4[ii][jj].i);
+ TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",__LINE__,ii,jj,attr_data4[ii][jj].d,ii,jj,read_data4[ii][jj].d);
+ TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",__LINE__,ii,jj,attr_data4[ii][jj].c,ii,jj,read_data4[ii][jj].c);
} /* end if */
// Verify name
@@ -928,7 +929,7 @@ static void test_attr_mult_read()
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
int read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; // Buffer for reading 2nd attribute
double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{0}}}; // Buffer for reading 3rd attribute
- int i,j,k;
+ hsize_t i,j,k;
// Output message about test being performed
SUBTEST("Multiple Attribute Reading Functions");
@@ -959,7 +960,7 @@ static void test_attr_mult_read()
// Get the dims of the dataspace and verify them
hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions
int ndims = space.getSimpleExtentDims(dims);
- if(dims[0]!=ATTR1_DIM1)
+ if ((long)dims[0] != (long)ATTR1_DIM1)
TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1);
/* Verify Datatype */
@@ -1010,10 +1011,9 @@ static void test_attr_mult_read()
// Get the dims of the dataspace and verify them
ndims = space.getSimpleExtentDims(dims);
- if(dims[0]!=ATTR2_DIM1)
- TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR2_DIM1);
- if(dims[1]!=ATTR2_DIM2)
- TestErrPrintf("%d:attribute dimensions different: dims[1]=%d, should be %d\n",__LINE__,(int)dims[1],ATTR2_DIM2);
+
+ verify_val((long)dims[0], (long)ATTR2_DIM1, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
+ verify_val((long)dims[1], (long)ATTR2_DIM2, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
/* Verify Datatype */
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index 854c7bb..3edb83a 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -57,9 +57,13 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl,
#endif
/* Temporary filter IDs used for testing */
-#define H5Z_FILTER_BOGUS 305
+const int H5Z_FILTER_BOGUS = 305;
+
+#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+#endif
+static size_t filter_bogus(size_t nbytes);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
@@ -88,9 +92,12 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
+#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED *cd_values, size_t nbytes,
size_t UNUSED *buf_size, void UNUSED **buf)
+#endif
+filter_bogus(size_t nbytes)
{
return nbytes;
}
@@ -239,7 +246,8 @@ static void test_szip_filter(H5File& file1)
#else /* H5_HAVE_FILTER_SZIP */
SUBTEST("szip filter");
SKIPPED();
- puts(" Szip filter not enabled");
+ H5std_string fname = file1.getFileName();
+ cerr << " Szip filter not enabled for file '" << fname << "'" << endl;
#endif /* H5_HAVE_FILTER_SZIP */
} // test_szip_filter
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index b86d7cb..c74d34a 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -181,6 +181,8 @@ static void test_get_objname_ontypes()
Group grp = file.createGroup ("typetests");
// Create a datatype and save it
+ IntType inttype(PredType::STD_B8LE);
+
DataType dtype(PredType::STD_B8LE);
dtype.commit(file, "STD_B8LE");
@@ -201,6 +203,7 @@ static void test_get_objname_ontypes()
// Name this datatype
new_int_type.commit(grp, "IntType NATIVE_INT");
ssize_t name_len = new_int_type.getObjName(type_name); // default len
+ verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataSet::getObjName", __LINE__, __FILE__);
verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataSet::getObjName", __LINE__, __FILE__);
// Close everything or they can be closed when objects go out of scope
@@ -208,7 +211,6 @@ static void test_get_objname_ontypes()
copied_type.close();
new_int_type.close();
grp.close();
- file.close();
PASSED();
} // end top try block
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index dcfb644..9d072be 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -462,11 +462,11 @@ test_reference_group(void)
// Check number of objects in the group dereferenced by constructor
hsize_t nobjs = refgroup.getNumObjs();
- verify_val(nobjs, 3, "H5Group::getNumObjs",__LINE__,__FILE__);
+ verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__);
// Check number of objects in the group dereferenced by ::reference
nobjs = group.getNumObjs();
- verify_val(nobjs, 3, "H5Group::getNumObjs",__LINE__,__FILE__);
+ verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__);
// Check getting file name given the group dereferenced via constructor
H5std_string fname = refgroup.getFileName();
@@ -479,7 +479,7 @@ test_reference_group(void)
// Unlink one of the objects in the dereferenced group, and re-check
refgroup.unlink(GROUPNAME2);
nobjs = refgroup.getNumObjs();
- verify_val(nobjs, 2, "H5Group::getNumObjs",__LINE__,__FILE__);
+ verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__);
// Close resources
group.close();
@@ -686,43 +686,43 @@ test_reference_region_1D(void)
reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords);
// Verify values in the list
- verify_val(coords[0], 2, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[1], 3, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[2], 7, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[3], 8, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[4], 12, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[5], 13, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[6], 17, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[7], 18, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[8], 22, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[9], 23, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[10], 27, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[11], 28, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[12], 32, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[13], 33, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[14], 37, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[15], 38, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[16], 42, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[17], 43, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[18], 47, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[19], 48, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[20], 52, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[21], 53, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[22], 57, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[23], 58, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[24], 62, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[25], 63, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[26], 67, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[27], 68, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[28], 72, "Hyperslab Coordinates",__LINE__,__FILE__);
- verify_val(coords[29], 73, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__);
+ verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__);
HDfree(coords);
// Check boundaries
reg_sp.getSelectBounds(low, high);
- verify_val(low[0], 2, "DataSpace::getSelectBounds",__LINE__,__FILE__);
- verify_val(high[0], 73, "DataSpace::getSelectBounds",__LINE__,__FILE__);
+ verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__);
+ verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__);
/* Close region space */
reg_sp.close();
@@ -760,8 +760,8 @@ test_reference_region_1D(void)
// Check boundaries
elm_sp.getSelectBounds(low, high);
- verify_val(low[0], 3, "DataSpace::getSelectBounds",__LINE__,__FILE__);
- verify_val(high[0], 97, "DataSpace::getSelectBounds",__LINE__,__FILE__);
+ verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__);
+ verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__);
// Close element space
elm_sp.close();
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index e9e1427..004723f 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -109,7 +109,7 @@ static void test_classes()
{
SUBTEST("PredType::getClass()");
try {
- int curr_nerrors = GetTestNumErrs();
+ // maybe later, int curr_nerrors = GetTestNumErrs();
// PredType::NATIVE_INT should be in H5T_INTEGER class
H5T_class_t tcls = PredType::NATIVE_INT.getClass();
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index a2669db..7c81a8e 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -60,6 +60,7 @@ const hsize_t SPACE1_DIM1 = 4;
** Note: exact copy from the C version.
** (Not used now)
****************************************************************/
+#if 0 // not used now
static void *test_vlstr_alloc_custom(size_t size, void *info)
{
void *ret_value=NULL; // Pointer to return
@@ -81,6 +82,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info)
return(ret_value);
}
+#endif
/****************************************************************
**
@@ -92,6 +94,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info)
** Note: exact copy from the C version.
** (Not used now)
****************************************************************/
+#if 0 // not used now
static void test_vlstr_free_custom(void *_mem, void *info)
{
unsigned char *mem;
@@ -111,6 +114,7 @@ static void test_vlstr_free_custom(void *_mem, void *info)
HDfree(mem);
} // end if
}
+#endif
/*-------------------------------------------------------------------------
* Function: test_vlstring_dataset
@@ -256,7 +260,7 @@ static void test_vlstring_array_dataset()
char *string_ds_check[SPACE1_DIM1];
dataset.read(string_ds_check, vlst);
- int ii;
+ hsize_t ii;
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0)
@@ -351,25 +355,25 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
- hsize_t i; // counting variable
- for (i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
+ hsize_t ii; // counting variable
+ for (ii=0; ii<SPACE1_DIM1; ii++)
+ if(rdata[ii]!=NULL)
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Write dataset to disk, then read it back.
dataset.write(wdata, vlst);
dataset.read(rdata, vlst);
// Compare data read in.
- for (i = 0; i < SPACE1_DIM1; i++) {
- size_t wlen = HDstrlen(wdata[i]);
- size_t rlen = HDstrlen(rdata[i]);
+ for (ii = 0; ii < SPACE1_DIM1; ii++) {
+ size_t wlen = HDstrlen(wdata[ii]);
+ size_t rlen = HDstrlen(rdata[ii]);
if(wlen != rlen) {
- TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)i, (unsigned)wlen, (int)i, (unsigned)rlen);
+ TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen);
continue;
} // end if
- if(HDstrcmp(wdata[i],rdata[i]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i], (int)i, rdata[i]);
+ if(HDstrcmp(wdata[ii],rdata[ii]) != 0) {
+ TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]);
continue;
} // end if
} // end for
@@ -398,9 +402,9 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
- for (i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
+ for (ii=0; ii<SPACE1_DIM1; ii++)
+ if(rdata[ii]!=NULL)
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Try to write nil strings to disk.
dataset.write(wdata2, vlst);
@@ -409,9 +413,9 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
- for (i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
+ for (ii=0; ii<SPACE1_DIM1; ii++)
+ if(rdata[ii]!=NULL)
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Close objects and file.
dataset.close();
@@ -793,7 +797,7 @@ static void test_vlstring_array_attribute()
char *string_att_check[SPACE1_DIM1];
gr_attr.read(vlst, &string_att_check);
- int ii;
+ hsize_t ii;
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0)