[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann sbergman at redhat.com
Wed Oct 26 21:09:43 UTC 2016


 sal/osl/all/log.cxx       |   27 +++++++++------------------
 sal/osl/all/logformat.hxx |   29 -----------------------------
 2 files changed, 9 insertions(+), 47 deletions(-)

New commits:
commit 90439a2f211b723a0cf6d699ca8cb4da7384580a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 26 23:08:04 2016 +0200

    sal::detail::logFormat is no longer needed
    
    ...since 97354578d7195bce927f0c00c4e2ae9cd7344776 "Remove the obsolete
    functionality originally underlying osl/diagnose.h"
    
    Change-Id: I7c920bca9cdddb37fcbbc15d8629d01c21eb0787

diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index afde142..00bd67cb 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -27,8 +27,6 @@
 #include "sal/types.h"
 #include "misc.hxx"
 
-#include "logformat.hxx"
-
 #if defined ANDROID
 #include <android/log.h>
 #elif defined WNT
@@ -365,24 +363,17 @@ void sal_detail_logFormat(
     if (report(level, area)) {
         std::va_list args;
         va_start(args, format);
-        osl::detail::logFormat(level, area, where, format, args);
+        char buf[1024];
+        int const len = sizeof buf - RTL_CONSTASCII_LENGTH("...");
+        int n = vsnprintf(buf, len, format, args);
+        if (n < 0) {
+            std::strcpy(buf, "???");
+        } else if (n >= len) {
+            std::strcpy(buf + len - 1, "...");
+        }
+        log(level, area, where, buf);
         va_end(args);
     }
 }
 
-void osl::detail::logFormat(
-    sal_detail_LogLevel level, char const * area, char const * where,
-    char const * format, std::va_list arguments)
-{
-    char buf[1024];
-    int const len = sizeof buf - RTL_CONSTASCII_LENGTH("...");
-    int n = vsnprintf(buf, len, format, arguments);
-    if (n < 0) {
-        std::strcpy(buf, "???");
-    } else if (n >= len) {
-        std::strcpy(buf + len - 1, "...");
-    }
-    log(level, area, where, buf);
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/all/logformat.hxx b/sal/osl/all/logformat.hxx
deleted file mode 100644
index 0e579a9..0000000
--- a/sal/osl/all/logformat.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_SAL_OSL_ALL_LOGFORMAT_HXX
-#define INCLUDED_SAL_OSL_ALL_LOGFORMAT_HXX
-
-#include "sal/config.h"
-
-#include <cstdarg>
-
-#include "sal/detail/log.h"
-
-namespace osl { namespace detail {
-
-void logFormat(
-    sal_detail_LogLevel level, char const * area, char const * where,
-    char const * format, std::va_list arguments);
-
-} }
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list