[Libreoffice-commits] core.git: desktop/source include/sal

Stephan Bergmann sbergman at redhat.com
Tue Nov 21 18:47:13 UTC 2017


 desktop/source/app/updater.cxx |   18 +++++++++---------
 include/sal/log-areas.dox      |    1 +
 2 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 1d80281259a51ba961ef44393f6c5de4541e1a59
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 21 11:53:01 2017 +0100

    Various loplugin warnings in --enable-online-update=mar
    
    Change-Id: I5dabd5b65420d30b8d5b631de4d755ecf385b762
    Reviewed-on: https://gerrit.libreoffice.org/45027
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 62519aac3469..e34cc6a7cce0 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -69,8 +69,8 @@ static const char kUserAgent[] = "LibreOffice UpdateChecker/1.0 (unknown platfor
 #endif
 
 #ifdef UNX
-const char* pUpdaterName = "updater";
-const char* pSofficeExeName = "soffice";
+const char* const pUpdaterName = "updater";
+const char* const pSofficeExeName = "soffice";
 #elif defined(WNT)
 const char* pUpdaterName = "updater.exe";
 const char* pSofficeExeName = "soffice.exe";
@@ -105,7 +105,7 @@ OUString normalizePath(const OUString& rPath)
     return aPath.replaceAll("\\", "/");
 }
 
-void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir)
+void CopyFileToDir(const OUString& rTempDirURL, const OUString & rFileName, const OUString& rOldDir)
 {
     OUString aSourceURL = rOldDir + "/" + rFileName;
     OUString aDestURL = rTempDirURL + "/" + rFileName;
@@ -152,7 +152,7 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t i)
 #error "Need an implementation"
 #endif
     CharT* pStr = new CharT[aStr.getLength() + 1];
-    tstrncpy(pStr, (CharT*)aStr.getStr(), aStr.getLength());
+    tstrncpy(pStr, aStr.getStr(), aStr.getLength());
     pStr[aStr.getLength()] = '\0';
     pArgs[i] = pStr;
 }
@@ -328,7 +328,7 @@ bool update()
 namespace {
 
 // Callback to get the response data from server.
-static size_t WriteCallback(void *ptr, size_t size,
+size_t WriteCallback(void *ptr, size_t size,
                             size_t nmemb, void *userp)
 {
   if (!userp)
@@ -523,7 +523,7 @@ size_t WriteCallbackFile(void *ptr, size_t size,
 
   WriteDataFile* response = static_cast<WriteDataFile *>(userp);
   size_t real_size = size * nmemb;
-  response->mpStream->WriteBytes(static_cast<char *>(ptr), real_size);
+  response->mpStream->WriteBytes(ptr, real_size);
   response->maHash.update(static_cast<const unsigned char*>(ptr), real_size);
   return real_size;
 }
@@ -802,7 +802,7 @@ OUString Updater::getExecutableDirURL()
 
 void Updater::log(const OUString& rMessage)
 {
-    SAL_INFO("updater", rMessage);
+    SAL_INFO("desktop.updater", rMessage);
     OUString aUpdateLog = getUpdateInfoLog();
     SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
     aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end
@@ -811,7 +811,7 @@ void Updater::log(const OUString& rMessage)
 
 void Updater::log(const OString& rMessage)
 {
-    SAL_INFO("updater", rMessage);
+    SAL_INFO("desktop.updater", rMessage);
     OUString aUpdateLog = getUpdateInfoLog();
     SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
     aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end
@@ -820,7 +820,7 @@ void Updater::log(const OString& rMessage)
 
 void Updater::log(const char* pMessage)
 {
-    SAL_INFO("updater", pMessage);
+    SAL_INFO("desktop.updater", pMessage);
     OUString aUpdateLog = getUpdateInfoLog();
     SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
     aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 5ca9cf7b8986..1df274126d87 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -167,6 +167,7 @@ certain functionality.
 @li @c desktop.opengl
 @li @c desktop.splash
 @li @c desktop.test
+ at li @c desktop.updater
 
 @section Draw
 


More information about the Libreoffice-commits mailing list