Skip to content

Commit

Permalink
Removed workarounds for pre-standard inline keyword
Browse files Browse the repository at this point in the history
Fixes -Wreserved-identifier warnings due to multiple underscores in H5_HAVE___INLINE
  • Loading branch information
seanm committed Mar 4, 2021
1 parent fb210fc commit 503629c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 46 deletions.
9 changes: 0 additions & 9 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@
/* Define to 1 if you have the <hdfs.h> header file. */
#cmakedefine H5_HAVE_HDFS_H @H5_HAVE_HDFS_H@

/* Define if the compiler understands inline */
#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@

/* Define if parallel library will contain instrumentation to detect correct
optimization operation */
#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@
Expand Down Expand Up @@ -480,12 +477,6 @@
/* Define to 1 if you have the `_scrsize' function. */
#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@

/* Define if the compiler understands __inline */
#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@

/* Define if the compiler understands __inline__ */
#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@

/* Define if the library will ignore file locks when disabled */
#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@

Expand Down
16 changes: 8 additions & 8 deletions src/H5Oshared.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*
*-------------------------------------------------------------------------
*/
static H5_INLINE void *
static inline void *
H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
const uint8_t *p)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *iofla
*
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
static inline herr_t
H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_shared_t *sh_mesg =
Expand Down Expand Up @@ -158,7 +158,7 @@ H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mes
*
*-------------------------------------------------------------------------
*/
static H5_INLINE size_t
static inline size_t
H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg)
{
const H5O_shared_t *sh_mesg =
Expand Down Expand Up @@ -211,7 +211,7 @@ H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
static inline herr_t
H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg)
{
H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */
Expand Down Expand Up @@ -262,7 +262,7 @@ H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
static inline herr_t
H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg)
{
H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */
Expand Down Expand Up @@ -312,7 +312,7 @@ H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE void *
static inline void *
H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_
*
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
static inline herr_t
H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src,
H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info)
{
Expand Down Expand Up @@ -445,7 +445,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const
*
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
static inline herr_t
H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
{
const H5O_shared_t *sh_mesg =
Expand Down
24 changes: 12 additions & 12 deletions src/H5VMprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s
*
*-------------------------------------------------------------------------
*/
static H5_INLINE hsize_t H5_ATTR_UNUSED
static inline hsize_t H5_ATTR_UNUSED
H5VM_vector_reduce_product(unsigned n, const hsize_t *v)
{
hsize_t ret_value = 1;
Expand Down Expand Up @@ -179,7 +179,7 @@ H5VM_vector_reduce_product(unsigned n, const hsize_t *v)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE htri_t H5_ATTR_UNUSED
static inline htri_t H5_ATTR_UNUSED
H5VM_vector_zerop_u(int n, const hsize_t *v)
{
htri_t ret_value = TRUE; /* Return value */
Expand Down Expand Up @@ -216,7 +216,7 @@ H5VM_vector_zerop_u(int n, const hsize_t *v)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE htri_t H5_ATTR_UNUSED
static inline htri_t H5_ATTR_UNUSED
H5VM_vector_zerop_s(int n, const hssize_t *v)
{
htri_t ret_value = TRUE; /* Return value */
Expand Down Expand Up @@ -255,7 +255,7 @@ H5VM_vector_zerop_s(int n, const hssize_t *v)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE int H5_ATTR_UNUSED
static inline int H5_ATTR_UNUSED
H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2)
{
int ret_value = 0; /* Return value */
Expand Down Expand Up @@ -303,7 +303,7 @@ H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE int H5_ATTR_UNUSED
static inline int H5_ATTR_UNUSED
H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2)
{
int ret_value = 0; /* Return value */
Expand Down Expand Up @@ -346,7 +346,7 @@ H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE void H5_ATTR_UNUSED
static inline void H5_ATTR_UNUSED
H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2)
{
while (n--)
Expand Down Expand Up @@ -390,7 +390,7 @@ static const unsigned char LogTable256[] = {
*
*-------------------------------------------------------------------------
*/
static H5_INLINE unsigned H5_ATTR_UNUSED
static inline unsigned H5_ATTR_UNUSED
H5VM_log2_gen(uint64_t n)
{
unsigned r; /* r will be log2(n) */
Expand Down Expand Up @@ -439,7 +439,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14,
*
*-------------------------------------------------------------------------
*/
static H5_INLINE H5_ATTR_PURE unsigned
static inline H5_ATTR_PURE unsigned
H5VM_log2_of2(uint32_t n)
{
#ifndef NDEBUG
Expand All @@ -463,7 +463,7 @@ H5VM_log2_of2(uint32_t n)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE H5_ATTR_CONST hsize_t
static inline H5_ATTR_CONST hsize_t
H5VM_power2up(hsize_t n)
{
hsize_t ret_value = 1; /* Return value */
Expand Down Expand Up @@ -495,7 +495,7 @@ H5VM_power2up(hsize_t n)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE unsigned H5_ATTR_UNUSED
static inline unsigned H5_ATTR_UNUSED
H5VM_limit_enc_size(uint64_t limit)
{
return (H5VM_log2_gen(limit) / 8) + 1;
Expand Down Expand Up @@ -527,7 +527,7 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7,
*
*-------------------------------------------------------------------------
*/
static H5_INLINE hbool_t H5_ATTR_UNUSED
static inline hbool_t H5_ATTR_UNUSED
H5VM_bit_get(const unsigned char *buf, size_t offset)
{
/* Test the appropriate bit in the buffer */
Expand Down Expand Up @@ -557,7 +557,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset)
*
*-------------------------------------------------------------------------
*/
static H5_INLINE void H5_ATTR_UNUSED
static inline void H5_ATTR_UNUSED
H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val)
{
/* Set/reset the appropriate bit in the buffer */
Expand Down
17 changes: 0 additions & 17 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,6 @@

#endif /*H5_HAVE_WIN32_API*/

/* Various ways that inline functions can be declared */
#if defined(H5_HAVE___INLINE__)
/* GNU (alternative form) */
#define H5_INLINE __inline__
#elif defined(H5_HAVE___INLINE)
/* Visual Studio */
#define H5_INLINE __inline
#elif defined(H5_HAVE_INLINE)
/* GNU, C++
* Use "inline" as a last resort on the off-chance that there will
* be C++ problems.
*/
#define H5_INLINE inline
#else
#define H5_INLINE
#endif /* inline choices */

#ifndef F_OK
#define F_OK 00
#define W_OK 02
Expand Down

0 comments on commit 503629c

Please sign in to comment.