This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new e620c2e8 Remove unused member variables from private structs (#493)
e620c2e8 is described below

commit e620c2e84b13434f9c6410baa28f2090155a6cc6
Author: Stephen Webb <[email protected]>
AuthorDate: Fri Apr 4 11:44:03 2025 +1100

    Remove unused member variables from private structs (#493)
---
 src/main/cpp/dbappender.cpp                        |  4 ---
 src/main/cpp/filewatchdog.cpp                      |  7 -----
 src/main/cpp/loggingevent.cpp                      | 31 ----------------------
 src/main/cpp/onlyonceerrorhandler.cpp              |  9 +------
 .../log4cxx/private/socketappenderskeleton_priv.h  |  5 ----
 5 files changed, 1 insertion(+), 55 deletions(-)

diff --git a/src/main/cpp/dbappender.cpp b/src/main/cpp/dbappender.cpp
index 22664c57..1f38e2b1 100644
--- a/src/main/cpp/dbappender.cpp
+++ b/src/main/cpp/dbappender.cpp
@@ -62,11 +62,7 @@ struct DBAppender::DBAppenderPriv : public 
AppenderSkeleton::AppenderSkeletonPri
                }
        }
 
-#if 15 < LOG4CXX_ABI_VERSION
     const apr_dbd_driver_t* m_driver = nullptr;
-#else
-    apr_dbd_driver_t* m_driver = nullptr;
-#endif
     apr_dbd_t* m_databaseHandle = nullptr;
     apr_dbd_prepared_t* preparedStmt = nullptr;
     std::vector<LogString> mappedName;
diff --git a/src/main/cpp/filewatchdog.cpp b/src/main/cpp/filewatchdog.cpp
index e7101bd4..2cd4c49f 100644
--- a/src/main/cpp/filewatchdog.cpp
+++ b/src/main/cpp/filewatchdog.cpp
@@ -51,13 +51,6 @@ struct FileWatchdog::FileWatchdogPrivate{
        long delay;
        log4cxx_time_t lastModif;
        bool warnedAlready;
-#if LOG4CXX_ABI_VERSION <= 15
-       int interrupted{ 0 };
-       Pool pool;
-       std::thread thread;
-       std::condition_variable interrupt;
-       std::mutex interrupt_mutex;
-#endif
        LogString taskName;
        ThreadUtility::ManagerWeakPtr taskManager;
 };
diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
index 8318a2e9..e1fc11f2 100644
--- a/src/main/cpp/loggingevent.cpp
+++ b/src/main/cpp/loggingevent.cpp
@@ -40,10 +40,6 @@ struct LoggingEvent::LoggingEventPrivate
 {
        LoggingEventPrivate(const ThreadSpecificData::NamePairPtr p = 
ThreadSpecificData::getNames()) :
                timeStamp(0),
-#if LOG4CXX_ABI_VERSION <= 15
-               threadName(p->idString),
-               threadUserName(p->threadName),
-#endif
                pNames(p)
        {
        }
@@ -60,10 +56,6 @@ struct LoggingEvent::LoggingEventPrivate
                message(std::move(message1)),
                timeStamp(Date::currentTime()),
                locationInfo(locationInfo1),
-#if LOG4CXX_ABI_VERSION <= 15
-               threadName(p->idString),
-               threadUserName(p->threadName),
-#endif
                chronoTimeStamp(std::chrono::microseconds(timeStamp)),
                pNames(p)
        {
@@ -79,10 +71,6 @@ struct LoggingEvent::LoggingEventPrivate
                message(message1),
                timeStamp(Date::currentTime()),
                locationInfo(locationInfo1),
-#if LOG4CXX_ABI_VERSION <= 15
-               threadName(p->idString),
-               threadUserName(p->threadName),
-#endif
                chronoTimeStamp(std::chrono::microseconds(timeStamp)),
                pNames(p)
        {
@@ -101,23 +89,11 @@ struct LoggingEvent::LoggingEventPrivate
        /** severity level of logging event. */
        LevelPtr level;
 
-#if LOG4CXX_ABI_VERSION <= 15
-       mutable LogString* ndc{NULL};
-
-       mutable MDC::Map* mdcCopy{NULL};
-#endif
-
        /**
        * A map of String keys and String values.
        */
        std::map<LogString, LogString>* properties{NULL};
 
-#if LOG4CXX_ABI_VERSION <= 15
-       mutable bool ndcLookupRequired{false};
-
-       mutable bool mdcCopyLookupRequired{false};
-#endif
-
        /** The application supplied message. */
        LogString message;
 
@@ -130,13 +106,6 @@ struct LoggingEvent::LoggingEventPrivate
        /** The source code location where the logging request was made. */
        const spi::LocationInfo locationInfo;
 
-
-#if LOG4CXX_ABI_VERSION <= 15
-       const LogString& threadName;
-
-       const LogString& threadUserName;
-#endif
-
        std::chrono::time_point<std::chrono::system_clock> chronoTimeStamp;
 
        /**
diff --git a/src/main/cpp/onlyonceerrorhandler.cpp 
b/src/main/cpp/onlyonceerrorhandler.cpp
index 20c63729..ebc07abd 100644
--- a/src/main/cpp/onlyonceerrorhandler.cpp
+++ b/src/main/cpp/onlyonceerrorhandler.cpp
@@ -27,14 +27,7 @@ using namespace LOG4CXX_NS::spi;
 IMPLEMENT_LOG4CXX_OBJECT(OnlyOnceErrorHandler)
 
 struct OnlyOnceErrorHandler::OnlyOnceErrorHandlerPrivate{
-       OnlyOnceErrorHandlerPrivate() :
-               firstTime(true){}
-
-#if LOG4CXX_ABI_VERSION <= 15
-       LogString WARN_PREFIX;
-       LogString ERROR_PREFIX;
-#endif
-       mutable bool firstTime;
+       mutable bool firstTime = true;
 };
 
 OnlyOnceErrorHandler::OnlyOnceErrorHandler() :
diff --git a/src/main/include/log4cxx/private/socketappenderskeleton_priv.h 
b/src/main/include/log4cxx/private/socketappenderskeleton_priv.h
index 9ed67f41..e4a3537d 100644
--- a/src/main/include/log4cxx/private/socketappenderskeleton_priv.h
+++ b/src/main/include/log4cxx/private/socketappenderskeleton_priv.h
@@ -72,11 +72,6 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : 
public AppenderSkele
        int port;
        int reconnectionDelay;
        bool locationInfo;
-#if LOG4CXX_ABI_VERSION <= 15
-       std::thread thread;
-       std::condition_variable interrupt;
-       std::mutex interrupt_mutex;
-#endif
        void stopMonitor();
 
        /**

Reply via email to