Silence compiler warnings
authorSitsofe Wheeer <sitsofe@yahoo.com>
Sun, 27 Nov 2016 07:53:29 +0000 (07:53 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 21:40:26 +0000 (21:40 +0000)
- Mark __parse_jobs_ini and fmt_desc[] as static as they aren't used
  outside their modules.
- Cast the shifted trim state enum to an unsigned int to silence
  spurious Wshift-sign-overflow warning.

Signed-off-by: Sitsofe Wheeer <sitsofe@yahoo.com>
init.c
options.c
stat.h

diff --git a/init.c b/init.c
index d8c0bd17a9bccb024cbf26972dc39037bc6139fa..382fa1ff6de82edc9d74644edcace6a7f233839e 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1679,7 +1679,7 @@ static int is_empty_or_comment(char *line)
 /*
  * This is our [ini] type file parser.
  */
-int __parse_jobs_ini(struct thread_data *td,
+static int __parse_jobs_ini(struct thread_data *td,
                char *file, int is_buf, int stonewall_flag, int type,
                int nested, char *name, char ***popts, int *aopts, int *nopts)
 {
index 5937eb675c6756aaeff7982fc6286c0d00c32f82..dfecd9d8bfa18f32bbdbeb9bf7ccabb4c8935100 100644 (file)
--- a/options.c
+++ b/options.c
@@ -22,7 +22,7 @@ char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 };
 
 #define cb_data_to_td(data)    container_of(data, struct thread_data, o)
 
-struct pattern_fmt_desc fmt_desc[] = {
+static struct pattern_fmt_desc fmt_desc[] = {
        {
                .fmt   = "%o",
                .len   = FIELD_SIZE(struct io_u *, offset),
diff --git a/stat.h b/stat.h
index de5c12a5f6b9394d0de483d2ee04bc2d84a826dc..7a25415adb31cbe800488f313a5cedfb1ad10f32 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -123,7 +123,7 @@ struct group_run_stats {
 #define BLOCK_INFO_STATE(block_info)           \
        ((block_info) >> BLOCK_INFO_STATE_SHIFT)
 #define BLOCK_INFO(state, trim_cycles) \
-       ((trim_cycles) | ((state) << BLOCK_INFO_STATE_SHIFT))
+       ((trim_cycles) | ((unsigned int) (state) << BLOCK_INFO_STATE_SHIFT))
 #define BLOCK_INFO_SET_STATE(block_info, state)        \
        BLOCK_INFO(state, BLOCK_INFO_TRIMS(block_info))
 enum block_info_state {