Author: afester
Date: Fri Jan 12 22:46:32 2007
New Revision: 495845

URL: http://svn.apache.org/viewvc?view=rev&rev=495845
Log:
LOGCXX-14: fixed "expression always true" warnings

Modified:
    logging/log4cxx/trunk/src/bytebuffer.cpp
    logging/log4cxx/trunk/src/nameabbreviator.cpp

Modified: logging/log4cxx/trunk/src/bytebuffer.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/bytebuffer.cpp?view=diff&rev=495845&r1=495844&r2=495845
==============================================================================
--- logging/log4cxx/trunk/src/bytebuffer.cpp (original)
+++ logging/log4cxx/trunk/src/bytebuffer.cpp Fri Jan 12 22:46:32 2007
@@ -49,7 +49,7 @@
 }
 
 void ByteBuffer::limit(size_t newLimit) {
-  if (newLimit < 0 || newLimit > cap) {
+  if (newLimit > cap) {
     throw IllegalArgumentException("newLimit");
   }
   lim = newLimit;

Modified: logging/log4cxx/trunk/src/nameabbreviator.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/nameabbreviator.cpp?view=diff&rev=495845&r1=495844&r2=495845
==============================================================================
--- logging/log4cxx/trunk/src/nameabbreviator.cpp (original)
+++ logging/log4cxx/trunk/src/nameabbreviator.cpp Fri Jan 12 22:46:32 2007
@@ -222,7 +222,7 @@
       PatternAbbreviatorFragment terminalFragment =
         fragments[fragments.size() - 1];
 
-      while ((pos < buf.length()) && (pos >= 0)) {
+      while (pos < buf.length()) {
         pos = terminalFragment.abbreviate(buf, pos);
       }
     }
@@ -266,7 +266,7 @@
       int charCount;
       LogString::size_type pos = 0;
 
-      while ((pos < trimmed.length()) && (pos >= 0)) {
+      while (pos < trimmed.length()) {
         LogString::size_type ellipsisPos = pos;
 
         if (trimmed[pos] == LOG4CXX_STR('*')) {


Reply via email to