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/tunelp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sys-utils/tunelp.c') diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c index 7b38255d6..8cfbe80a2 100644 --- a/sys-utils/tunelp.c +++ b/sys-utils/tunelp.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) print_usage(stderr); cmdst = cmds = xmalloc(sizeof(struct command)); - cmds->next = 0; + cmds->next = NULL; show_irq = 1; while ((c = getopt_long(argc, argv, "t:c:w:a:i:ho:C:sq:rT:vV", longopts, NULL)) != -1) { @@ -161,35 +161,35 @@ int main(int argc, char **argv) cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 't': cmds->op = LPTIME; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'c': cmds->op = LPCHAR; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'w': cmds->op = LPWAIT; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'a': cmds->op = LPABORT; cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'q': show_irq = parse_switch(optarg, _("argument error"), "on", "off", NULL); @@ -199,14 +199,14 @@ int main(int argc, char **argv) cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'C': cmds->op = LPCAREFUL; cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 's': show_irq = 0; @@ -214,14 +214,14 @@ int main(int argc, char **argv) cmds->val = 0; cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'r': cmds->op = LPRESET; cmds->val = 0; cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'T': /* Note: this will do the wrong thing on @@ -231,7 +231,7 @@ int main(int argc, char **argv) cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'v': case 'V': -- cgit v1.2.3-55-g7522