From a4b44188080279fd6c22adbc5d05a376b06a8e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 7 Oct 2020 10:09:22 +0200 Subject: [PATCH] Make sparse clean This fixes the following warnings when compiling with CC=cgcc: config.c:197:46: warning: Using plain integer as NULL pointer image-ext2.c:208:9: warning: Using plain integer as NULL pointer image-ext2.c:212:9: warning: Using plain integer as NULL pointer image-ext2.c:213:9: warning: Using plain integer as NULL pointer image-hd.c:663:11: warning: symbol 'hdimage_opts' was not declared. Should it be static? image-iso.c:52:9: warning: Using plain integer as NULL pointer image-rauc.c:191:9: warning: Using plain integer as NULL pointer image-vfat.c:130:9: warning: Using plain integer as NULL pointer --- config.c | 2 +- image-ext2.c | 6 +++--- image-hd.c | 2 +- image-iso.c | 2 +- image-rauc.c | 2 +- image-vfat.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.c b/config.c index 943191c..16140a1 100644 --- a/config.c +++ b/config.c @@ -194,7 +194,7 @@ int set_config_opts(int argc, char *argv[], cfg_t *cfg) struct config *c; cfg_t *cfgsec = NULL; int num_opts = 0, n, i; - static struct option *long_options = 0; + static struct option *long_options = NULL; int ret = 0; if (cfg) diff --git a/image-ext2.c b/image-ext2.c index 8d8f838..79653a1 100644 --- a/image-ext2.c +++ b/image-ext2.c @@ -205,12 +205,12 @@ static cfg_opt_t ext_opts[] = { CFG_STR("root-owner", "0:0", CFGF_NONE), CFG_STR("extraargs", "", CFGF_NONE), CFG_STR("features", NULL, CFGF_NONE), - CFG_STR("label", 0, CFGF_NONE), + CFG_STR("label", NULL, CFGF_NONE), CFG_STR("fs-timestamp", NULL, CFGF_NONE), CFG_BOOL("use-mke2fs", cfg_false, CFGF_NONE), CFG_STR("usage-type", NULL, CFGF_NONE), - CFG_STR("mke2fs-conf", 0, CFGF_NONE), - CFG_STR("mke2fs_conf", 0, CFGF_NONE), + CFG_STR("mke2fs-conf", NULL, CFGF_NONE), + CFG_STR("mke2fs_conf", NULL, CFGF_NONE), CFG_END() }; diff --git a/image-hd.c b/image-hd.c index 74f9f1a..eb6c431 100644 --- a/image-hd.c +++ b/image-hd.c @@ -660,7 +660,7 @@ static int hdimage_setup(struct image *image, cfg_t *cfg) return 0; } -cfg_opt_t hdimage_opts[] = { +static cfg_opt_t hdimage_opts[] = { CFG_STR("align", "512", CFGF_NONE), CFG_STR("disk-signature", "", CFGF_NONE), CFG_STR("disk-uuid", NULL, CFGF_NONE), diff --git a/image-iso.c b/image-iso.c index 6e16cd4..e373b81 100644 --- a/image-iso.c +++ b/image-iso.c @@ -49,7 +49,7 @@ static int iso_generate(struct image *image) } static cfg_opt_t iso_opts[] = { - CFG_STR("boot-image", 0, CFGF_NONE), + CFG_STR("boot-image", NULL, CFGF_NONE), CFG_STR("bootargs", "-no-emul-boot -boot-load-size 4 -boot-info-table -c boot.cat -hide boot.cat", CFGF_NONE), CFG_STR("extraargs", "", CFGF_NONE), CFG_STR("input-charset", "default", CFGF_NONE), diff --git a/image-rauc.c b/image-rauc.c index 6dde4db..50a4bda 100644 --- a/image-rauc.c +++ b/image-rauc.c @@ -188,7 +188,7 @@ static cfg_opt_t file_opts[] = { static cfg_opt_t rauc_opts[] = { CFG_STR("extraargs", "", CFGF_NONE), - CFG_STR_LIST("files", 0, CFGF_NONE), + CFG_STR_LIST("files", NULL, CFGF_NONE), CFG_SEC("file", file_opts, CFGF_MULTI | CFGF_TITLE), CFG_STR("key", NULL, CFGF_NONE), CFG_STR("cert", NULL, CFGF_NONE), diff --git a/image-vfat.c b/image-vfat.c index 026e1a2..9f04c57 100644 --- a/image-vfat.c +++ b/image-vfat.c @@ -127,7 +127,7 @@ static cfg_opt_t file_opts[] = { static cfg_opt_t vfat_opts[] = { CFG_STR("extraargs", "", CFGF_NONE), CFG_STR("label", "", CFGF_NONE), - CFG_STR_LIST("files", 0, CFGF_NONE), + CFG_STR_LIST("files", NULL, CFGF_NONE), CFG_SEC("file", file_opts, CFGF_MULTI | CFGF_TITLE), CFG_END() };