You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2013/03/05 20:48:32 UTC

svn commit: r1452960 - /qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp

Author: astitcher
Date: Tue Mar  5 19:48:32 2013
New Revision: 1452960

URL: http://svn.apache.org/r1452960
Log:
QPID-4558: Selectors for C++ broker
- Small fixes:
* Missing include file (accidentally included under gcc)
* Workaround some strange VS 2008 issue.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp?rev=1452960&r1=1452959&r2=1452960&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp Tue Mar  5 19:48:32 2013
@@ -25,6 +25,7 @@
 #include <algorithm>
 #include <iostream>
 #include <cassert>
+#include <cctype>
 
 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
     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<const RWEntry*, const RWEntry*> entry = std::equal_range(&reserved[0], &reserved[reserved_size], tok.val.c_str());
+    RWEntry rw;
+    rw.word = tok.val.c_str();
+    std::pair<const RWEntry*, const RWEntry*> entry = std::equal_range(&reserved[0], &reserved[reserved_size], rw);
 
     if ( entry.first==entry.second ) return false;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org