From 9db1c9467c256da951f3f76cfdd616e7946640e3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 9 Jan 2017 19:28:00 +0900 Subject: [PATCH] src: Add constexpr to long_options --- src/deflatehd.cc | 2 +- src/h2load.cc | 2 +- src/inflatehd.cc | 2 +- src/nghttp.cc | 2 +- src/nghttpd.cc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/deflatehd.cc b/src/deflatehd.cc index a9086b28..2db89814 100644 --- a/src/deflatehd.cc +++ b/src/deflatehd.cc @@ -373,7 +373,7 @@ OPTIONS: << std::endl; } -static struct option long_options[] = { +constexpr static struct option long_options[] = { {"http1text", no_argument, nullptr, 't'}, {"table-size", required_argument, nullptr, 's'}, {"deflate-table-size", required_argument, nullptr, 'S'}, diff --git a/src/h2load.cc b/src/h2load.cc index 5f0558dd..e7840d25 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1839,7 +1839,7 @@ int main(int argc, char **argv) { bool nreqs_set_manually = false; while (1) { static int flag = 0; - static option long_options[] = { + constexpr static option long_options[] = { {"requests", required_argument, nullptr, 'n'}, {"clients", required_argument, nullptr, 'c'}, {"data", required_argument, nullptr, 'd'}, diff --git a/src/inflatehd.cc b/src/inflatehd.cc index 7945a0b2..9140e054 100644 --- a/src/inflatehd.cc +++ b/src/inflatehd.cc @@ -251,7 +251,7 @@ OPTIONS: ; } -static struct option long_options[] = { +constexpr static struct option long_options[] = { {"dump-header-table", no_argument, nullptr, 'd'}, {nullptr, 0, nullptr, 0}}; int main(int argc, char **argv) { diff --git a/src/nghttp.cc b/src/nghttp.cc index badbc9ca..f9ba6ce8 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -2680,7 +2680,7 @@ int main(int argc, char **argv) { bool color = false; while (1) { static int flag = 0; - static option long_options[] = { + constexpr static option long_options[] = { {"verbose", no_argument, nullptr, 'v'}, {"null-out", no_argument, nullptr, 'n'}, {"remote-name", no_argument, nullptr, 'O'}, diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 43c7e0ba..6080037b 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -202,7 +202,7 @@ int main(int argc, char **argv) { while (1) { static int flag = 0; - static option long_options[] = { + constexpr static option long_options[] = { {"address", required_argument, nullptr, 'a'}, {"daemon", no_argument, nullptr, 'D'}, {"htdocs", required_argument, nullptr, 'd'},