diff options
author | Sean McBride <sean@rogue-research.com> | 2023-06-19 05:13:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 05:13:38 (GMT) |
commit | 65d8c9347010771473b53c91adcec2f281772213 (patch) | |
tree | 487567dae0dc005de896f616b90e67744239a5e2 /test/dtypes.c | |
parent | 1f20354ee6cdfa9fd157ac9cdfff9acdf320a32d (diff) | |
download | hdf5-65d8c9347010771473b53c91adcec2f281772213.zip hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.gz hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.bz2 |
Many fixes to various compiler warnings (#3124)
* Fixed various -Wmissing-variable-declarations by adding static keyword
* In a few cases, renamed the variable suffix from _g to _s.
* Fixed some -Wmissing-variable-declarations by using different declaration macros
* Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero
* Fixed various -Wcomma warnings
* Fixed clang -Wstrict-prototypes warnings
* Fixed various -Wunused-variable warnings
* Updated some casts to fix the only 3 -Wcast-qual warnings
* Fixed the only -Wsometimes-uninitialized warning
Diffstat (limited to 'test/dtypes.c')
-rw-r--r-- | test/dtypes.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index c7d845d..ead76de 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -76,8 +76,8 @@ } \ } while (0) -const char *FILENAME[] = {"dtypes0", "dtypes1", "dtypes2", "dtypes3", "dtypes4", "dtypes5", - "dtypes6", "dtypes7", "dtypes8", "dtypes9", "dtypes10", NULL}; +static const char *FILENAME[] = {"dtypes0", "dtypes1", "dtypes2", "dtypes3", "dtypes4", "dtypes5", + "dtypes6", "dtypes7", "dtypes8", "dtypes9", "dtypes10", NULL}; #define TESTFILE "bad_compound.h5" @@ -3953,27 +3953,32 @@ test_query(void) HDprintf("Can't create enumerate type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "RED", (enum_val = 10, &enum_val)) < 0) { + enum_val = 10; + if (H5Tenum_insert(tid2, "RED", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "GREEN", (enum_val = 11, &enum_val)) < 0) { + enum_val = 11; + if (H5Tenum_insert(tid2, "GREEN", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "BLUE", (enum_val = 12, &enum_val)) < 0) { + enum_val = 12; + if (H5Tenum_insert(tid2, "BLUE", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "ORANGE", (enum_val = 13, &enum_val)) < 0) { + enum_val = 13; + if (H5Tenum_insert(tid2, "ORANGE", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "YELLOW", (enum_val = 14, &enum_val)) < 0) { + enum_val = 14; + if (H5Tenum_insert(tid2, "YELLOW", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; @@ -5267,7 +5272,8 @@ test_conv_enum_1(void) for (i = 0; i < 26; i++) { s[0] = (char)('A' + i); H5Tenum_insert(t1, s, &i); - H5Tenum_insert(t2, s, (val = i * 1000 + i, &val)); + val = i * 1000 + i; + H5Tenum_insert(t2, s, &val); } /* end for */ /* Initialize the buffer */ @@ -6043,27 +6049,32 @@ test_encode(void) HDprintf("Can't create enumerate type\n"); goto error; } - if (H5Tenum_insert(tid2, "RED", (enum_val = 0, &enum_val)) < 0) { + enum_val = 0; + if (H5Tenum_insert(tid2, "RED", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "GREEN", (enum_val = 1, &enum_val)) < 0) { + enum_val = 1; + if (H5Tenum_insert(tid2, "GREEN", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "BLUE", (enum_val = 2, &enum_val)) < 0) { + enum_val = 2; + if (H5Tenum_insert(tid2, "BLUE", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "ORANGE", (enum_val = 3, &enum_val)) < 0) { + enum_val = 3; + if (H5Tenum_insert(tid2, "ORANGE", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "YELLOW", (enum_val = 4, &enum_val)) < 0) { + enum_val = 4; + if (H5Tenum_insert(tid2, "YELLOW", &enum_val) < 0) { H5_FAILED(); HDprintf("Can't insert field into enumeration type\n"); goto error; |