From 113113f4b0041d0a1d0c1fbf7faa94fad314f9ec Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 5 Mar 2013 19:48:32 +0000 Subject: QPID-4558: Selectors for C++ broker - Small fixes: * Missing include file (accidentally included under gcc) * Workaround some strange VS 2008 issue. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1452960 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SelectorToken.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'cpp') diff --git a/cpp/src/qpid/broker/SelectorToken.cpp b/cpp/src/qpid/broker/SelectorToken.cpp index 509d56af4b..3fd4abbc49 100644 --- a/cpp/src/qpid/broker/SelectorToken.cpp +++ b/cpp/src/qpid/broker/SelectorToken.cpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace qpid { namespace broker { @@ -93,7 +94,7 @@ struct RWEntry { TokenType type; }; -bool caseless(const char* s1, const char* s2) +inline bool caseless(const char* s1, const char* s2) { do { char ls1 = std::tolower(*s1); @@ -107,12 +108,8 @@ bool caseless(const char* s1, const char* s2) return false; } -bool operator<(const RWEntry& r, const char* rhs) { - return caseless(r.word, rhs); -} - -bool operator<(const char* rhs, const RWEntry& r) { - return caseless(rhs, r.word); +inline bool operator<(const RWEntry& lhs, const RWEntry& rhs) { + return caseless(lhs.word, rhs.word); } } @@ -138,7 +135,9 @@ bool tokeniseReservedWord(Token& tok) if ( tok.type != T_IDENTIFIER ) return false; - std::pair entry = std::equal_range(&reserved[0], &reserved[reserved_size], tok.val.c_str()); + RWEntry rw; + rw.word = tok.val.c_str(); + std::pair entry = std::equal_range(&reserved[0], &reserved[reserved_size], rw); if ( entry.first==entry.second ) return false; -- cgit v1.2.1