You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ch...@apache.org on 2015/01/07 07:52:04 UTC
svn commit: r1649999 - in /incubator/log4cxx/trunk/src/main/cpp:
charsetencoder.cpp fileappender.cpp odbcappender.cpp properties.cpp
simpledateformat.cpp
Author: chand
Date: Wed Jan 7 06:52:03 2015
New Revision: 1649999
URL: http://svn.apache.org/r1649999
Log:
LOGCXX-434 : The attached patch fixes some cppcheck warnings. Credits to 'Christian Ehrlicher
Modified:
incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp
incubator/log4cxx/trunk/src/main/cpp/fileappender.cpp
incubator/log4cxx/trunk/src/main/cpp/odbcappender.cpp
incubator/log4cxx/trunk/src/main/cpp/properties.cpp
incubator/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
Modified: incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp?rev=1649999&r1=1649998&r2=1649999&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp Wed Jan 7 06:52:03 2015
@@ -400,7 +400,7 @@ public:
Transcoder::decode(encoding, ename);
try {
encoder = CharsetEncoder::getEncoder(ename);
- } catch(IllegalArgumentException ex) {
+ } catch(IllegalArgumentException &ex) {
encoder = new USASCIICharsetEncoder();
}
}
Modified: incubator/log4cxx/trunk/src/main/cpp/fileappender.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/fileappender.cpp?rev=1649999&r1=1649998&r2=1649999&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/fileappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/fileappender.cpp Wed Jan 7 06:52:03 2015
@@ -275,10 +275,10 @@ void FileAppender::setFile(
if(!parentDir.exists(p) && parentDir.mkdirs(p)) {
outStream = new FileOutputStream(filename, append1);
} else {
- throw ex;
+ throw;
}
} else {
- throw ex;
+ throw;
}
}
Modified: incubator/log4cxx/trunk/src/main/cpp/odbcappender.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/odbcappender.cpp?rev=1649999&r1=1649998&r2=1649999&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/odbcappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/odbcappender.cpp Wed Jan 7 06:52:03 2015
@@ -183,7 +183,7 @@ void ODBCAppender::execute(const LogStri
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
}
- throw e;
+ throw;
}
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
closeConnection(con);
Modified: incubator/log4cxx/trunk/src/main/cpp/properties.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/properties.cpp?rev=1649999&r1=1649998&r2=1649999&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/properties.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/properties.cpp Wed Jan 7 06:52:03 2015
@@ -296,7 +296,7 @@ public:
}
protected:
- bool get(LogString& in, logchar& c)
+ static bool get(LogString& in, logchar& c)
{
if (in.empty()) {
c = 0;
Modified: incubator/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/simpledateformat.cpp?rev=1649999&r1=1649998&r2=1649999&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/simpledateformat.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/simpledateformat.cpp Wed Jan 7 06:52:03 2015
@@ -232,7 +232,6 @@ public:
private:
size_t width;
- char zeroDigit;
};
@@ -438,7 +437,7 @@ private:
class HourToken : public NumericToken
{
public:
- HourToken( int width1, int /* offset1 */ ) : NumericToken( width1 )
+ HourToken( int width1, int /* offset1 */ ) : NumericToken( width1 ), offset( 0 )
{
}