trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] branch master updated: Add for_Vec to clang-format foreach macro list.
Date Sat, 26 Nov 2016 20:04:34 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  9cca290   Add for_Vec to clang-format foreach macro list.
9cca290 is described below

commit 9cca29041519fab98fd1a43c406ffb69306af0b0
Author: James Peach <jpeach@apache.org>
AuthorDate: Sat Nov 26 11:52:48 2016 -0800

    Add for_Vec to clang-format foreach macro list.
---
 .clang-format                  |  2 +-
 cmd/traffic_manager/metrics.cc |  9 +++++++--
 mgmt/api/CoreAPI.cc            |  4 ++--
 proxy/ControlBase.cc           | 23 ++++++++++++++++++-----
 4 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/.clang-format b/.clang-format
index 87d7734..747bca2 100644
--- a/.clang-format
+++ b/.clang-format
@@ -46,7 +46,7 @@ Cpp11BracedListStyle: true
 DerivePointerAlignment: false
 DisableFormat:   false
 ExperimentalAutoDetectBinPacking: false
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:   [ forv_Vec, for_Vec, forp_Vec, foreach, Q_FOREACH, BOOST_FOREACH ]
 SortIncludes:    false
 IncludeCategories: 
   - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
diff --git a/cmd/traffic_manager/metrics.cc b/cmd/traffic_manager/metrics.cc
index 546dc3e..7186cee 100644
--- a/cmd/traffic_manager/metrics.cc
+++ b/cmd/traffic_manager/metrics.cc
@@ -129,7 +129,9 @@ struct EvaluatorList {
   EvaluatorList() : update(true), passes(0) {}
   ~EvaluatorList()
   {
-    forv_Vec(Evaluator, e, this->evaluators) { delete e; }
+    forv_Vec (Evaluator, e, this->evaluators) {
+      delete e;
+    }
   }
 
   void
@@ -144,7 +146,10 @@ struct EvaluatorList {
     ink_hrtime start = ink_get_hrtime_internal();
     ink_hrtime elapsed;
 
-    forv_Vec(Evaluator, e, this->evaluators) { e->eval(L); }
+    forv_Vec (Evaluator, e, this->evaluators) {
+      e->eval(L);
+    }
+
     elapsed = ink_hrtime_diff(ink_get_hrtime_internal(), start);
     Debug("lua", "evaluated %u metrics in %fmsec", evaluators.length(), ink_hrtime_to_usec(elapsed)
/ 1000.0);
   }
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index 09045e5..fe99a95 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -340,8 +340,8 @@ ServerBacktrace(unsigned /* options */, char **trace)
   textBuffer text(0);
 
   Debug("backtrace", "tracing %zd threads for traffic_server PID %ld", threads.count(), (long)lmgmt->watched_process_pid);
-  for_Vec(pid_t, threadid, threads)
-  {
+
+  for_Vec (pid_t, threadid, threads) {
     Debug("backtrace", "tracing thread %ld", (long)threadid);
     // Get the thread name using /proc/PID/comm
     ats_scoped_fd fd;
diff --git a/proxy/ControlBase.cc b/proxy/ControlBase.cc
index 8dfcdc4..7f93f4f 100644
--- a/proxy/ControlBase.cc
+++ b/proxy/ControlBase.cc
@@ -458,8 +458,9 @@ MultiTextMod::~MultiTextMod()
 void
 MultiTextMod::print(FILE *f) const
 {
-  for_Vec(ts::Buffer, text_iter, this->text_vec)
+  for_Vec (ts::Buffer, text_iter, this->text_vec) {
     fprintf(f, "%s=%*s ", this->name(), static_cast<int>(text_iter.size()), text_iter.data());
+  }
 }
 
 void
@@ -583,17 +584,19 @@ SuffixMod::check(HttpRequestData *req) const
 {
   int path_len;
   const char *path = req->hdr->url_get()->path_get(&path_len);
+
   if (1 == static_cast<int>(this->text_vec.count()) && 1 == static_cast<int>(this->text_vec[0].size())
&&
       0 == strcmp(this->text_vec[0].data(), "*")) {
     return true;
   }
-  for_Vec(ts::Buffer, text_iter, this->text_vec)
-  {
+
+  for_Vec (ts::Buffer, text_iter, this->text_vec) {
     if (path_len >= static_cast<int>(text_iter.size()) &&
         0 == strncasecmp(path + path_len - text_iter.size(), text_iter.data(), text_iter.size()))
{
       return true;
     }
   }
+
   return false;
 }
 SuffixMod *
@@ -751,7 +754,12 @@ ControlBase::CheckModifiers(HttpRequestData *request_data)
     return false;
   }
 
-  forv_Vec(Modifier, cur_mod, _mods) if (cur_mod && !cur_mod->check(request_data))
{ return false; }
+  forv_Vec (Modifier, cur_mod, _mods) {
+    if (cur_mod && !cur_mod->check(request_data)) {
+      return false;
+    }
+  }
+
   return true;
 }
 
@@ -769,7 +777,12 @@ static const char *errorFormats[] = {
 ControlBase::Modifier *
 ControlBase::findModOfType(Modifier::Type t) const
 {
-  forv_Vec(Modifier, m, _mods) if (m && t == m->type()) { return m; }
+  forv_Vec (Modifier, m, _mods) {
+    if (m && t == m->type()) {
+      return m;
+    }
+  }
+
   return nullptr;
 }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message