This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/7.1.x by this push:
new 69a76c1 Ran clang-tidy with modernize-raw-string-literal
69a76c1 is described below
commit 69a76c11d89cbc7eb65b67512bf4fe59fa99b9ce
Author: Bryan Call <[email protected]>
AuthorDate: Mon Jun 5 15:10:17 2017 -0700
Ran clang-tidy with modernize-raw-string-literal
---
cmd/traffic_layout/traffic_layout.cc | 4 ++--
cmd/traffic_via/traffic_via.cc | 2 +-
example/remap_header_add/remap_header_add.cc | 2 +-
iocore/net/SSLCertLookup.cc | 2 +-
mgmt/RecordsConfig.cc | 4 ++--
mgmt/WebMgmtUtils.cc | 2 +-
plugins/esi/test/utils_test.cc | 2 +-
proxy/InkAPITest.cc | 2 +-
proxy/http/remap/RemapConfig.cc | 12 ++++++------
proxy/http2/test_HPACK.cc | 6 +++---
10 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/cmd/traffic_layout/traffic_layout.cc
b/cmd/traffic_layout/traffic_layout.cc
index f10fc17..cce710b 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -61,7 +61,7 @@ static void
print_feature(const char *name, const char *value, bool json, bool last =
false)
{
if (json) {
- printf(" \"%s\": \"%s\"%s", name, value, last ? "\n" : ",\n");
+ printf(R"( "%s": "%s"%s)", name, value, last ? "\n" : ",\n");
} else {
printf("#define %s \"%s\"\n", name, value);
}
@@ -126,7 +126,7 @@ static void
print_var(const char *name, char *value, bool json, bool free = true, bool
last = false)
{
if (json) {
- printf(" \"%s\": \"%s\"%s", name, value, last ? "\n" : ",\n");
+ printf(R"( "%s": "%s"%s)", name, value, last ? "\n" : ",\n");
} else {
printf("%s: %s\n", name, value);
}
diff --git a/cmd/traffic_via/traffic_via.cc b/cmd/traffic_via/traffic_via.cc
index 11789bc..4a82b73 100644
--- a/cmd/traffic_via/traffic_via.cc
+++ b/cmd/traffic_via/traffic_via.cc
@@ -269,7 +269,7 @@ filterViaHeader()
int pcreExecCode;
int i;
const char *viaPattern =
- "\\[([ucsfpe]+[^\\]]+)\\]"; // Regex to match via header with in [] which
can start with character class ucsfpe
+ R"(\[([ucsfpe]+[^\]]+)\])"; // Regex to match via header with in [] which
can start with character class ucsfpe
char *viaHeaderString;
char viaHeader[1024];
diff --git a/example/remap_header_add/remap_header_add.cc
b/example/remap_header_add/remap_header_add.cc
index c3c5b54..21feef0 100644
--- a/example/remap_header_add/remap_header_add.cc
+++ b/example/remap_header_add/remap_header_add.cc
@@ -156,7 +156,7 @@ TSRemapDoRemap(void *ih, NOWARN_UNUSED TSHttpTxn txn,
NOWARN_UNUSED TSRemapReque
}
for (int i = 0; i < rl->nvc; ++i) {
- TSDebug(TAG, "Attaching header \"%s\" with value \"%s\".", rl->name[i],
rl->val[i]);
+ TSDebug(TAG, R"(Attaching header "%s" with value "%s".)", rl->name[i],
rl->val[i]);
TSMLoc field_loc;
if (TSMimeHdrFieldCreate(req_bufp, req_loc, &field_loc) == TS_SUCCESS) {
diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index 1e4fb09..a1dbe5a 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -306,7 +306,7 @@ SSLCertLookup::get(unsigned i) const
struct ats_wildcard_matcher {
ats_wildcard_matcher()
{
- if (regex.compile("^\\*\\.[^\\*.]+") != 0) {
+ if (regex.compile(R"(^\*\.[^\*.]+)") != 0) {
Fatal("failed to compile TLS wildcard matching regex");
}
}
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 74b49df..54f28ad 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -259,7 +259,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.cluster.mcport", RECD_INT, "8089", RECU_DYNAMIC,
RR_REQUIRED, RECC_NULL, nullptr, RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.cluster.mc_group_addr", RECD_STRING,
"224.0.1.37", RECU_DYNAMIC, RR_REQUIRED, RECC_IP,
"[0-255]\\.[0-255]\\.[0-255]\\.[0-255]", RECA_NULL}
+ {RECT_CONFIG, "proxy.config.cluster.mc_group_addr", RECD_STRING,
"224.0.1.37", RECU_DYNAMIC, RR_REQUIRED, RECC_IP,
R"([0-255]\.[0-255]\.[0-255]\.[0-255])", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cluster.mc_ttl", RECD_INT, "1", RECU_DYNAMIC,
RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
@@ -1297,7 +1297,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.ssl.wire_trace_enabled", RECD_INT, "0",
RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.ssl.wire_trace_addr", RECD_STRING, nullptr ,
RECU_DYNAMIC, RR_NULL, RECC_IP, "[0-255]\\.[0-255]\\.[0-255]\\.[0-255]",
RECA_NULL}
+ {RECT_CONFIG, "proxy.config.ssl.wire_trace_addr", RECD_STRING, nullptr ,
RECU_DYNAMIC, RR_NULL, RECC_IP, R"([0-255]\.[0-255]\.[0-255]\.[0-255])",
RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.wire_trace_percentage", RECD_INT, "0",
RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-100]", RECA_NULL}
,
diff --git a/mgmt/WebMgmtUtils.cc b/mgmt/WebMgmtUtils.cc
index 3d9120d..b71c9ec 100644
--- a/mgmt/WebMgmtUtils.cc
+++ b/mgmt/WebMgmtUtils.cc
@@ -1181,7 +1181,7 @@ recordIPCheck(const char *pattern, const char *value)
// int result;
bool check;
const char *range_pattern =
-
"\\[[0-9]+\\-[0-9]+\\]\\\\\\.\\[[0-9]+\\-[0-9]+\\]\\\\\\.\\[[0-9]+\\-[0-9]+\\]\\\\\\.\\[[0-9]+\\-[0-9]+\\]";
+
R"(\[[0-9]+\-[0-9]+\]\\\.\[[0-9]+\-[0-9]+\]\\\.\[[0-9]+\-[0-9]+\]\\\.\[[0-9]+\-[0-9]+\])";
const char *ip_pattern =
"[0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9]";
Tokenizer dotTok1(".");
diff --git a/plugins/esi/test/utils_test.cc b/plugins/esi/test/utils_test.cc
index d623511..481bfbc 100644
--- a/plugins/esi/test/utils_test.cc
+++ b/plugins/esi/test/utils_test.cc
@@ -93,7 +93,7 @@ main()
const char *expected_strs7[] = {"key1", "val1", nullptr};
checkAttributes("test7", attr_list, expected_strs7);
- const char *escaped_sequence =
"{\\\"site-attribute\\\":\\\"content=no_expandable; ajax_cert_expandable\\\"}";
+ const char *escaped_sequence =
R"({\"site-attribute\":\"content=no_expandable; ajax_cert_expandable\"})";
string str8("pos=\"FPM1\" spaceid=96584352 extra_mime=\"");
str8.append(escaped_sequence);
str8.append("\" foo=bar a=\"b\"");
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 277cbff..d393ab3 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -5439,7 +5439,7 @@ REGRESSION_TEST(SDK_API_TSMgmtGet)(RegressionTest *test,
int /* atype ATS_UNUSED
err = 1;
} else if (strcmp(svalue, CONFIG_PARAM_STRING_VALUE) != 0) {
SDK_RPRINT(test, "TSMgmtStringGet", "TestCase1.4", TC_FAIL,
- "got incorrect value of param %s, should have been \"%s\",
found \"%s\"", CONFIG_PARAM_STRING_NAME,
+ R"(got incorrect value of param %s, should have been "%s",
found "%s")", CONFIG_PARAM_STRING_NAME,
CONFIG_PARAM_STRING_VALUE, svalue);
err = 1;
} else {
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index 40f245b..1f43d4a 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -223,7 +223,7 @@ parse_activate_directive(const char *directive,
BUILD_TABLE_INFO *bti, char *err
}
if ((rp = acl_filter_rule::find_byname(bti->rules_list, (const char
*)bti->paramv[1])) == nullptr) {
- snprintf(errbuf, errbufsize, "Undefined filter \"%s\" in directive
\"%s\"", bti->paramv[1], directive);
+ snprintf(errbuf, errbufsize, R"(Undefined filter "%s" in directive "%s")",
bti->paramv[1], directive);
Debug("url_rewrite", "[parse_directive] %s", errbuf);
return (const char *)errbuf;
}
@@ -250,7 +250,7 @@ parse_deactivate_directive(const char *directive,
BUILD_TABLE_INFO *bti, char *e
}
if ((rp = acl_filter_rule::find_byname(bti->rules_list, (const char
*)bti->paramv[1])) == nullptr) {
- snprintf(errbuf, errbufsize, "Undefined filter \"%s\" in directive
\"%s\"", bti->paramv[1], directive);
+ snprintf(errbuf, errbufsize, R"(Undefined filter "%s" in directive "%s")",
bti->paramv[1], directive);
Debug("url_rewrite", "[parse_directive] %s", errbuf);
return (const char *)errbuf;
}
@@ -832,19 +832,19 @@ remap_load_plugin(const char **argv, int argc,
url_mapping *mp, char *errbuf, in
pi->fp_tsremap_os_response = (remap_plugin_info::_tsremap_os_response
*)dlsym(pi->dlh, TSREMAP_FUNCNAME_OS_RESPONSE);
if (!pi->fp_tsremap_init) {
- snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap
plugin \"%s\"", TSREMAP_FUNCNAME_INIT, c);
+ snprintf(errbuf, errbufsize, R"(Can't find "%s" function in remap
plugin "%s")", TSREMAP_FUNCNAME_INIT, c);
retcode = -10;
} else if (!pi->fp_tsremap_new_instance &&
pi->fp_tsremap_delete_instance) {
snprintf(errbuf, errbufsize,
- "Can't find \"%s\" function in remap plugin \"%s\" which is
required if \"%s\" function exists",
+ R"(Can't find "%s" function in remap plugin "%s" which is
required if "%s" function exists)",
TSREMAP_FUNCNAME_NEW_INSTANCE, c,
TSREMAP_FUNCNAME_DELETE_INSTANCE);
retcode = -11;
} else if (!pi->fp_tsremap_do_remap) {
- snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap
plugin \"%s\"", TSREMAP_FUNCNAME_DO_REMAP, c);
+ snprintf(errbuf, errbufsize, R"(Can't find "%s" function in remap
plugin "%s")", TSREMAP_FUNCNAME_DO_REMAP, c);
retcode = -12;
} else if (pi->fp_tsremap_new_instance &&
!pi->fp_tsremap_delete_instance) {
snprintf(errbuf, errbufsize,
- "Can't find \"%s\" function in remap plugin \"%s\" which is
required if \"%s\" function exists",
+ R"(Can't find "%s" function in remap plugin "%s" which is
required if "%s" function exists)",
TSREMAP_FUNCNAME_DELETE_INSTANCE, c,
TSREMAP_FUNCNAME_NEW_INSTANCE);
retcode = -13;
}
diff --git a/proxy/http2/test_HPACK.cc b/proxy/http2/test_HPACK.cc
index 572677e..accef67 100644
--- a/proxy/http2/test_HPACK.cc
+++ b/proxy/http2/test_HPACK.cc
@@ -258,7 +258,7 @@ test_encoding(const string filename_in, const string
filename_out)
break;
}
pack(encoded, written, packed);
- ofs << " \"wire\": \"" << packed << "\"" << endl;
+ ofs << R"( "wire": ")" << packed << "\"" << endl;
ofs << " }," << endl;
}
// Prepare for next sequence
@@ -303,13 +303,13 @@ test_encoding(const string filename_in, const string
filename_out)
return result;
}
pack(encoded, written, packed);
- ofs << " \"wire\": \"" << packed << "\"" << endl;
+ ofs << R"( "wire": ")" << packed << "\"" << endl;
ofs << " }" << endl;
decoded.destroy();
original.destroy();
ofs << " ]," << endl;
- ofs << " \"description\": \"Apache Traffic Server\"" << endl;
+ ofs << R"( "description": "Apache Traffic Server")" << endl;
ofs << "}" << endl;
return result;
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].