summaryrefslogtreecommitdiffstats
path: root/tools/src
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 /tools/src
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 'tools/src')
-rw-r--r--tools/src/h5copy/h5copy.c10
-rw-r--r--tools/src/h5import/h5import.h30
-rw-r--r--tools/src/h5jam/h5jam.c8
-rw-r--r--tools/src/h5repack/h5repack_main.c8
-rw-r--r--tools/src/h5stat/h5stat.c12
-rw-r--r--tools/src/misc/h5mkgrp.c2
6 files changed, 35 insertions, 35 deletions
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 72cd88e..43b78b3 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -30,11 +30,11 @@ static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
{"version", no_arg, 'V'},
{"enable-error-stack", optional_arg, 'E'},
{NULL, 0, '\0'}};
-char *fname_src = NULL;
-char *fname_dst = NULL;
-char *oname_src = NULL;
-char *oname_dst = NULL;
-char *str_flag = NULL;
+static char *fname_src = NULL;
+static char *fname_dst = NULL;
+static char *oname_src = NULL;
+static char *oname_dst = NULL;
+static char *str_flag = NULL;
/*-------------------------------------------------------------------------
* Function: leave
diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h
index 5d29317..46c366c 100644
--- a/tools/src/h5import/h5import.h
+++ b/tools/src/h5import/h5import.h
@@ -110,21 +110,21 @@ struct Options {
int fcount; /* number of input files */
};
-char keytable[NUM_KEYS][30] = {"PATH",
- "INPUT-CLASS",
- "INPUT-SIZE",
- "RANK",
- "DIMENSION-SIZES",
- "OUTPUT-CLASS",
- "OUTPUT-SIZE",
- "OUTPUT-ARCHITECTURE",
- "OUTPUT-BYTE-ORDER",
- "CHUNKED-DIMENSION-SIZES",
- "COMPRESSION-TYPE",
- "COMPRESSION-PARAM",
- "EXTERNAL-STORAGE",
- "MAXIMUM-DIMENSIONS",
- "INPUT-BYTE-ORDER"};
+static char keytable[NUM_KEYS][30] = {"PATH",
+ "INPUT-CLASS",
+ "INPUT-SIZE",
+ "RANK",
+ "DIMENSION-SIZES",
+ "OUTPUT-CLASS",
+ "OUTPUT-SIZE",
+ "OUTPUT-ARCHITECTURE",
+ "OUTPUT-BYTE-ORDER",
+ "CHUNKED-DIMENSION-SIZES",
+ "COMPRESSION-TYPE",
+ "COMPRESSION-PARAM",
+ "EXTERNAL-STORAGE",
+ "MAXIMUM-DIMENSIONS",
+ "INPUT-BYTE-ORDER"};
static int state_table[15][8] = {
/* token ordering: FILNAME OPT_o OPT_c OPT_h OPT_d OPT_p OPT_t OPT_s */
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index c7ede3c..9b3030c 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -23,10 +23,10 @@ hsize_t compute_user_block_size(hsize_t);
hsize_t copy_some_to_file(int, int, hsize_t, hsize_t, ssize_t);
void parse_command_line(int, const char *const *);
-int do_clobber = FALSE;
-char *output_file = NULL;
-char *input_file = NULL;
-char *ub_file = NULL;
+static int do_clobber = FALSE;
+static char *output_file = NULL;
+static char *input_file = NULL;
+static char *ub_file = NULL;
/*
* Command-line options: The user can specify short or long-named
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 9578f7a..ca122e4 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -21,10 +21,10 @@ static int parse_command_line(int argc, const char *const *argv, pack_opt_t *op
static void leave(int ret) H5_ATTR_NORETURN;
/* module-scoped variables */
-static int has_i = 0;
-static int has_o = 0;
-const char *infile = NULL;
-const char *outfile = NULL;
+static int has_i = 0;
+static int has_o = 0;
+static const char *infile = NULL;
+static const char *outfile = NULL;
/*
* Command-line options: The user can specify short or long-named
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 05e0be8..495954e 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -35,12 +35,12 @@
to accommodate datasets without any filters */
/* File space management strategies: see H5Fpublic.h for declarations */
-const char *FS_STRATEGY_NAME[] = {"H5F_FSPACE_STRATEGY_FSM_AGGR",
- "H5F_FSPACE_STRATEGY_PAGE",
- "H5F_FSPACE_STRATEGY_AGGR",
- "H5F_FSPACE_STRATEGY_NONE",
- "unknown",
- NULL};
+static const char *FS_STRATEGY_NAME[] = {"H5F_FSPACE_STRATEGY_FSM_AGGR",
+ "H5F_FSPACE_STRATEGY_PAGE",
+ "H5F_FSPACE_STRATEGY_AGGR",
+ "H5F_FSPACE_STRATEGY_NONE",
+ "unknown",
+ NULL};
/* Datatype statistics for datasets */
typedef struct dtype_info_t {
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index fc7d5b6..c183a41 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -39,7 +39,7 @@ typedef struct mkgrp_opt_t {
hid_t fapl_id; /* fapl to use when opening the file */
} mkgrp_opt_t;
-mkgrp_opt_t params_g; /* Command line parameter settings */
+static mkgrp_opt_t params_g; /* Command line parameter settings */
/*-------------------------------------------------------------------------
* Function: leave