From 47ee8e3c795160f034cc00421577dd98018ca952 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 18 Aug 2013 22:08:40 +0900 Subject: [PATCH] src: Code cleanup --- src/nghttp.cc | 34 +++++++++++++------------- src/nghttpd.cc | 16 ++++++------ src/shrpx.cc | 66 +++++++++++++++++++++++++------------------------- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index 26e7ec3e..379484ad 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -1462,23 +1462,23 @@ int main(int argc, char **argv) while(1) { int flag; static option long_options[] = { - {"verbose", no_argument, 0, 'v' }, - {"null-out", no_argument, 0, 'n' }, - {"remote-name", no_argument, 0, 'O' }, - {"timeout", required_argument, 0, 't' }, - {"window-bits", required_argument, 0, 'w' }, - {"get-assets", no_argument, 0, 'a' }, - {"stat", no_argument, 0, 's' }, - {"cert", required_argument, &flag, 1 }, - {"key", required_argument, &flag, 2 }, - {"help", no_argument, 0, 'h' }, - {"header", required_argument, 0, 'H' }, - {"data", required_argument, 0, 'd' }, - {"multiply", required_argument, 0, 'm' }, - {"no-flow-control", no_argument, 0, 'f'}, - {"upgrade", no_argument, 0, 'u'}, - {"pri", required_argument, 0, 'p'}, - {0, 0, 0, 0 } + {"verbose", no_argument, nullptr, 'v'}, + {"null-out", no_argument, nullptr, 'n'}, + {"remote-name", no_argument, nullptr, 'O'}, + {"timeout", required_argument, nullptr, 't'}, + {"window-bits", required_argument, nullptr, 'w'}, + {"get-assets", no_argument, nullptr, 'a'}, + {"stat", no_argument, nullptr, 's'}, + {"cert", required_argument, &flag, 1}, + {"key", required_argument, &flag, 2}, + {"help", no_argument, nullptr, 'h'}, + {"header", required_argument, nullptr, 'H'}, + {"data", required_argument, nullptr, 'd'}, + {"multiply", required_argument, nullptr, 'm'}, + {"no-flow-control", no_argument, nullptr, 'f'}, + {"upgrade", no_argument, nullptr, 'u'}, + {"pri", required_argument, nullptr, 'p'}, + {nullptr, 0, nullptr, 0 } }; int option_index = 0; int c = getopt_long(argc, argv, "Oad:fm:np:hH:vst:uw:", long_options, diff --git a/src/nghttpd.cc b/src/nghttpd.cc index ca534c15..c001540d 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -87,14 +87,14 @@ int main(int argc, char **argv) while(1) { int flag; static option long_options[] = { - {"daemon", no_argument, 0, 'D' }, - {"htdocs", required_argument, 0, 'd' }, - {"help", no_argument, 0, 'h' }, - {"verbose", no_argument, 0, 'v' }, - {"verify-client", no_argument, 0, 'V' }, - {"no-tls", no_argument, &flag, 1 }, - {"no-flow-control", no_argument, 0, 'f'}, - {0, 0, 0, 0 } + {"daemon", no_argument, nullptr, 'D'}, + {"htdocs", required_argument, nullptr, 'd'}, + {"help", no_argument, nullptr, 'h'}, + {"verbose", no_argument, nullptr, 'v'}, + {"verify-client", no_argument, nullptr, 'V'}, + {"no-tls", no_argument, &flag, 1}, + {"no-flow-control", no_argument, nullptr, 'f'}, + {nullptr, 0, nullptr, 0} }; int option_index = 0; int c = getopt_long(argc, argv, "DVd:fhv", long_options, &option_index); diff --git a/src/shrpx.cc b/src/shrpx.cc index 6643bf42..0ae70e92 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -619,38 +619,38 @@ int main(int argc, char **argv) while(1) { int flag; static option long_options[] = { - {"daemon", no_argument, 0, 'D' }, - {"log-level", required_argument, 0, 'L' }, - {"backend", required_argument, 0, 'b' }, - {"spdy-max-concurrent-streams", required_argument, 0, 'c' }, - {"frontend", required_argument, 0, 'f' }, - {"help", no_argument, 0, 'h' }, - {"insecure", no_argument, 0, 'k' }, - {"workers", required_argument, 0, 'n' }, - {"client-proxy", no_argument, 0, 'p' }, - {"spdy-proxy", no_argument, 0, 's' }, - {"version", no_argument, 0, 'v' }, - {"add-x-forwarded-for", no_argument, &flag, 1 }, - {"frontend-spdy-read-timeout", required_argument, &flag, 2 }, - {"frontend-read-timeout", required_argument, &flag, 3 }, - {"frontend-write-timeout", required_argument, &flag, 4 }, - {"backend-read-timeout", required_argument, &flag, 5 }, - {"backend-write-timeout", required_argument, &flag, 6 }, - {"accesslog", no_argument, &flag, 7 }, - {"backend-keep-alive-timeout", required_argument, &flag, 8 }, - {"frontend-spdy-window-bits", required_argument, &flag, 9 }, - {"pid-file", required_argument, &flag, 10 }, - {"user", required_argument, &flag, 11 }, - {"conf", required_argument, &flag, 12 }, - {"syslog", no_argument, &flag, 13 }, - {"syslog-facility", required_argument, &flag, 14 }, - {"backlog", required_argument, &flag, 15 }, - {"ciphers", required_argument, &flag, 16 }, - {"client", no_argument, &flag, 17 }, - {"backend-spdy-window-bits", required_argument, &flag, 18 }, - {"cacert", required_argument, &flag, 19 }, - {"backend-ipv4", no_argument, &flag, 20 }, - {"backend-ipv6", no_argument, &flag, 21 }, + {"daemon", no_argument, nullptr, 'D'}, + {"log-level", required_argument, nullptr, 'L'}, + {"backend", required_argument, nullptr, 'b'}, + {"spdy-max-concurrent-streams", required_argument, nullptr, 'c'}, + {"frontend", required_argument, nullptr, 'f'}, + {"help", no_argument, nullptr, 'h'}, + {"insecure", no_argument, nullptr, 'k'}, + {"workers", required_argument, nullptr, 'n'}, + {"client-proxy", no_argument, nullptr, 'p'}, + {"spdy-proxy", no_argument, nullptr, 's'}, + {"version", no_argument, nullptr, 'v'}, + {"add-x-forwarded-for", no_argument, &flag, 1}, + {"frontend-spdy-read-timeout", required_argument, &flag, 2}, + {"frontend-read-timeout", required_argument, &flag, 3}, + {"frontend-write-timeout", required_argument, &flag, 4}, + {"backend-read-timeout", required_argument, &flag, 5}, + {"backend-write-timeout", required_argument, &flag, 6}, + {"accesslog", no_argument, &flag, 7}, + {"backend-keep-alive-timeout", required_argument, &flag, 8}, + {"frontend-spdy-window-bits", required_argument, &flag, 9}, + {"pid-file", required_argument, &flag, 10}, + {"user", required_argument, &flag, 11}, + {"conf", required_argument, &flag, 12}, + {"syslog", no_argument, &flag, 13}, + {"syslog-facility", required_argument, &flag, 14}, + {"backlog", required_argument, &flag, 15}, + {"ciphers", required_argument, &flag, 16}, + {"client", no_argument, &flag, 17}, + {"backend-spdy-window-bits", required_argument, &flag, 18}, + {"cacert", required_argument, &flag, 19}, + {"backend-ipv4", no_argument, &flag, 20}, + {"backend-ipv6", no_argument, &flag, 21}, {"private-key-passwd-file", required_argument, &flag, 22}, {"no-via", no_argument, &flag, 23}, {"subcert", required_argument, &flag, 24}, @@ -660,7 +660,7 @@ int main(int argc, char **argv) {"frontend-no-tls", no_argument, &flag, 29}, {"backend-tls-sni-field", required_argument, &flag, 31}, {"honor-cipher-order", no_argument, &flag, 32}, - {0, 0, 0, 0 } + {nullptr, 0, nullptr, 0 } }; int option_index = 0; int c = getopt_long(argc, argv, "DL:b:c:f:hkn:psv", long_options,