Commit acc8b75a authored by gsell's avatar gsell

- several "duplicate const" warnings fixed

- some useless tests whether an unsigned int is less than zero removed
parent 078a51d6
...@@ -130,13 +130,7 @@ h5u_set_num_points ( ...@@ -130,13 +130,7 @@ h5u_set_num_points (
hsize_t start; hsize_t start;
hsize_t dmax = H5S_UNLIMITED; hsize_t dmax = H5S_UNLIMITED;
if (nparticles < 0) #ifndef H5_HAVE_PARALLEL
H5_RETURN_ERROR (
H5_ERR_INVAL,
"Invalid number of particles: %lld!\n",
(long long)nparticles);
#ifndef H5_HAVE_PARALLEL
/* /*
if we are not using parallel-IO, there is enough information if we are not using parallel-IO, there is enough information
to know that we can short circuit this routine. However, to know that we can short circuit this routine. However,
...@@ -231,7 +225,7 @@ h5u_set_num_points ( ...@@ -231,7 +225,7 @@ h5u_set_num_points (
h5_err_t h5_err_t
h5u_has_view ( h5u_has_view (
const const h5_file_t fh const h5_file_t fh
) { ) {
h5_file_p f = (h5_file_p)fh; h5_file_p f = (h5_file_p)fh;
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f); H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
h5_err_t h5_err_t
h5priv_link_exists_ ( h5priv_link_exists_ (
const hid_t loc_id, const hid_t loc_id,
const char const* path[], const char *const path[],
size_t size size_t size
) { ) {
H5_PRIV_FUNC_ENTER (h5_err_t, H5_PRIV_FUNC_ENTER (h5_err_t,
......
...@@ -163,12 +163,12 @@ hdf5_create_group ( ...@@ -163,12 +163,12 @@ hdf5_create_group (
h5_err_t h5_err_t
h5priv_link_exists_ ( h5priv_link_exists_ (
const hid_t loc_id, const hid_t loc_id,
const char const* path[], const char *const path[],
size_t size size_t size
); );
#define h5priv_link_exists(loc_id, ...) \ #define h5priv_link_exists(loc_id, ...) \
(h5priv_link_exists_ (loc_id, \ (h5priv_link_exists_ (loc_id, \
(const char const*[]){__VA_ARGS__}, \ (const char *const[]){__VA_ARGS__}, \
PP_NARG(__VA_ARGS__))) PP_NARG(__VA_ARGS__)))
...@@ -195,7 +195,7 @@ hdf5_close_group ( ...@@ -195,7 +195,7 @@ hdf5_close_group (
static inline hid_t static inline hid_t
h5priv_create_group ( h5priv_create_group (
const hid_t loc_id, const hid_t loc_id,
const char const* group_name const char *const group_name
) { ) {
H5_PRIV_FUNC_ENTER (hid_t, H5_PRIV_FUNC_ENTER (hid_t,
"loc_id=%lld, (%s), group_name=%s", "loc_id=%lld, (%s), group_name=%s",
...@@ -214,7 +214,7 @@ h5priv_create_group ( ...@@ -214,7 +214,7 @@ h5priv_create_group (
static inline hid_t static inline hid_t
h5priv_open_group ( h5priv_open_group (
const hid_t loc_id, const hid_t loc_id,
const char const* group_name const char *const group_name
) { ) {
H5_PRIV_FUNC_ENTER (hid_t, H5_PRIV_FUNC_ENTER (hid_t,
"loc_id=%lld, (%s), group_name=%s", "loc_id=%lld, (%s), group_name=%s",
...@@ -809,17 +809,17 @@ get_class_type_name ( ...@@ -809,17 +809,17 @@ get_class_type_name (
const hid_t class_id const hid_t class_id
) { ) {
const char* const map[] = { const char* const map[] = {
[H5T_INTEGER] "H5T_INTEGER", [H5T_INTEGER] = "H5T_INTEGER",
[H5T_FLOAT] "H5T_FLOAT", [H5T_FLOAT] = "H5T_FLOAT",
[H5T_TIME] "H5T_TIME", [H5T_TIME] = "H5T_TIME",
[H5T_STRING] "H5T_STRING", [H5T_STRING] = "H5T_STRING",
[H5T_BITFIELD] "H5T_BITFIELD", [H5T_BITFIELD] = "H5T_BITFIELD",
[H5T_OPAQUE] "H5T_OPAQUE", [H5T_OPAQUE] = "H5T_OPAQUE",
[H5T_COMPOUND] "H5T_COMPOUND", [H5T_COMPOUND] = "H5T_COMPOUND",
[H5T_REFERENCE] "H5T_REFERENCE", [H5T_REFERENCE] = "H5T_REFERENCE",
[H5T_ENUM] "H5T_ENUM", [H5T_ENUM] = "H5T_ENUM",
[H5T_VLEN] "H5T_VLEN", [H5T_VLEN] = "H5T_VLEN",
[H5T_ARRAY] "H5T_ARRAY" [H5T_ARRAY] = "H5T_ARRAY"
}; };
if (class_id < 0 || class_id >= H5T_NCLASSES) { if (class_id < 0 || class_id >= H5T_NCLASSES) {
return ("[unknown]"); return ("[unknown]");
......
...@@ -62,7 +62,7 @@ grow_strlist ( ...@@ -62,7 +62,7 @@ grow_strlist (
ssize_t ssize_t
h5priv_insert_strlist ( h5priv_insert_strlist (
h5_strlist_t** list, h5_strlist_t** list,
const char const* item, const char *const item,
size_t idx size_t idx
) { ) {
H5_PRIV_API_ENTER (ssize_t, H5_PRIV_API_ENTER (ssize_t,
......
...@@ -160,7 +160,7 @@ h5_err_t ...@@ -160,7 +160,7 @@ h5_err_t
h5priv_free_strlist (h5_strlist_t**); h5priv_free_strlist (h5_strlist_t**);
ssize_t ssize_t
h5priv_insert_strlist (h5_strlist_t**, const char const*, size_t); h5priv_insert_strlist (h5_strlist_t**, const char *const, size_t);
ssize_t ssize_t
h5priv_find_strlist (h5_strlist_t*, const char* const item); h5priv_find_strlist (h5_strlist_t*, const char* const item);
......
...@@ -136,7 +136,6 @@ h5tpriv_traverse_tv ( ...@@ -136,7 +136,6 @@ h5tpriv_traverse_tv (
unsigned int* i unsigned int* i
) { ) {
assert (i != NULL); assert (i != NULL);
if (*i < 0) i = 0;
if (*i >= m->num_loc_vertices[m->num_loaded_levels-1]) { if (*i >= m->num_loc_vertices[m->num_loaded_levels-1]) {
return NULL; return NULL;
} }
...@@ -166,7 +165,6 @@ h5tpriv_traverse_td ( ...@@ -166,7 +165,6 @@ h5tpriv_traverse_td (
unsigned int* i unsigned int* i
) { ) {
assert (i != NULL); assert (i != NULL);
if (*i < 0) i = 0;
h5t_td_entry_t* entry = h5priv_htraverse (&m->adjacencies.td_hash, i); h5t_td_entry_t* entry = h5priv_htraverse (&m->adjacencies.td_hash, i);
h5_loc_idlist_t* result = NULL; h5_loc_idlist_t* result = NULL;
if (entry) { if (entry) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment