diff options
author | Ben Pfaff <blp@nicira.com> | 2011-05-04 13:49:42 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-05-16 13:40:47 -0700 |
commit | e3c17733704fd54fa937ed5e1e8c4b51e00961f1 (patch) | |
tree | 78dd7e21f574d1a4614df73fd79e0b239e93201c /lib | |
parent | 1102893de4f14a2d184afc640c9a1edf778c6a93 (diff) | |
download | openvswitch-e3c17733704fd54fa937ed5e1e8c4b51e00961f1.tar.gz |
Consistently write null pointer constants as NULL instead of 0.
Found with sparse.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/daemon.h | 12 | ||||
-rw-r--r-- | lib/leak-checker.h | 6 | ||||
-rw-r--r-- | lib/rtnetlink.c | 2 | ||||
-rw-r--r-- | lib/stream-ssl.h | 6 | ||||
-rw-r--r-- | lib/table.h | 12 | ||||
-rw-r--r-- | lib/vlog.h | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/lib/daemon.h b/lib/daemon.h index 4af98f624..eb38d5d87 100644 --- a/lib/daemon.h +++ b/lib/daemon.h @@ -28,12 +28,12 @@ OPT_PIDFILE, \ OPT_MONITOR -#define DAEMON_LONG_OPTIONS \ - {"detach", no_argument, 0, OPT_DETACH}, \ - {"no-chdir", no_argument, 0, OPT_NO_CHDIR}, \ - {"pidfile", optional_argument, 0, OPT_PIDFILE}, \ - {"overwrite-pidfile", no_argument, 0, OPT_OVERWRITE_PIDFILE},\ - {"monitor", no_argument, 0, OPT_MONITOR} +#define DAEMON_LONG_OPTIONS \ + {"detach", no_argument, NULL, OPT_DETACH}, \ + {"no-chdir", no_argument, NULL, OPT_NO_CHDIR}, \ + {"pidfile", optional_argument, NULL, OPT_PIDFILE}, \ + {"overwrite-pidfile", no_argument, NULL, OPT_OVERWRITE_PIDFILE}, \ + {"monitor", no_argument, NULL, OPT_MONITOR} #define DAEMON_OPTION_HANDLERS \ case OPT_DETACH: \ diff --git a/lib/leak-checker.h b/lib/leak-checker.h index 8d7624de8..f6ee5c133 100644 --- a/lib/leak-checker.h +++ b/lib/leak-checker.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ OPT_CHECK_LEAKS, \ OPT_LEAK_LIMIT #define LEAK_CHECKER_LONG_OPTIONS \ - {"check-leaks", required_argument, 0, OPT_CHECK_LEAKS}, \ - {"leak-limit", required_argument, 0, OPT_LEAK_LIMIT} + {"check-leaks", required_argument, NULL, OPT_CHECK_LEAKS}, \ + {"leak-limit", required_argument, NULL, OPT_LEAK_LIMIT} #define LEAK_CHECKER_OPTION_HANDLERS \ case OPT_CHECK_LEAKS: \ leak_checker_start(optarg); \ diff --git a/lib/rtnetlink.c b/lib/rtnetlink.c index 6ed85abbb..d15669a08 100644 --- a/lib/rtnetlink.c +++ b/lib/rtnetlink.c @@ -55,7 +55,7 @@ rtnetlink_create(int multicast_group, rtnetlink_parse_func *parse, struct rtnetlink *rtn; rtn = xzalloc(sizeof *rtn); - rtn->notify_sock = 0; + rtn->notify_sock = NULL; rtn->multicast_group = multicast_group; rtn->parse = parse; rtn->change = change; diff --git a/lib/stream-ssl.h b/lib/stream-ssl.h index 29c3120fd..83b9ddba2 100644 --- a/lib/stream-ssl.h +++ b/lib/stream-ssl.h @@ -27,9 +27,9 @@ void stream_ssl_set_key_and_cert(const char *private_key_file, const char *certificate_file); #define STREAM_SSL_LONG_OPTIONS \ - {"private-key", required_argument, 0, 'p'}, \ - {"certificate", required_argument, 0, 'c'}, \ - {"ca-cert", required_argument, 0, 'C'} + {"private-key", required_argument, NULL, 'p'}, \ + {"certificate", required_argument, NULL, 'c'}, \ + {"ca-cert", required_argument, NULL, 'C'} #define STREAM_SSL_OPTION_HANDLERS \ case 'p': \ diff --git a/lib/table.h b/lib/table.h index e35fefaf4..146d4dfe3 100644 --- a/lib/table.h +++ b/lib/table.h @@ -85,12 +85,12 @@ struct table_style { OPT_PRETTY, \ OPT_BARE -#define TABLE_LONG_OPTIONS \ - {"format", required_argument, 0, 'f'}, \ - {"data", required_argument, 0, 'd'}, \ - {"no-headings", no_argument, 0, OPT_NO_HEADINGS}, \ - {"pretty", no_argument, 0, OPT_PRETTY}, \ - {"bare", no_argument, 0, OPT_BARE} +#define TABLE_LONG_OPTIONS \ + {"format", required_argument, NULL, 'f'}, \ + {"data", required_argument, NULL, 'd'}, \ + {"no-headings", no_argument, NULL, OPT_NO_HEADINGS}, \ + {"pretty", no_argument, NULL, OPT_PRETTY}, \ + {"bare", no_argument, NULL, OPT_BARE} #define TABLE_OPTION_HANDLERS(STYLE) \ case 'f': \ diff --git a/lib/vlog.h b/lib/vlog.h index bbc00ad25..12844c6f7 100644 --- a/lib/vlog.h +++ b/lib/vlog.h @@ -222,8 +222,8 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level, /* Command line processing. */ #define VLOG_OPTION_ENUMS OPT_LOG_FILE #define VLOG_LONG_OPTIONS \ - {"verbose", optional_argument, 0, 'v'}, \ - {"log-file", optional_argument, 0, OPT_LOG_FILE} + {"verbose", optional_argument, NULL, 'v'}, \ + {"log-file", optional_argument, NULL, OPT_LOG_FILE} #define VLOG_OPTION_HANDLERS \ case 'v': \ vlog_set_verbosity(optarg); \ |