From 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 11 Feb 2017 20:23:26 +0000 Subject: misc: do not use plain 0 as NULL [smatch scan] text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola --- sys-utils/losetup.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'sys-utils/losetup.c') diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index ad508109d..5f599ead5 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -574,28 +574,28 @@ int main(int argc, char **argv) OPT_DIO }; static const struct option longopts[] = { - { "all", 0, 0, 'a' }, - { "set-capacity", 1, 0, 'c' }, - { "detach", 1, 0, 'd' }, - { "detach-all", 0, 0, 'D' }, - { "find", 0, 0, 'f' }, - { "nooverlap", 0, 0, 'L' }, - { "help", 0, 0, 'h' }, - { "associated", 1, 0, 'j' }, - { "json", 0, 0, 'J' }, - { "list", 0, 0, 'l' }, - { "noheadings", 0, 0, 'n' }, - { "offset", 1, 0, 'o' }, - { "output", 1, 0, 'O' }, - { "sizelimit", 1, 0, OPT_SIZELIMIT }, - { "partscan", 0, 0, 'P' }, - { "read-only", 0, 0, 'r' }, - { "direct-io", 2, 0, OPT_DIO }, - { "raw", 0, 0, OPT_RAW }, - { "show", 0, 0, OPT_SHOW }, - { "verbose", 0, 0, 'v' }, - { "version", 0, 0, 'V' }, - { NULL, 0, 0, 0 } + { "all", no_argument, NULL, 'a' }, + { "set-capacity", required_argument, NULL, 'c' }, + { "detach", required_argument, NULL, 'd' }, + { "detach-all", no_argument, NULL, 'D' }, + { "find", no_argument, NULL, 'f' }, + { "nooverlap", no_argument, NULL, 'L' }, + { "help", no_argument, NULL, 'h' }, + { "associated", required_argument, NULL, 'j' }, + { "json", no_argument, NULL, 'J' }, + { "list", no_argument, NULL, 'l' }, + { "noheadings", no_argument, NULL, 'n' }, + { "offset", required_argument, NULL, 'o' }, + { "output", required_argument, NULL, 'O' }, + { "sizelimit", required_argument, NULL, OPT_SIZELIMIT }, + { "partscan", no_argument, NULL, 'P' }, + { "read-only", no_argument, NULL, 'r' }, + { "direct-io", optional_argument, NULL, OPT_DIO }, + { "raw", no_argument, NULL, OPT_RAW }, + { "show", no_argument, NULL, OPT_SHOW }, + { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 } }; static const ul_excl_t excl[] = { /* rows and cols in ASCII order */ -- cgit v1.2.3-55-g7522