[asterisk-scf-commits] asterisk-scf/release/logger.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Apr 15 09:11:22 CDT 2011


branch "master" has been updated
       via  7f9676d31bd13ab3fbd04e749ecbda42707fd2b5 (commit)
      from  9269caafa5e14d096519ac719c35304e616a673a (commit)

Summary of changes:
 client/src/IceLogger.cpp     |    4 ++--
 client/src/Logger.cpp        |    9 +++++++--
 include/AsteriskSCF/logger.h |    9 +++++++++
 server/src/main.cpp          |    6 +++---
 4 files changed, 21 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 7f9676d31bd13ab3fbd04e749ecbda42707fd2b5
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Apr 14 13:25:27 2011 -0500

    Minor fixes for various code constructs that trip up GCC with new warning
    options enabled (-Wextra, -Wconversion, -Wformat, and others).

diff --git a/client/src/IceLogger.cpp b/client/src/IceLogger.cpp
index 84ca654..5bc5efd 100644
--- a/client/src/IceLogger.cpp
+++ b/client/src/IceLogger.cpp
@@ -133,13 +133,13 @@ void ConfiguredIceLogger::locateFinished(const Ice::AsyncResultPtr& r)
     }
 }
 
-void ConfiguredIceLogger::comparisonRegistered(const std::string& guid,
+void ConfiguredIceLogger::comparisonRegistered(const std::string& /* guid */,
     const Ice::Current&)
 {
     // no-op
 }
 
-void ConfiguredIceLogger::comparisonUnregistered(const std::string& guid,
+void ConfiguredIceLogger::comparisonUnregistered(const std::string& /* guid */,
     const Ice::Current&)
 {
     // no-op
diff --git a/client/src/Logger.cpp b/client/src/Logger.cpp
index bd56c19..99b651b 100644
--- a/client/src/Logger.cpp
+++ b/client/src/Logger.cpp
@@ -28,8 +28,13 @@ LogBuf::LogBuf(LogOut& out, const std::string& name, Level logLevel) :
 {
 }
 
+// NOTE: The copy constructor below intentionally calls the default constructor of its
+// std::streambuf base, rather than calling the copy constructor. The copy constructor
+// of std::streambuf is private (so it cannot be called), but more importantly, the
+// std::streambuf base object has no useful state that needs to be copied when a
+// LogBuf is copied.
 LogBuf::LogBuf(const LogBuf& orig) :
-    mOut(orig.mOut), nName(orig.nName), mLogLevel(orig.mLogLevel)
+    std::streambuf(), mOut(orig.mOut), nName(orig.nName), mLogLevel(orig.mLogLevel)
 {
     mBuffer.str(orig.mBuffer.str());
 }
@@ -49,7 +54,7 @@ int LogBuf::overflow(int c)
         sendBuffer();
         return c;
     }
-    return mBuffer.sputc(c);
+    return mBuffer.sputc((char) c);
 }
 
 void LogBuf::sendBuffer()
diff --git a/include/AsteriskSCF/logger.h b/include/AsteriskSCF/logger.h
index 9cabc4c..67065ab 100644
--- a/include/AsteriskSCF/logger.h
+++ b/include/AsteriskSCF/logger.h
@@ -186,11 +186,17 @@ public:
     /**
      * Log a single printf-formatted message.
      */
+#ifdef __GNUC__
+    __attribute__((format(printf, 3, 4)))
+#endif
     void logf(Level level, char const *fmt, ...) const;
 
     /**
      * Log a single vprintf-formatted message.
      */
+#ifdef __GNUC__
+    __attribute__((format(printf, 3, 0)))
+#endif
     void vlogf(Level level, char const *fmt, va_list ap) const;
 
     Logger getChild(const std::string& childName);
@@ -267,6 +273,9 @@ public:
     /**
      * Log a single vprintf-formatted message.
      */
+#ifdef __GNUC__
+    __attribute__((format(printf, 3, 0)))
+#endif
     ASTERISK_SCF_ICEBOX_EXPORT void vlogf(Level level, char const *fmt, va_list ap) const;
 
     ASTERISK_SCF_ICEBOX_EXPORT Logger getChild(
diff --git a/server/src/main.cpp b/server/src/main.cpp
index 90d2abc..0723e0a 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -101,9 +101,9 @@ void LoggingService::setDefaultProperty(Ice::Properties& props,
     }
 }
 
-void LoggingService::start(const std::string& name,
+void LoggingService::start(const std::string&,
     const Ice::CommunicatorPtr& communicator,
-    const Ice::StringSeq& args)
+    const Ice::StringSeq&)
 {
     setupDefaultProperties(communicator);
 
@@ -181,7 +181,7 @@ void LoggingService::stop()
 }
 
 extern "C" ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* createLoggingService(
-    Ice::CommunicatorPtr communicator)
+    Ice::CommunicatorPtr)
 {
     return new LoggingService;
 }

-----------------------------------------------------------------------


-- 
asterisk-scf/release/logger.git



More information about the asterisk-scf-commits mailing list