const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<T>();
T value;
hid_t attr;
+ herr_t ret;
attr = H5Aopen(*hdf5_reference, attr_name.data(), H5P_DEFAULT);
Assert(ret >= 0, ExcMessage("Error at H5Aread"));
ret = H5Aclose(attr);
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
+
+ // This avoids the unused warning
+ (void)ret;
return value;
}
HDF5Object::get_attribute(const std::string &attr_name)
{
// The enum field generated by h5py can be casted to int
- int int_value;
- hid_t attr;
+ int int_value;
+ hid_t attr;
+ herr_t ret;
+
attr = H5Aopen(*hdf5_reference, attr_name.data(), H5P_DEFAULT);
Assert(attr >= 0, ExcMessage("Error at H5Aopen"));
ret = H5Aread(attr, H5T_NATIVE_INT, &int_value);
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
// The int can be casted to a bool
bool bool_value = (bool)int_value;
+
+ (void)ret;
return bool_value;
}
// Todo:
// - Use H5Dvlen_reclaim instead of free
- char *string_out;
- hid_t attr;
- hid_t type;
+ char * string_out;
+ hid_t attr;
+ hid_t type;
+ herr_t ret;
/* Create a datatype to refer to. */
type = H5Tcopy(H5T_C_S1);
free(string_out);
H5Tclose(type);
H5Aclose(attr);
+
+ (void)ret;
return string_value;
}
void
HDF5Object::set_attribute(const std::string &attr_name, const T value)
{
- hid_t attr;
- hid_t aid;
+ hid_t attr;
+ hid_t aid;
+ herr_t ret;
+
const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<T>();
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
ret = H5Aclose(attr);
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
+
+ (void)ret;
}
// (char *). For this reason the std::string value has been copied to a C
// string.
- hid_t attr;
- hid_t aid;
- hid_t t_type;
+ hid_t attr;
+ hid_t aid;
+ hid_t t_type;
+ herr_t ret;
// Reserve space for the string and the null terminator
char *c_string_value = (char *)malloc(sizeof(char) * (value.size() + 1));
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
ret = H5Aclose(attr);
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
+
+ (void)ret;
}
{
const std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
- hid_t plist;
+ hid_t plist;
+ herr_t ret;
Container data = internal::initialize_container<Container>(dimensions);
Assert(ret >= 0, ExcInternalError());
}
+ (void)ret;
return data;
}
const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
hid_t plist;
hid_t memory_dataspace;
+ herr_t ret;
std::vector<hsize_t> data_dimensions{
static_cast<hsize_t>(coordinates.size() / rank)};
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
+ (void)ret;
return data;
}
{
const std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
- hid_t plist;
- hid_t memory_dataspace;
+ hid_t plist;
+ hid_t memory_dataspace;
+ herr_t ret;
// In this particular overload of read_hyperslab the data_dimensions are
// the same as count
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
+ (void)ret;
return data;
}
{
const std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
- hid_t plist;
- hid_t memory_dataspace;
+ hid_t plist;
+ hid_t memory_dataspace;
+ herr_t ret;
Container data = internal::initialize_container<Container>(data_dimensions);
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
+ (void)ret;
return data;
}
const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
const std::vector<hsize_t> data_dimensions = {0};
- hid_t memory_dataspace;
- hid_t plist;
+ hid_t memory_dataspace;
+ hid_t plist;
+ herr_t ret;
memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
+
+ (void)ret;
}
AssertDimension(size, internal::get_container_size(data));
const std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
- hid_t plist;
+ hid_t plist;
+ herr_t ret;
if (mpi)
{
ret = H5Pclose(plist);
Assert(ret >= 0, ExcMessage("Error at H5Pclose"));
}
+
+ (void)ret;
}
const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
const std::vector<hsize_t> data_dimensions = {data.size()};
- hid_t memory_dataspace;
- hid_t plist;
+ hid_t memory_dataspace;
+ hid_t plist;
+ herr_t ret;
memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
}
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
+
+ (void)ret;
}
// the same as count
const std::vector<hsize_t> data_dimensions = count;
- hid_t memory_dataspace;
- hid_t plist;
+ hid_t memory_dataspace;
+ hid_t plist;
+ herr_t ret;
memory_dataspace =
H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
}
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
+
+ (void)ret;
}
const std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
- hid_t memory_dataspace;
- hid_t plist;
+ hid_t memory_dataspace;
+ hid_t plist;
+ herr_t ret;
memory_dataspace =
H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
}
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
+
+ (void)ret;
}
std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
std::vector<hsize_t> data_dimensions = {0};
- hid_t memory_dataspace;
- hid_t plist;
+ hid_t memory_dataspace;
+ hid_t plist;
+ herr_t ret;
memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
}
ret = H5Sclose(memory_dataspace);
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
+
+ (void)ret;
}
});
hid_t plist;
+ herr_t ret;
const MPI_Info info = MPI_INFO_NULL;
if (mpi)
ret = H5Pclose(plist);
Assert(ret >= 0, ExcMessage("Error at H5Pclose"));
}
+
+ (void)ret;
}