Commit cc6f7591 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Add static to constexpr char[]

parent c23fc86a
......@@ -84,7 +84,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
rv = shrpx_signal_unblock_all();
if (rv != 0) {
constexpr char msg[] = "Unblocking all signals failed\n";
static constexpr char msg[] = "Unblocking all signals failed\n";
while (write(STDERR_FILENO, msg, str_size(msg)) == -1 && errno == EINTR)
;
nghttp2_Exit(EXIT_FAILURE);
......@@ -95,7 +95,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
rv = execv(argv[0], argv);
if (rv == -1) {
constexpr char msg[] = "Could not execute command\n";
static constexpr char msg[] = "Could not execute command\n";
while (write(STDERR_FILENO, msg, str_size(msg)) == -1 && errno == EINTR)
;
nghttp2_Exit(EXIT_FAILURE);
......
......@@ -70,7 +70,7 @@ void test_shrpx_tls_create_lookup_tree(void) {
CU_ASSERT(-1 == tree->lookup(StringRef{}));
CU_ASSERT(5 == tree->lookup(hostnames[5]));
CU_ASSERT(6 == tree->lookup(hostnames[6]));
constexpr char h6[] = "pdylay.sourceforge.net";
static constexpr char h6[] = "pdylay.sourceforge.net";
for (int i = 0; i < 7; ++i) {
CU_ASSERT(-1 == tree->lookup(StringRef{h6 + i, str_size(h6) - i}));
}
......@@ -119,7 +119,8 @@ void test_shrpx_tls_create_lookup_tree(void) {
void test_shrpx_tls_cert_lookup_tree_add_ssl_ctx(void) {
int rv;
constexpr char nghttp2_certfile[] = NGHTTP2_SRC_DIR "/test.nghttp2.org.pem";
static constexpr char nghttp2_certfile[] =
NGHTTP2_SRC_DIR "/test.nghttp2.org.pem";
auto nghttp2_ssl_ctx = SSL_CTX_new(SSLv23_server_method());
auto nghttp2_ssl_ctx_del = defer(SSL_CTX_free, nghttp2_ssl_ctx);
auto nghttp2_tls_ctx_data = make_unique<tls::TLSContextData>();
......@@ -129,7 +130,8 @@ void test_shrpx_tls_cert_lookup_tree_add_ssl_ctx(void) {
CU_ASSERT(1 == rv);
constexpr char examples_certfile[] = NGHTTP2_SRC_DIR "/test.example.com.pem";
static constexpr char examples_certfile[] =
NGHTTP2_SRC_DIR "/test.example.com.pem";
auto examples_ssl_ctx = SSL_CTX_new(SSLv23_server_method());
auto examples_ssl_ctx_del = defer(SSL_CTX_free, examples_ssl_ctx);
auto examples_tls_ctx_data = make_unique<tls::TLSContextData>();
......
......@@ -716,7 +716,7 @@ template <typename OutputIt, typename Generator>
OutputIt random_alpha_digit(OutputIt first, OutputIt last, Generator &gen) {
// If we use uint8_t instead char, gcc 6.2.0 complains by shouting
// char-array initialized from wide string.
constexpr char s[] =
static constexpr char s[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
std::uniform_int_distribution<> dis(0, 26 * 2 + 10 - 1);
for (; first != last; ++first) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment