afester | 12 May 2007 16:54
Picon
Favicon

svn commit: r537449 - /logging/log4cxx/trunk/src/unicodehelper.cpp

Author: afester
Date: Sat May 12 07:54:52 2007
New Revision: 537449

URL: http://svn.apache.org/viewvc?view=rev&rev=537449
Log:
LOGCXX-178: In case of __STDC_ISO_10646__, removed unused 
variable to avoid build failure with pedantic errors, and
fixed undefined variables

Modified:
    logging/log4cxx/trunk/src/unicodehelper.cpp

Modified: logging/log4cxx/trunk/src/unicodehelper.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/unicodehelper.cpp?view=diff&rev=537449&r1=537448&r2=537449
==============================================================================
--- logging/log4cxx/trunk/src/unicodehelper.cpp (original)
+++ logging/log4cxx/trunk/src/unicodehelper.cpp Sat May 12 07:54:52 2007
 <at>  <at>  -165,11 +165,12  <at>  <at> 
 #if LOG4CXX_LOGCHAR_IS_WCHAR
 unsigned int UnicodeHelper::decode(const LogString& in, LogString::const_iterator& iter) {
     const wchar_t* src = in.data() + (iter - in.begin());
-    const wchar_t* srcEnd = in.data() + in.length();
 #if defined(__STDC_ISO_10646__)
     unsigned int sv = *(src++);
 #elif defined(_WIN32)
+    const wchar_t* srcEnd = in.data() + in.length();
     unsigned int sv = *(src++);
+
     if (!(sv < 0xDC00 || sv >= 0xDC00)) {
(Continue reading)

afester | 12 May 2007 18:09
Picon
Favicon

svn commit: r537476 - in /logging/log4cxx/trunk: build.xml configure.in include/log4cxx/log4cxx.h.in include/log4cxx/log4cxx.hw include/log4cxx/private/log4cxx_private.h.in include/log4cxx/private/log4cxx_private.hw

Author: afester
Date: Sat May 12 09:09:52 2007
New Revision: 537476

URL: http://svn.apache.org/viewvc?view=rev&rev=537476
Log:
LOGCXX-126: fix build failure of console.cpp on systems with no wchar_t support,
removed hard coded HAS_STD_WCOUT.

Modified:
    logging/log4cxx/trunk/build.xml
    logging/log4cxx/trunk/configure.in
    logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in
    logging/log4cxx/trunk/include/log4cxx/log4cxx.hw
    logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in
    logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw

Modified: logging/log4cxx/trunk/build.xml
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/build.xml?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/build.xml (original)
+++ logging/log4cxx/trunk/build.xml Sat May 12 09:09:52 2007
 <at>  <at>  -65,6 +65,7  <at>  <at> 
 <property name="optimize" value="none"/>
 <property name="lib.type" value="shared"/>
 <property name="has.wchar_t" value="1"/>
+<property name="has.wcout" value="1"/>

 <property name="apache.mirror" value="http://archive.apache.org/dist"/>
 <property name="cppunit.mirror" value="http://easynews.dl.sourceforge.net/sourceforge"/>
(Continue reading)

afester | 14 May 2007 18:40
Picon
Favicon

svn commit: r537903 - in /logging/log4cxx/trunk: src/ tests/src/helpers/

Author: afester
Date: Mon May 14 09:40:32 2007
New Revision: 537903

URL: http://svn.apache.org/viewvc?view=rev&rev=537903
Log:
LOGCXX-14: necessary casts to avoid range overflow warning

Modified:
    logging/log4cxx/trunk/src/fileappender.cpp
    logging/log4cxx/trunk/src/unicodehelper.cpp
    logging/log4cxx/trunk/tests/src/helpers/charsetdecodertestcase.cpp
    logging/log4cxx/trunk/tests/src/helpers/charsetencodertestcase.cpp
    logging/log4cxx/trunk/tests/src/helpers/transcodertestcase.cpp
    logging/log4cxx/trunk/tests/src/helpers/unicodehelpertestcase.cpp

Modified: logging/log4cxx/trunk/src/fileappender.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/fileappender.cpp?view=diff&rev=537903&r1=537902&r2=537903
==============================================================================
--- logging/log4cxx/trunk/src/fileappender.cpp (original)
+++ logging/log4cxx/trunk/src/fileappender.cpp Mon May 14 09:40:32 2007
 <at>  <at>  -236,7 +236,7  <at>  <at> 
   //   if a new file and UTF-16, then write a BOM
   //
   if (writeBOM) {
-      char bom[] = { 0xFE, 0xFF };
+      char bom[] = { (char) 0xFE, (char) 0xFF };
       ByteBuffer buf(bom, 2);
       outStream->write(buf, p);
   }
(Continue reading)

afester | 14 May 2007 18:43
Picon
Favicon

svn commit: r537905 - in /logging/log4cxx/trunk: include/log4cxx/logger.h src/logger.cpp

Author: afester
Date: Mon May 14 09:43:12 2007
New Revision: 537905

URL: http://svn.apache.org/viewvc?view=rev&rev=537905
Log:
LOGCXX-14: Made Logger::error and dependant methods const to avoid
"cast to non-const" warning

Modified:
    logging/log4cxx/trunk/include/log4cxx/logger.h
    logging/log4cxx/trunk/src/logger.cpp

Modified: logging/log4cxx/trunk/include/log4cxx/logger.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/logger.h?view=diff&rev=537905&r1=537904&r2=537905
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/logger.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/logger.h Mon May 14 09:43:12 2007
 <at>  <at>  -132,7 +132,7  <at>  <at> 
         to log the particular log request.

          <at> param event the event to log.  */
-        void callAppenders(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p);
+        void callAppenders(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) const;

         /**
         Close all attached appenders implementing the AppenderAttachable
 <at>  <at>  -176,9 +176,9  <at>  <at> 
          <at> param line the line where the log statement was written.
         */
(Continue reading)

afester | 14 May 2007 18:46
Picon
Favicon

svn commit: r537906 - in /logging/log4cxx/trunk: include/log4cxx/helpers/condition.h include/log4cxx/helpers/mutex.h include/log4cxx/helpers/synchronized.h src/mutex.cpp

Author: afester
Date: Mon May 14 09:46:09 2007
New Revision: 537906

URL: http://svn.apache.org/viewvc?view=rev&rev=537906
Log:
LOGCXX-14: Made member variables non-const to avoid "cast to non-const"
warning

Modified:
    logging/log4cxx/trunk/include/log4cxx/helpers/condition.h
    logging/log4cxx/trunk/include/log4cxx/helpers/mutex.h
    logging/log4cxx/trunk/include/log4cxx/helpers/synchronized.h
    logging/log4cxx/trunk/src/mutex.cpp

Modified: logging/log4cxx/trunk/include/log4cxx/helpers/condition.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/helpers/condition.h?view=diff&rev=537906&r1=537905&r2=537906
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/helpers/condition.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/helpers/condition.h Mon May 14 09:46:09 2007
 <at>  <at>  -36,8 +36,8  <at>  <at> 
                         void wait();

                 private:
-                        const void* condition;
-                        const void* mutex;
+                        void* condition;
+                        void* mutex;
                         Condition(const Condition&);
                         Condition& operator=(const Condition&);
(Continue reading)

afester | 14 May 2007 18:48
Picon
Favicon

svn commit: r537907 - /logging/log4cxx/trunk/src/charsetdecoder.cpp

Author: afester
Date: Mon May 14 09:48:34 2007
New Revision: 537907

URL: http://svn.apache.org/viewvc?view=rev&rev=537907
Log:
LOGCXX-14: added const-cast to avoid "cast to non-const" warning

Modified:
    logging/log4cxx/trunk/src/charsetdecoder.cpp

Modified: logging/log4cxx/trunk/src/charsetdecoder.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/charsetdecoder.cpp?view=diff&rev=537907&r1=537906&r2=537907
==============================================================================
--- logging/log4cxx/trunk/src/charsetdecoder.cpp (original)
+++ logging/log4cxx/trunk/src/charsetdecoder.cpp Mon May 14 09:48:34 2007
 <at>  <at>  -422,7 +422,7  <at>  <at> 
                       int bytes = UnicodeHelper::encodeUTF8(sv, utf8);
                       out.append(utf8, bytes);
                   }
-                  in.position(((char*) src) - in.data());
+                  in.position(((const char*) src) - in.data());
                   return APR_SUCCESS;
               }

afester | 14 May 2007 18:50
Picon
Favicon

svn commit: r537909 - in /logging/log4cxx/trunk: include/log4cxx/helpers/pool.h src/pool.cpp

Author: afester
Date: Mon May 14 09:50:21 2007
New Revision: 537909

URL: http://svn.apache.org/viewvc?view=rev&rev=537909
Log:
LOGCXX-14: Made return value of Pool::getAPRPool() non-const to 
avoid "cast to non-const type" warning

Modified:
    logging/log4cxx/trunk/include/log4cxx/helpers/pool.h
    logging/log4cxx/trunk/src/pool.cpp

Modified: logging/log4cxx/trunk/include/log4cxx/helpers/pool.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/helpers/pool.h?view=diff&rev=537909&r1=537908&r2=537909
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/helpers/pool.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/helpers/pool.h Mon May 14 09:50:21 2007
 <at>  <at>  -32,7 +32,7  <at>  <at> 
                 public:
                         Pool();
                         Pool(log4cxx_pool_t* pool, bool release);
-                        const log4cxx_pool_t* getAPRPool();
+                        log4cxx_pool_t* getAPRPool();
                         ~Pool();

                         char* palloc(size_t length);

Modified: logging/log4cxx/trunk/src/pool.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/pool.cpp?view=diff&rev=537909&r1=537908&r2=537909
(Continue reading)

afester | 14 May 2007 18:51
Picon
Favicon

svn commit: r537910 - /logging/log4cxx/trunk/include/log4cxx/helpers/object.h

Author: afester
Date: Mon May 14 09:51:45 2007
New Revision: 537910

URL: http://svn.apache.org/viewvc?view=rev&rev=537910
Log:
LOGCXX-14: tweak to avoid type mismatch warning between const and
non-const type

Modified:
    logging/log4cxx/trunk/include/log4cxx/helpers/object.h

Modified: logging/log4cxx/trunk/include/log4cxx/helpers/object.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/helpers/object.h?view=diff&rev=537910&r1=537909&r2=537910
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/helpers/object.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/helpers/object.h Mon May 14 09:51:45 2007
 <at>  <at>  -121,7 +121,7  <at>  <at> 
 const void * cast(const helpers::Class& clazz) const\
 {\
         const void * object = 0;\
-        if (&clazz == &helpers::Object::getStaticClass()) return (helpers::Object *)this;
+        if (&clazz == &helpers::Object::getStaticClass()) return (const helpers::Object *)this;

 #define END_LOG4CXX_CAST_MAP()\
         return object;\
 <at>  <at>  -130,7 +130,7  <at>  <at> 
 { return cast(clazz) != 0; }

 #define LOG4CXX_CAST_ENTRY(Interface)\
(Continue reading)

Andreas Fester | 14 May 2007 19:01
Picon
Favicon

Pedantic compiler warnings

Hi,

I have just commited a bunch of patches which were already
part of my daily build at http://littletux.homelinux.org/log4cxx/
for some time. With these patches, log4cxx should now be buildable
with much more pedantic warnings enabled, at least with gcc 3.3 it
now builds with

-pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels
-Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion
-Wsign-compare -Wmissing-format-attribute -Wno-multichar
-Wpacked -Wredundant-decls -Werror -Wshadow -Wno-ctor-dtor-privacy
-Wno-long-long

It might, however, be possible that one or more of the recent
commits have a negative influence on other compiler flavours or
other platforms; if you observe build failures which seem to
be caused by my recent commits, please contact me :-)

Thanks,

	Andreas

Sean Hermany | 17 May 2007 02:48
Favicon

LOG4CXX_ERROR/WARN/INFO and related macro changes, revision: 308702

Revision number 308702 changed the way the LOG4CXX_INFO...etc macros 
behave. This has broken a substantial portion of code for me, and I think 
the change was a "downgrade" of sorts.

For instance:
 #define LOG4CXX_WARN(logger, message) { \
-       if (logger->isWarnEnabled()) {\
-       ::log4cxx::StringBuffer oss; \
-       oss << message; \
-       logger->forcedLog(::log4cxx::Level::WARN, oss.str(), __FILE__, 
__LINE__); }}
+        if (logger->isWarnEnabled()) {\
+            logger->forcedLog(::log4cxx::Level::WARN, message, 
LOG4CXX_LOCATION); }}

The net effect is that previously, you were able to do:

LOG4CXX_WARN(myLogger, "Dropped" << numPacketsDropped << " of " << 
totalNumPackets << " packets.");

whereas this no longer works. It is true that you could create a string 
buffer yourself outside of the logging call. However, then you pay the 
creation cost of the string buffer regardless of whether logging for that 
level is enabled or not. OK - one could wrap the whole thing in an 
if(logger->isWarnEnabled()) call as before. To that effect, I could just 
create new macros that do just what the old ones did.

What I'm getting at is that I think the old macros were much more useful, 
and it would be better to revert to them (keeping the change to use 
LOG4CXX_LOCATION of course). Changing back to the macro version that 
(Continue reading)


Gmane