summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-06-19 05:13:38 (GMT)
committerGitHub <noreply@github.com>2023-06-19 05:13:38 (GMT)
commit65d8c9347010771473b53c91adcec2f281772213 (patch)
tree487567dae0dc005de896f616b90e67744239a5e2 /hl/test
parent1f20354ee6cdfa9fd157ac9cdfff9acdf320a32d (diff)
downloadhdf5-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 'hl/test')
-rw-r--r--hl/test/test_ld.c17
-rw-r--r--hl/test/test_packet_vlen.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index b056225..78af519 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -52,7 +52,7 @@
* Varies from 10->13; 10->9, 10->10, 10->1, 10->11
*/
#define ONE_NTESTS 5
-int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1};
+static int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1};
/*
* Test variations (retained original) for two-dimensional dataset:
@@ -61,7 +61,8 @@ int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1};
* {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
*/
#define TWO_NTESTS 9
-int two_tests[TWO_NTESTS][2] = {{2, 2}, {2, -1}, {2, 0}, {-1, 2}, {-1, -1}, {-1, 0}, {0, 2}, {0, -1}, {0, 0}};
+static int two_tests[TWO_NTESTS][2] = {{2, 2}, {2, -1}, {2, 0}, {-1, 2}, {-1, -1},
+ {-1, 0}, {0, 2}, {0, -1}, {0, 0}};
/* Verify that the two input values are the same */
#define VERIFY_EQUAL(_x, _y) \
@@ -210,12 +211,12 @@ typedef struct test_valid_fields2 {
/* Temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
#define TEST_BUF_SIZE 100
-int *iibuf; /* buffer for storing retrieved elements */
-int *ibuf; /* buffer for storing retrieved elements (integer) */
-set_t *cbuf; /* buffer for storing retrieved elements (compound) */
-set_t *ccbuf; /* buffer for storing retrieved elements (compound) */
-test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
-test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
+static int *iibuf; /* buffer for storing retrieved elements */
+static int *ibuf; /* buffer for storing retrieved elements (integer) */
+static set_t *cbuf; /* buffer for storing retrieved elements (compound) */
+static set_t *ccbuf; /* buffer for storing retrieved elements (compound) */
+static test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
+static test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
/*
*********************************************************************************
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 5e06c85..1d6195d 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -763,7 +763,7 @@ error: /* An error has occurred. Clean up and exit. */
*/
#define ATTR_RANK 1
#define ATTR_DIM 3
-int attr_data[ATTR_DIM] = {256, 11945, -22107}; /* values to be written to attr */
+static int attr_data[ATTR_DIM] = {256, 11945, -22107}; /* values to be written to attr */
static int
adding_attribute(hid_t fid, const char *table_name, const char *attr_name)