summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2019-06-24 20:31:27 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2019-06-24 20:31:27 (GMT)
commite35effff7da40fa8b0dda273be9bbdfa9c8c3624 (patch)
tree632cf41418cdc9c2695f3f513301efc16bfea879
parent35fd0ec8ceffe96cee352187154da15c967fb990 (diff)
parentcb92adccf61d712ee8c4fcac04c1b297c05ab941 (diff)
downloadhdf5-e35effff7da40fa8b0dda273be9bbdfa9c8c3624.zip
hdf5-e35effff7da40fa8b0dda273be9bbdfa9c8c3624.tar.gz
hdf5-e35effff7da40fa8b0dda273be9bbdfa9c8c3624.tar.bz2
Merge pull request #1770 in HDFFV/hdf5 from ~KOZIOL/hdf5:develop to develop
* commit 'cb92adccf61d712ee8c4fcac04c1b297c05ab941': Move pragma statements outside of routines, to make older compilers happy.
-rw-r--r--src/H5Tnative.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index f40d81b..d213c45 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -515,6 +515,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_type() */
+/* Disable warning for intentional identical branches here -QAK */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wduplicated-branches"
/*-------------------------------------------------------------------------
* Function: H5T__get_native_integer
@@ -551,9 +554,6 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
FUNC_ENTER_STATIC
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
-/* Disable warning for intentional identical branches here -QAK */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) {
match = H5T_NATIVE_INT_MATCH_CHAR;
native_size = sizeof(char);
@@ -573,7 +573,6 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
match = H5T_NATIVE_INT_MATCH_LLONG;
native_size = sizeof(long long);
}
-#pragma GCC diagnostic pop
} else if(direction == H5T_DIR_DESCEND) {
if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) {
match = H5T_NATIVE_INT_MATCH_LLONG;
@@ -659,7 +658,11 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_integer() */
+#pragma GCC diagnostic pop
+/* Disable warning for intentional identical branches here -QAK */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wduplicated-branches"
/*-------------------------------------------------------------------------
* Function: H5T__get_native_float
@@ -698,9 +701,6 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
HDassert(size>0);
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
-/* Disable warning for intentional identical branches here -QAK */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
if(size<=sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
native_size = sizeof(float);
@@ -724,7 +724,6 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
native_size = sizeof(double);
#endif
}
-#pragma GCC diagnostic pop
} else {
#if H5_SIZEOF_LONG_DOUBLE !=0
if(size>sizeof(double)) {
@@ -788,7 +787,11 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_float() */
+#pragma GCC diagnostic pop
+/* Disable warning for intentional identical branches here -QAK */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wduplicated-branches"
/*-------------------------------------------------------------------------
* Function: H5T__get_native_bitfield
@@ -818,9 +821,6 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
FUNC_ENTER_STATIC
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
-/* Disable warning for intentional identical branches here -QAK */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) {
tid = H5T_NATIVE_B8;
native_size = 1;
@@ -842,7 +842,6 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
native_size = 8;
align = H5T_NATIVE_UINT64_ALIGN_g;
}
-#pragma GCC diagnostic pop
} else if(direction == H5T_DIR_DESCEND) {
if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) {
tid = H5T_NATIVE_B64;
@@ -878,6 +877,7 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_bitfield() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------