[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

Stephan Bergmann sbergman at redhat.com
Thu Mar 3 08:43:39 UTC 2016


 l10ntools/inc/gConv.hxx        |    2 +-
 l10ntools/inc/gConvDB.hxx      |    4 ++--
 l10ntools/inc/gConvPo.hxx      |   10 +++++-----
 l10ntools/inc/gConvProp.hxx    |    4 ++--
 l10ntools/inc/gConvSrc.hxx     |    6 +++---
 l10ntools/inc/gConvTree.hxx    |    4 ++--
 l10ntools/inc/gConvUlf.hxx     |    4 ++--
 l10ntools/inc/gConvXcs.hxx     |    4 ++--
 l10ntools/inc/gConvXcu.hxx     |    4 ++--
 l10ntools/inc/gConvXhp.hxx     |    4 ++--
 l10ntools/inc/gConvXrm.hxx     |    4 ++--
 l10ntools/source/gConv.cxx     |   10 +++++-----
 l10ntools/source/gConvDB.cxx   |    2 +-
 l10ntools/source/gConvProp.cxx |    4 ++--
 l10ntools/source/gConvSrc.cxx  |    8 ++++----
 l10ntools/source/gConvTree.cxx |    4 ++--
 l10ntools/source/gConvUlf.cxx  |    2 +-
 l10ntools/source/gConvXcs.cxx  |    4 ++--
 l10ntools/source/gConvXcu.cxx  |    2 +-
 l10ntools/source/gConvXhp.cxx  |    8 ++++----
 l10ntools/source/gConvXrm.cxx  |    2 +-
 l10ntools/source/gL10nMem.cxx  |   10 +++++-----
 22 files changed, 53 insertions(+), 53 deletions(-)

New commits:
commit a39fb49535bbcdecd0a605250f82335aee690937
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 3 09:43:06 2016 +0100

    various loplugin warnings
    
    Change-Id: I9078ba18d8897a89a472fe75385542dac0c6bf78

diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 5b79e4a..7287a49 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -76,7 +76,7 @@ class convert_gen_impl
     // utility functions for converters
     void         lexRead        (char *sBuf, int *nResult, int nMax_size);
     void         writeSourceFile(const std::string& line);
-    std::string& copySource     (char *yyText, bool bDoClear = true);
+    std::string& copySource     (char const *yyText, bool bDoClear = true);
 
   protected:
     std::string  msSourceBuffer, msCopyText;
diff --git a/l10ntools/inc/gConvDB.hxx b/l10ntools/inc/gConvDB.hxx
index 54dba4e..0cbb746 100644
--- a/l10ntools/inc/gConvDB.hxx
+++ b/l10ntools/inc/gConvDB.hxx
@@ -36,14 +36,14 @@ class convert_db : public convert_gen_impl
 {
   public:
     convert_db(l10nMem& crMemory);
-    ~convert_db();
+    virtual ~convert_db();
 
   private:
     static const int NUMFIELD = 16;
     std::string      msFields[NUMFIELD];
     int              miSize;
 
-    void execute();
+    void execute() override;
     bool collectLine();
 };
 #endif
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 7d2d8f2..b467064 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -40,7 +40,7 @@ class convert_po : public convert_gen_impl
 
 
     convert_po(l10nMem& crMemory);
-    ~convert_po();
+    virtual ~convert_po();
 
     void startLook ();
     void setValue  (char *syyText, int iLineCnt);
@@ -57,15 +57,15 @@ class convert_po : public convert_gen_impl
     bool         mbFuzzy;
     std::filebuf outBuffer;
 
-    void execute();
+    void execute() override;
 
     void startSave(const std::string& sLanguage,
-                   const std::string& sFile);
+                   const std::string& sFile) override;
     void save(const std::string& sFileName,
               const std::string& sKey,
               const std::string& sENUStext,
               const std::string& sText,
-              bool               bFuzzy);
-    void endSave();
+              bool               bFuzzy) override;
+    void endSave() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvProp.hxx b/l10ntools/inc/gConvProp.hxx
index ce2ee38..8b1c281 100644
--- a/l10ntools/inc/gConvProp.hxx
+++ b/l10ntools/inc/gConvProp.hxx
@@ -36,10 +36,10 @@ class convert_prop : public convert_gen_impl
 {
   public:
     convert_prop(l10nMem& crMemory);
-    ~convert_prop();
+    virtual ~convert_prop();
 
 
   private:
-    void execute();
+    void execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index e8de370..e9a2139 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -37,7 +37,7 @@ class convert_src : public convert_gen_impl
     bool mbExpectValue;
 
     convert_src(l10nMem& crMemory);
-    ~convert_src();
+    virtual ~convert_src();
 
     void setValue      (char *syyText, char *sbuildValue);
     void setLang       (char *syyText, bool bEnUs);
@@ -47,7 +47,7 @@ class convert_src : public convert_gen_impl
     void setCmd        (char *syyText);
     void setMacro      (char *syyText);
     void setList       (char *syyText);
-    void setListItem   (char *syyText, bool bIsStart);
+    void setListItem   (char const *syyText, bool bIsStart);
     void setNL         (char *syyText, bool bMacro);
     void startBlock    (char *syyText);
     void stopBlock     (char *syyText);
@@ -67,7 +67,7 @@ class convert_src : public convert_gen_impl
     bool                     mbInListItem;
     int                      miListCount;
     int                      miMacroLevel;
-    void execute();
+    void execute() override;
     void trim(std::string& sText);
     void buildKey(std::string& sKey);
     void insertLanguagePart(std::string& sKey, std::string& sTextType);
diff --git a/l10ntools/inc/gConvTree.hxx b/l10ntools/inc/gConvTree.hxx
index 0ec25ad..dda10ca 100644
--- a/l10ntools/inc/gConvTree.hxx
+++ b/l10ntools/inc/gConvTree.hxx
@@ -52,7 +52,7 @@ class convert_tree : public convert_gen_impl
     } STATE_VAL;
 
     convert_tree(l10nMem& crMemory);
-    ~convert_tree();
+    virtual ~convert_tree();
 
     void         setString         (char *yytext);
     void         setState          (char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL);
@@ -70,6 +70,6 @@ class convert_tree : public convert_gen_impl
     STATE_VAL       meStateVal;
     int             miCntLanguages;
 
-    void execute();
+    void execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvUlf.hxx b/l10ntools/inc/gConvUlf.hxx
index 30e79ad..2fdbea6 100644
--- a/l10ntools/inc/gConvUlf.hxx
+++ b/l10ntools/inc/gConvUlf.hxx
@@ -36,7 +36,7 @@ class convert_ulf : public convert_gen_impl
 {
   public:
     convert_ulf(l10nMem& crMemory);
-    ~convert_ulf();
+    virtual ~convert_ulf();
 
     void setKey(char *syyText);
     void setText(char *syyText, bool bIsEnUs);
@@ -46,7 +46,7 @@ class convert_ulf : public convert_gen_impl
     std::string msKey;
 
 
-    void execute();
+    void execute() override;
     void handleLines();
 };
 #endif
diff --git a/l10ntools/inc/gConvXcs.hxx b/l10ntools/inc/gConvXcs.hxx
index d1b241e..a72f7c0 100644
--- a/l10ntools/inc/gConvXcs.hxx
+++ b/l10ntools/inc/gConvXcs.hxx
@@ -36,7 +36,7 @@ class convert_xcs : public convert_gen_impl
 {
   public:
     convert_xcs(l10nMem& crMemory);
-    ~convert_xcs();
+    virtual ~convert_xcs();
 
     void setKey(char *syyText);
     void unsetKey(char *syyText);
@@ -47,6 +47,6 @@ class convert_xcs : public convert_gen_impl
     std::string msKey;
     bool        mbCollectingData;
 
-    void execute();
+    void execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvXcu.hxx b/l10ntools/inc/gConvXcu.hxx
index db10627..e751e36 100644
--- a/l10ntools/inc/gConvXcu.hxx
+++ b/l10ntools/inc/gConvXcu.hxx
@@ -39,7 +39,7 @@ class convert_xcu : public convert_gen_impl
     bool mbNoCollectingData;
 
     convert_xcu(l10nMem& crMemory);
-    ~convert_xcu();
+    virtual ~convert_xcu();
 
     void pushKey(char *syyText);
     void popKey(char *syyText);
@@ -55,6 +55,6 @@ class convert_xcu : public convert_gen_impl
     int                      miLevel;
     bool                     mbNoTranslate;
 
-    void execute();
+    void execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvXhp.hxx b/l10ntools/inc/gConvXhp.hxx
index 857966f..04de5aa 100644
--- a/l10ntools/inc/gConvXhp.hxx
+++ b/l10ntools/inc/gConvXhp.hxx
@@ -36,7 +36,7 @@ class convert_xhp : public convert_gen_impl
 {
   public:
     convert_xhp(l10nMem& crMemory);
-    ~convert_xhp();
+    virtual ~convert_xhp();
 
     void setString(char *yytext);
     void openTag(char *yytext);
@@ -72,6 +72,6 @@ class convert_xhp : public convert_gen_impl
     std::string    *msLangText;
     std::ofstream  *mcOutputFiles;
     int             miCntLanguages;
-    void            execute();
+    void            execute() override;
 };
 #endif
diff --git a/l10ntools/inc/gConvXrm.hxx b/l10ntools/inc/gConvXrm.hxx
index e10d999..b29b536 100644
--- a/l10ntools/inc/gConvXrm.hxx
+++ b/l10ntools/inc/gConvXrm.hxx
@@ -37,7 +37,7 @@ class convert_xrm : public convert_gen_impl
   public:
     bool mbNoCollectingData;
     convert_xrm(l10nMem& crMemory);
-    ~convert_xrm();
+    virtual ~convert_xrm();
 
     void setId(char *yytext);
     void setLang(char *yytext);
@@ -51,6 +51,6 @@ class convert_xrm : public convert_gen_impl
     bool        mbIsLang;
     std::string msTag;
 
-    void execute();
+    void execute() override;
 };
 #endif
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx
index 562d87a..15b5625 100644
--- a/l10ntools/source/gConv.cxx
+++ b/l10ntools/source/gConv.cxx
@@ -53,7 +53,7 @@
 
 
 /*******************   G L O B A L   D E F I N I T I O N   *******************/
-convert_gen_impl * convert_gen_impl::mcImpl = NULL;
+convert_gen_impl * convert_gen_impl::mcImpl = nullptr;
 
 
 
@@ -198,7 +198,7 @@ bool convert_gen::createDir(std::string& sDir, std::string& sFile)
 
     if (!checkAccess(sNewDir))
     {
-      OS_MKDIR((char *)sNewDir.c_str());
+      OS_MKDIR(sNewDir.c_str());
     }
 
   }
@@ -223,7 +223,7 @@ convert_gen_impl::convert_gen_impl(l10nMem& crMemory)
 /**********************   I M P L E M E N T A T I O N   **********************/
 convert_gen_impl::~convert_gen_impl()
 {
-  mcImpl = NULL;
+  mcImpl = nullptr;
 }
 
 
@@ -252,7 +252,7 @@ bool convert_gen_impl::prepareFile()
   inputFile.seekg (0, std::ios::beg);
 
   // get size, prepare std::string and read whole file
-  inputFile.read((char *)msSourceBuffer.c_str(), msSourceBuffer.size());
+  inputFile.read(const_cast<char *>(msSourceBuffer.c_str()), msSourceBuffer.size());
   if ((unsigned int)inputFile.gcount() != msSourceBuffer.size())
     throw l10nMem::showError("cannot read whole file");
   inputFile.close();
@@ -325,7 +325,7 @@ void convert_gen_impl::writeSourceFile(const std::string& line)
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-std::string& convert_gen_impl::copySource(char *yyText, bool bDoClear)
+std::string& convert_gen_impl::copySource(char const *yyText, bool bDoClear)
 {
   int nL;
 
diff --git a/l10ntools/source/gConvDB.cxx b/l10ntools/source/gConvDB.cxx
index 8822414..a6d01a7 100644
--- a/l10ntools/source/gConvDB.cxx
+++ b/l10ntools/source/gConvDB.cxx
@@ -87,7 +87,7 @@ bool convert_db::collectLine()
      {
        if (i >= NUMFIELD)
        {
-         l10nMem::showError((char*)"TOO many fields", miLineNo);
+         l10nMem::showError("TOO many fields", miLineNo);
        }
        msFields[i++] = msSourceBuffer.substr(iStart, miSourceReadIndex - iStart);
        iStart       = miSourceReadIndex +1;
diff --git a/l10ntools/source/gConvProp.cxx b/l10ntools/source/gConvProp.cxx
index d03455c..159325d 100644
--- a/l10ntools/source/gConvProp.cxx
+++ b/l10ntools/source/gConvProp.cxx
@@ -32,7 +32,7 @@
 /**********************   I M P L E M E N T A T I O N   **********************/
 convert_prop::convert_prop(l10nMem& crMemory) : convert_gen_impl(crMemory)
 {
-  throw mcMemory.showError(std::string("convert_prop not implemented"));
+  throw l10nMem::showError(std::string("convert_prop not implemented"));
 }
 
 
@@ -47,5 +47,5 @@ convert_prop::~convert_prop()
 /**********************   I M P L E M E N T A T I O N   **********************/
 void convert_prop::execute()
 {
-  throw mcMemory.showError(std::string("convert_prop::execute not implemented"));
+  throw l10nMem::showError(std::string("convert_prop::execute not implemented"));
 }
diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx
index b65f2d2..f579d47 100644
--- a/l10ntools/source/gConvSrc.cxx
+++ b/l10ntools/source/gConvSrc.cxx
@@ -75,8 +75,8 @@ void convert_src::setValue(char *syyText, char *sbuildValue)
 
   if (mbInList && !mbInListItem)
   {
-    setListItem((char *)"", true);
-    setListItem((char *)"", false);
+    setListItem("", true);
+    setListItem("", false);
   }
   msValue        = sbuildValue;
   mbValuePresent = true;
@@ -92,7 +92,7 @@ void convert_src::setLang(char *syyText, bool bEnUs)
 
   mbEnUs = bEnUs;
   if (!bEnUs && mbExpectValue)
-    mcMemory.showError(useText);
+      l10nMem::showError(useText);
 }
 
 
@@ -258,7 +258,7 @@ void convert_src::stopBlock(char *syyText)
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void convert_src::setListItem(char *syyText, bool bIsStart)
+void convert_src::setListItem(char const *syyText, bool bIsStart)
 {
   copySource(syyText);
 
diff --git a/l10ntools/source/gConvTree.cxx b/l10ntools/source/gConvTree.cxx
index 06f577d..d7fca81 100644
--- a/l10ntools/source/gConvTree.cxx
+++ b/l10ntools/source/gConvTree.cxx
@@ -32,7 +32,7 @@
 /**********************   I M P L E M E N T A T I O N   **********************/
 convert_tree::convert_tree(l10nMem& crMemory)
                           : convert_gen_impl(crMemory),
-                            mcOutputFiles(NULL),
+                            mcOutputFiles(nullptr),
                             meStateTag(STATE_TAG_NONE),
                             meStateVal(STATE_VAL_NONE),
                             miCntLanguages(0)
@@ -103,7 +103,7 @@ void convert_tree::execute()
 //  TreeWrap::yylex();
 
   // dump last line
-  copySourceSpecial(NULL,3);
+  copySourceSpecial(nullptr,3);
 }
 
 
diff --git a/l10ntools/source/gConvUlf.cxx b/l10ntools/source/gConvUlf.cxx
index 7f220b1..c766d53 100644
--- a/l10ntools/source/gConvUlf.cxx
+++ b/l10ntools/source/gConvUlf.cxx
@@ -74,7 +74,7 @@ void convert_ulf::setText(char *syyText, bool bIsEnUs)
 
 
   if (!bIsEnUs)
-    mcMemory.showError(sText);
+      l10nMem::showError(sText);
 }
 
 
diff --git a/l10ntools/source/gConvXcs.cxx b/l10ntools/source/gConvXcs.cxx
index 6133bbb..ec010d4 100644
--- a/l10ntools/source/gConvXcs.cxx
+++ b/l10ntools/source/gConvXcs.cxx
@@ -78,12 +78,12 @@ void convert_xcs::setKey(char *syyText)
 
   // is it to be translated
   if (sText.find("oor:localized=") == std::string::npos)
-  return;
+      return;
 
   // locate key (is any)
   nL = sText.find("oor:name=\"");
   if (nL == (int)std::string::npos)
-  return;
+      return;
   sHead = sText.substr(nL+10);
   nL    = sHead.find("\"");
   msKey = sHead.substr(0,nL);
diff --git a/l10ntools/source/gConvXcu.cxx b/l10ntools/source/gConvXcu.cxx
index 972e546..8cf309b 100644
--- a/l10ntools/source/gConvXcu.cxx
+++ b/l10ntools/source/gConvXcu.cxx
@@ -124,7 +124,7 @@ void convert_xcu::startCollectData(char *syyText)
     else
     {
       std::string sErr = sTag.substr(nL,5) + " is not en-US";
-      mcMemory.showError(sErr);
+      l10nMem::showError(sErr);
     }
   }
 }
diff --git a/l10ntools/source/gConvXhp.cxx b/l10ntools/source/gConvXhp.cxx
index 6222e2a..0cb925f 100644
--- a/l10ntools/source/gConvXhp.cxx
+++ b/l10ntools/source/gConvXhp.cxx
@@ -33,8 +33,8 @@
 convert_xhp::convert_xhp(l10nMem& crMemory)
                         : convert_gen_impl(crMemory),
                           meExpectValue(VALUE_NOT_USED),
-                          msLangText(NULL),
-                          mcOutputFiles(NULL),
+                          msLangText(nullptr),
+                          mcOutputFiles(nullptr),
                           miCntLanguages(0)
 {
   // xhp files are written through a local routine
@@ -102,7 +102,7 @@ void convert_xhp::execute()
 //  XhpWrap::yylex();
 
   // dump last line
-  copySourceSpecial(NULL,3);
+  copySourceSpecial(nullptr,3);
 }
 
 
@@ -219,7 +219,7 @@ void convert_xhp::setLang(char *yytext)
          if (sLang == "en-US")
            meExpectValue = VALUE_IS_TAG_TRANS;
          else
-          mcMemory.showError(sLang + " is no en-US language");
+             l10nMem::showError(sLang + " is no en-US language");
          break;
 
     case VALUE_IS_VALUE_TAG:
diff --git a/l10ntools/source/gConvXrm.cxx b/l10ntools/source/gConvXrm.cxx
index daac9ad..b86c579 100644
--- a/l10ntools/source/gConvXrm.cxx
+++ b/l10ntools/source/gConvXrm.cxx
@@ -106,7 +106,7 @@ void convert_xrm::setLang(char *yytext)
     if (sLang == "en-US")
       mbIsLang = true;
     else
-      mcMemory.showError(sLang + " is no en-US language");
+      l10nMem::showError(sLang + " is no en-US language");
   }
 }
 
diff --git a/l10ntools/source/gL10nMem.cxx b/l10ntools/source/gL10nMem.cxx
index f0acb08..11b3793 100644
--- a/l10ntools/source/gL10nMem.cxx
+++ b/l10ntools/source/gL10nMem.cxx
@@ -35,7 +35,7 @@
 
 
 /*******************   G L O B A L   D E F I N I T I O N   *******************/
-l10nMem_impl * l10nMem_impl::mcImpl    = NULL;
+l10nMem_impl * l10nMem_impl::mcImpl    = nullptr;
 bool           l10nMem_impl::mbVerbose = false;
 bool           l10nMem_impl::mbDebug   = false;
 
@@ -701,9 +701,9 @@ void l10nMem_impl::convEntryKey(int                iLineNo,
 /**********************   I M P L E M E N T A T I O N   **********************/
 void l10nMem_impl::convertToInetString(std::string& sText)
 {
-static const char *replacingStr[] = {"&",     "\'",     ">",     "<",   "\"",     NULL };
+static const char *replacingStr[] = {"&",     "\'",     ">",     "<",   "\"",     nullptr };
 static const int   replacingLen[] = {1,       1,        1,      1,      1,        0    };
-static const char *newStr[]       = {"&", "'", ">", "<", """, NULL };
+static const char *newStr[]       = {"&", "'", ">", "<", """, nullptr };
 static const int   newLen[]       = {5,       6,        4,      4,      6,        0    };
   int i, pos;
 
@@ -722,9 +722,9 @@ static const int   newLen[]       = {5,       6,        4,      4,      6,
 /**********************   I M P L E M E N T A T I O N   **********************/
 void l10nMem_impl::convertFromInetString(std::string& sText)
 {
-static const char *replacingStr[] = {"&", "'", ">", "<", """, NULL };
+static const char *replacingStr[] = {"&", "'", ">", "<", """, nullptr };
 static const int   replacingLen[] = {5,       6,        4,      4,      6,        0    };
-static const char *newStr[]       = {"&",     "\'",     ">",     "<",   "\"",     NULL };
+static const char *newStr[]       = {"&",     "\'",     ">",     "<",   "\"",     nullptr };
 static const int   newLen[]       = {1,       1,        1,      1,      1,        0    };
   int i, pos;
 


More information about the Libreoffice-commits mailing list