Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

November 2021 Pull Requests not previously merged to 1.12 #1571

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions c++/src/H5PredType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,31 +434,29 @@ PredType::makePredTypes()
MIPS_F32_ = new PredType(H5T_MIPS_F32);
MIPS_F64_ = new PredType(H5T_MIPS_F64);

NATIVE_CHAR_ = new PredType(H5T_NATIVE_CHAR);
NATIVE_INT_ = new PredType(H5T_NATIVE_INT);
NATIVE_FLOAT_ = new PredType(H5T_NATIVE_FLOAT);
NATIVE_SCHAR_ = new PredType(H5T_NATIVE_SCHAR);
NATIVE_UCHAR_ = new PredType(H5T_NATIVE_UCHAR);
NATIVE_SHORT_ = new PredType(H5T_NATIVE_SHORT);
NATIVE_USHORT_ = new PredType(H5T_NATIVE_USHORT);
NATIVE_UINT_ = new PredType(H5T_NATIVE_UINT);
NATIVE_LONG_ = new PredType(H5T_NATIVE_LONG);
NATIVE_ULONG_ = new PredType(H5T_NATIVE_ULONG);
NATIVE_LLONG_ = new PredType(H5T_NATIVE_LLONG);
NATIVE_ULLONG_ = new PredType(H5T_NATIVE_ULLONG);
NATIVE_DOUBLE_ = new PredType(H5T_NATIVE_DOUBLE);
#if H5_SIZEOF_LONG_DOUBLE != 0
NATIVE_CHAR_ = new PredType(H5T_NATIVE_CHAR);
NATIVE_INT_ = new PredType(H5T_NATIVE_INT);
NATIVE_FLOAT_ = new PredType(H5T_NATIVE_FLOAT);
NATIVE_SCHAR_ = new PredType(H5T_NATIVE_SCHAR);
NATIVE_UCHAR_ = new PredType(H5T_NATIVE_UCHAR);
NATIVE_SHORT_ = new PredType(H5T_NATIVE_SHORT);
NATIVE_USHORT_ = new PredType(H5T_NATIVE_USHORT);
NATIVE_UINT_ = new PredType(H5T_NATIVE_UINT);
NATIVE_LONG_ = new PredType(H5T_NATIVE_LONG);
NATIVE_ULONG_ = new PredType(H5T_NATIVE_ULONG);
NATIVE_LLONG_ = new PredType(H5T_NATIVE_LLONG);
NATIVE_ULLONG_ = new PredType(H5T_NATIVE_ULLONG);
NATIVE_DOUBLE_ = new PredType(H5T_NATIVE_DOUBLE);
NATIVE_LDOUBLE_ = new PredType(H5T_NATIVE_LDOUBLE);
#endif
NATIVE_B8_ = new PredType(H5T_NATIVE_B8);
NATIVE_B16_ = new PredType(H5T_NATIVE_B16);
NATIVE_B32_ = new PredType(H5T_NATIVE_B32);
NATIVE_B64_ = new PredType(H5T_NATIVE_B64);
NATIVE_OPAQUE_ = new PredType(H5T_NATIVE_OPAQUE);
NATIVE_HSIZE_ = new PredType(H5T_NATIVE_HSIZE);
NATIVE_HSSIZE_ = new PredType(H5T_NATIVE_HSSIZE);
NATIVE_HERR_ = new PredType(H5T_NATIVE_HERR);
NATIVE_HBOOL_ = new PredType(H5T_NATIVE_HBOOL);
NATIVE_B8_ = new PredType(H5T_NATIVE_B8);
NATIVE_B16_ = new PredType(H5T_NATIVE_B16);
NATIVE_B32_ = new PredType(H5T_NATIVE_B32);
NATIVE_B64_ = new PredType(H5T_NATIVE_B64);
NATIVE_OPAQUE_ = new PredType(H5T_NATIVE_OPAQUE);
NATIVE_HSIZE_ = new PredType(H5T_NATIVE_HSIZE);
NATIVE_HSSIZE_ = new PredType(H5T_NATIVE_HSSIZE);
NATIVE_HERR_ = new PredType(H5T_NATIVE_HERR);
NATIVE_HBOOL_ = new PredType(H5T_NATIVE_HBOOL);

NATIVE_INT8_ = new PredType(H5T_NATIVE_INT8);
NATIVE_UINT8_ = new PredType(H5T_NATIVE_UINT8);
Expand Down
8 changes: 0 additions & 8 deletions fortran/src/H5_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,20 @@ h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes)
if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
return ret_value;
} /* end if */
#if H5_SIZEOF_LONG_DOUBLE != 0
else if (sizeof(real_f) == sizeof(long double)) {
if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
return ret_value;
} /* end else */
#endif

/* Find appropriate size to store Fortran DOUBLE */
if (sizeof(double_f) == sizeof(double)) {
if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
return ret_value;
} /*end if */
#if H5_SIZEOF_LONG_DOUBLE != 0
else if (sizeof(double_f) == sizeof(long double)) {
if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
return ret_value;
} /*end else */
#endif
#ifdef H5_HAVE_FLOAT128
else if (sizeof(double_f) == sizeof(__float128)) {
if ((types[7] = H5Tcopy(H5T_NATIVE_FLOAT)) < 0)
Expand Down Expand Up @@ -169,12 +165,10 @@ h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes)
if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
return ret_value;
} /*end if */
#if H5_SIZEOF_LONG_DOUBLE != 0
else if (sizeof(real_C_FLOAT_f) == sizeof(long double)) {
if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
return ret_value;
} /*end else */
#endif
/*
* FIND H5T_NATIVE_REAL_C_DOUBLE
*/
Expand All @@ -186,12 +180,10 @@ h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes)
if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
return ret_value;
} /*end if */
#if H5_SIZEOF_LONG_DOUBLE != 0
else if (sizeof(real_C_DOUBLE_f) == sizeof(long double)) {
if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
return ret_value;
} /*end else */
#endif
/*
* FIND H5T_NATIVE_REAL_C_LONG_DOUBLE
*/
Expand Down
4 changes: 0 additions & 4 deletions hl/fortran/src/H5LTfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,9 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
else if ((size_t)*sizeof_val == sizeof(double))
ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_DOUBLE,
(const double *)buf);
#if H5_SIZEOF_LONG_DOUBLE != 0
else if ((size_t)*sizeof_val == sizeof(long double))
ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_LDOUBLE,
(const long double *)buf);
#endif
else
goto done;
}
Expand Down Expand Up @@ -413,10 +411,8 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_FLOAT, buf);
else if ((size_t)*sizeof_val == sizeof(double))
ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_DOUBLE, buf);
#if H5_SIZEOF_LONG_DOUBLE != 0
else if ((size_t)*sizeof_val == sizeof(long double))
ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_LDOUBLE, buf);
#endif
else
goto done;
}
Expand Down
2 changes: 0 additions & 2 deletions hl/src/H5LT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,11 +2553,9 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
}
else if (H5Tequal(dtype, H5T_NATIVE_DOUBLE)) {
HDsnprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE");
#if H5_SIZEOF_LONG_DOUBLE != 0
}
else if (H5Tequal(dtype, H5T_NATIVE_LDOUBLE)) {
HDsnprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE");
#endif
}
else {
HDsnprintf(dt_str, *slen, "undefined float");
Expand Down
4 changes: 2 additions & 2 deletions java/src/jni/h5util.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
HDmemcpy(cptr, &tmp_double, sizeof(double));
break;
}
#if H5_SIZEOF_LONG_DOUBLE != 0 && H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
case sizeof(long double): {
long double tmp_ldouble = 0.0;

Expand Down Expand Up @@ -816,7 +816,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i

break;
}
#if H5_SIZEOF_LONG_DOUBLE != 0 && H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
case sizeof(long double): {
long double tmp_ldouble = 0.0;

Expand Down
2 changes: 1 addition & 1 deletion src/H5HGprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct H5HG_heap_t H5HG_heap_t;

/* Size of encoded global heap ID */
/* (size of file address + 32-bit integer) */
#define H5HG_HEAP_ID_SIZE(F) ((size_t)H5F_SIZEOF_ADDR(F) + H5_SIZEOF_UINT32_T)
#define H5HG_HEAP_ID_SIZE(F) ((size_t)H5F_SIZEOF_ADDR(F) + sizeof(uint32_t))

/* Main global heap routines */
H5_DLL herr_t H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj /*out*/);
Expand Down
16 changes: 8 additions & 8 deletions src/H5Rint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ H5R__encode_obj_token(const H5O_token_t *obj_token, size_t token_size, unsigned
/* Encode token */
H5MM_memcpy(p, obj_token, token_size);
}
*nalloc = token_size + H5_SIZEOF_UINT8_T;
*nalloc = token_size + sizeof(uint8_t);

FUNC_LEAVE_NOAPI(ret_value)
} /* end H5R__encode_obj_token() */
Expand Down Expand Up @@ -1171,7 +1171,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj
HDassert(token_size);

/* Don't decode if buffer size isn't big enough */
if (*nbytes < H5_SIZEOF_UINT8_T)
if (*nbytes < sizeof(uint8_t))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")

/* Get token size */
Expand All @@ -1185,7 +1185,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj
/* Decode token */
H5MM_memcpy(obj_token, p, *token_size);

*nbytes = (size_t)(*token_size + H5_SIZEOF_UINT8_T);
*nbytes = (size_t)(*token_size + sizeof(uint8_t));

done:
FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1218,7 +1218,7 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc)
"Cannot determine amount of space needed for serializing selection")

/* Don't encode if buffer size isn't big enough or buffer is empty */
if (buf && *nalloc >= ((size_t)buf_size + 2 * H5_SIZEOF_UINT32_T)) {
if (buf && *nalloc >= ((size_t)buf_size + 2 * sizeof(uint32_t))) {
int rank;
p = (uint8_t *)buf;

Expand All @@ -1234,7 +1234,7 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc)
if (H5S_SELECT_SERIALIZE(space, (unsigned char **)&p) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "can't serialize selection")
} /* end if */
*nalloc = (size_t)buf_size + 2 * H5_SIZEOF_UINT32_T;
*nalloc = (size_t)buf_size + 2 * sizeof(uint32_t);

done:
FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1265,16 +1265,16 @@ H5R__decode_region(const unsigned char *buf, size_t *nbytes, H5S_t **space_ptr)
HDassert(space_ptr);

/* Don't decode if buffer size isn't big enough */
if (*nbytes < (2 * H5_SIZEOF_UINT32_T))
if (*nbytes < (2 * sizeof(uint32_t)))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")

/* Decode the selection size */
UINT32DECODE(p, buf_size);
buf_size += H5_SIZEOF_UINT32_T;
buf_size += sizeof(uint32_t);

/* Decode the extent rank */
UINT32DECODE(p, rank);
buf_size += H5_SIZEOF_UINT32_T;
buf_size += sizeof(uint32_t);

/* Don't decode if buffer size isn't big enough */
if (*nbytes < buf_size)
Expand Down
2 changes: 1 addition & 1 deletion src/H5Rpkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define H5R_REF_ATTRNAME(x) ((x)->info.attr.name)

/* Header size */
#define H5R_ENCODE_HEADER_SIZE (2 * H5_SIZEOF_UINT8_T)
#define H5R_ENCODE_HEADER_SIZE (2 * sizeof(uint8_t))

/****************************/
/* Package Private Typedefs */
Expand Down
Loading