trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch master updated: Ran clang-tidy with modernize-raw-string-literal
Date Mon, 17 Apr 2017 14:48:28 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  595c354   Ran clang-tidy with modernize-raw-string-literal
595c354 is described below

commit 595c354805a781221ca4138b70b25228a167edad
Author: Bryan Call <bcall@apache.org>
AuthorDate: Sun Apr 16 19:29:08 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 7f92a07..09df95e 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);
   }
@@ -133,7 +133,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 b0a5d0e..f2fa01e 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 75ab12b..dc1690a 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 f129af3..f87463e 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -263,7 +263,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}
   ,
@@ -1303,7 +1303,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 a35efd5..c9273a9 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 6721f01..0db012f 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 15bab02..31f276e 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
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message