You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/02/14 22:58:06 UTC
[trafficserver] branch master updated: MemView: Change name space
to 'ts'. Fix compiler error for gcc 4.9 / Debian 7.
This is an automated email from the ASF dual-hosted git repository.
amc 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 c771624 MemView: Change name space to 'ts'. Fix compiler error for gcc 4.9 / Debian 7.
c771624 is described below
commit c771624b0fb395e0287b2a507c8a0f13f87a52d2
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Tue Feb 14 16:57:17 2017 -0600
MemView: Change name space to 'ts'.
Fix compiler error for gcc 4.9 / Debian 7.
---
lib/ts/MemView.cc | 2 +-
lib/ts/MemView.h | 10 ++++++----
lib/ts/test_MemView.cc | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/ts/MemView.cc b/lib/ts/MemView.cc
index df842b7..a7cf3ab 100644
--- a/lib/ts/MemView.cc
+++ b/lib/ts/MemView.cc
@@ -2,7 +2,7 @@
#include <sstream>
#include <ctype.h>
-namespace ApacheTrafficServer
+namespace ts
{
int
memcmp(MemView const &lhs, MemView const &rhs)
diff --git a/lib/ts/MemView.h b/lib/ts/MemView.h
index 1d8ad30..aaa24e6 100644
--- a/lib/ts/MemView.h
+++ b/lib/ts/MemView.h
@@ -35,7 +35,7 @@
#include <string>
/// Apache Traffic Server commons.
-namespace ApacheTrafficServer
+namespace ts
{
class MemView;
class StringView;
@@ -1055,22 +1055,24 @@ StringView::suffix(const char *p) const
return zret;
}
+// gcc 4.9 - it considers passing this->find(...) to suffix() to be amibugous between the const char*
+// overload and the std::function<bool (char)>. This shows up on Debian 7, so let's try a cast to help out.
inline auto
StringView::suffix(char c) -> self
{
- return this->suffix(this->find(c));
+ return this->suffix(static_cast<const char*>(this->find(c)));
}
inline auto
StringView::suffix(self delimiters) -> self
{
- return this->suffix(this->find(delimiters));
+ return this->suffix(static_cast<const char*>(this->find(delimiters)));
}
inline auto
StringView::suffix(std::function<bool(char)> const &pred) -> self
{
- return this->suffix(this->find(pred));
+ return this->suffix(static_cast<const char*>(this->find(pred)));
}
inline StringView
diff --git a/lib/ts/test_MemView.cc b/lib/ts/test_MemView.cc
index 1ef9549..57774f8 100644
--- a/lib/ts/test_MemView.cc
+++ b/lib/ts/test_MemView.cc
@@ -27,7 +27,7 @@
#include <ios>
#include <iostream>
-using namespace ApacheTrafficServer;
+using namespace ts;
bool
Test_1()
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].