From 11231f9179db9821effc884e8adade48fdf89938 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Wed, 23 Mar 2016 17:12:11 +0100 Subject: genlang, removed clang problems The clang plugin does not not like for (;;) ; (most compilers do not complain, when using the ' ') Also a virtual destructor need "override" in the implementing class. Change-Id: Ib99702f11dbd24595935594ee97c136c8e604aff --- l10ntools/inc/gConv.hxx | 2 +- l10ntools/inc/gConvPo.hxx | 3 +-- l10ntools/inc/gConvProp.hxx | 2 +- l10ntools/inc/gConvSrc.hxx | 2 +- l10ntools/inc/gConvTree.hxx | 4 +++- l10ntools/inc/gConvUi.hxx | 6 +++++- l10ntools/inc/gConvUlf.hxx | 5 ++++- l10ntools/inc/gConvXcs.hxx | 6 +++++- l10ntools/inc/gConvXcu.hxx | 9 ++++++++- l10ntools/inc/gConvXhp.hxx | 6 +++++- l10ntools/inc/gConvXrm.hxx | 6 +++++- l10ntools/source/gConv.cxx | 2 +- l10ntools/source/gConvPo.cxx | 12 +++++++----- l10ntools/source/gConvSrc.cxx | 7 ++++--- l10ntools/source/gConvTree.cxx | 1 - l10ntools/source/gConvUi.cxx | 5 +++-- l10ntools/source/gConvUlf.cxx | 1 - l10ntools/source/gConvXcs.cxx | 1 - l10ntools/source/gConvXcu.cxx | 1 - l10ntools/source/gConvXhp.cxx | 4 +++- l10ntools/source/gConvXrm.cxx | 1 - l10ntools/source/gL10nMem.cxx | 4 +++- l10ntools/source/gLang.cxx | 5 +++-- 23 files changed, 63 insertions(+), 32 deletions(-) (limited to 'l10ntools') diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx index d51f2bf9a808..86d84a74fdc0 100644 --- a/l10ntools/inc/gConv.hxx +++ b/l10ntools/inc/gConv.hxx @@ -65,6 +65,6 @@ class convert_gen bool createDir(const string& sDir, const string& sFile); private: ofstream mcOutputFile; - bool checkAccess(string& sFile); + static bool checkAccess(string& sFile); }; #endif diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx index 69c62d025922..31c037d107b5 100644 --- a/l10ntools/inc/gConvPo.hxx +++ b/l10ntools/inc/gConvPo.hxx @@ -16,7 +16,6 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #ifndef GCONPO_HXX #define GCONPO_HXX #include "gConv.hxx" @@ -31,7 +30,7 @@ class convert_po : public convert_gen convert_po(l10nMem& crMemory); - ~convert_po() {}; + ~convert_po() override {}; void startLook (); void setValue (char *syyText, int iLineCnt); diff --git a/l10ntools/inc/gConvProp.hxx b/l10ntools/inc/gConvProp.hxx index b9e5b7c7a30f..d65531ec5d2a 100644 --- a/l10ntools/inc/gConvProp.hxx +++ b/l10ntools/inc/gConvProp.hxx @@ -26,7 +26,7 @@ class convert_prop : public convert_gen { public: convert_prop(l10nMem& crMemory) : convert_gen(crMemory) {}; - ~convert_prop() {}; + ~convert_prop() override {}; private: void doExecute() override; diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx index dd41895b4483..65bd5eb6daba 100644 --- a/l10ntools/inc/gConvSrc.hxx +++ b/l10ntools/inc/gConvSrc.hxx @@ -28,7 +28,7 @@ class convert_src : public convert_gen bool mbExpectValue; convert_src(l10nMem& crMemory); - ~convert_src() {}; + ~convert_src() override {}; void setValue (char *syyText, char *sbuildValue); void setLang (char *syyText, bool bEnUs); diff --git a/l10ntools/inc/gConvTree.hxx b/l10ntools/inc/gConvTree.hxx index fff9248d836b..bd9adb38d65e 100644 --- a/l10ntools/inc/gConvTree.hxx +++ b/l10ntools/inc/gConvTree.hxx @@ -21,6 +21,8 @@ #include "gConv.hxx" +extern int treelex(void); + class convert_tree : public convert_gen { @@ -40,7 +42,7 @@ class convert_tree : public convert_gen } STATE_VAL; convert_tree(l10nMem& crMemory); - ~convert_tree(); + ~convert_tree() override; void setString(char *yytext); void setState(char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL, char *sModule); diff --git a/l10ntools/inc/gConvUi.hxx b/l10ntools/inc/gConvUi.hxx index ffc9531a7855..be4a443e136e 100644 --- a/l10ntools/inc/gConvUi.hxx +++ b/l10ntools/inc/gConvUi.hxx @@ -22,11 +22,15 @@ +extern int uilex(void); + + + class convert_ui : public convert_gen { public: convert_ui(l10nMem& crMemory); - ~convert_ui() {}; + ~convert_ui() override {}; private: diff --git a/l10ntools/inc/gConvUlf.hxx b/l10ntools/inc/gConvUlf.hxx index 7053059d1888..85902e4bba0f 100644 --- a/l10ntools/inc/gConvUlf.hxx +++ b/l10ntools/inc/gConvUlf.hxx @@ -22,11 +22,14 @@ +extern int ulflex(void); + + class convert_ulf : public convert_gen { public: convert_ulf(l10nMem& crMemory) : convert_gen(crMemory) {}; - ~convert_ulf() {}; + ~convert_ulf() override {}; void setKey(char *syyText); void setText(char *syyText, bool bIsEnUs); diff --git a/l10ntools/inc/gConvXcs.hxx b/l10ntools/inc/gConvXcs.hxx index c7bedede084a..407ff61a375e 100644 --- a/l10ntools/inc/gConvXcs.hxx +++ b/l10ntools/inc/gConvXcs.hxx @@ -22,11 +22,15 @@ +extern int xcslex(void); + + + class convert_xcs : public convert_gen { public: convert_xcs(l10nMem& crMemory); - ~convert_xcs() {}; + ~convert_xcs() override {}; void setKey(char *syyText); void unsetKey(char *syyText); diff --git a/l10ntools/inc/gConvXcu.hxx b/l10ntools/inc/gConvXcu.hxx index c222eaca2c43..1bdde9fc30e8 100644 --- a/l10ntools/inc/gConvXcu.hxx +++ b/l10ntools/inc/gConvXcu.hxx @@ -22,14 +22,21 @@ +extern int xculex(void); + + + class xcu_stack_entry; + + + class convert_xcu : public convert_gen { public: bool mbNoCollectingData; convert_xcu(l10nMem& crMemory); - ~convert_xcu() {}; + ~convert_xcu() override {}; void pushKey(char *syyText); void popKey(char *syyText); diff --git a/l10ntools/inc/gConvXhp.hxx b/l10ntools/inc/gConvXhp.hxx index ef39822cb926..480280acd8af 100644 --- a/l10ntools/inc/gConvXhp.hxx +++ b/l10ntools/inc/gConvXhp.hxx @@ -22,11 +22,15 @@ +extern int xhplex(void); + + + class convert_xhp : public convert_gen { public: convert_xhp(l10nMem& crMemory); - ~convert_xhp(); + ~convert_xhp() override; void setString(char *yytext); void openTag(char *yytext); diff --git a/l10ntools/inc/gConvXrm.hxx b/l10ntools/inc/gConvXrm.hxx index 60b063f64762..8aa808814547 100644 --- a/l10ntools/inc/gConvXrm.hxx +++ b/l10ntools/inc/gConvXrm.hxx @@ -22,12 +22,16 @@ +extern int xrmlex(void); + + + class convert_xrm : public convert_gen { public: bool mbNoCollectingData; convert_xrm(l10nMem& crMemory); - ~convert_xrm() {}; + ~convert_xrm() override {}; void setId(char *yytext); void setLang(char *yytext); diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx index 0b034b011cc5..844deee12c17 100644 --- a/l10ntools/source/gConv.cxx +++ b/l10ntools/source/gConv.cxx @@ -47,7 +47,7 @@ using namespace std; -convert_gen * convert_gen::mcImpl = NULL; +convert_gen * convert_gen::mcImpl; diff --git a/l10ntools/source/gConvPo.cxx b/l10ntools/source/gConvPo.cxx index e3adbbf2d1da..cbc8f24f0dce 100644 --- a/l10ntools/source/gConvPo.cxx +++ b/l10ntools/source/gConvPo.cxx @@ -95,12 +95,14 @@ void convert_po::setKey(char *syyText) startLook(); // skip "#:" and any blanks - for (syyText += 2; *syyText == ' ' || *syyText == '\t'; ++syyText) ; - msKey = syyText; + for (syyText += 2; *syyText == ' ' || *syyText == '\t'; ++syyText) + ; + msKey = syyText; // remove trailing blanks - for (i = msKey.size() -1; msKey[i] == '\r' || msKey[i] == ' ' || msKey[i] == '\t'; --i) ; - msKey.erase(i+1); + for (i = msKey.size() -1; msKey[i] == '\r' || msKey[i] == ' ' || msKey[i] == '\t'; --i) + ; + msKey.erase(i+1); } @@ -146,7 +148,7 @@ void convert_po::startSave(const string& sName, // create directories as needed createDir(string(""), sFilePath); - outBuffer.open(sFilePath.c_str(), ios::out + ios::binary); + outBuffer.open(sFilePath.c_str(), ios::out | ios::binary); if (!outBuffer.is_open()) throw l10nMem::showError("Cannot open " + sFilePath + " for writing"); diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx index d73bd4d137c6..04b32bcca20b 100644 --- a/l10ntools/source/gConvSrc.cxx +++ b/l10ntools/source/gConvSrc.cxx @@ -269,9 +269,10 @@ void convert_src::trim(string& sText) while (sText[0] == ' ' || sText[0] == '\t') sText.erase(0,1); - for (nL = sText.size(); sText[nL-1] == ' ' || sText[nL-1] == '\t'; --nL); - if (nL != (int)sText.size()) - sText.erase(nL); + for (nL = sText.size(); sText[nL-1] == ' ' || sText[nL-1] == '\t'; --nL) + ; + if (nL != (int)sText.size()) + sText.erase(nL); } diff --git a/l10ntools/source/gConvTree.cxx b/l10ntools/source/gConvTree.cxx index 2d2075f4c524..b15d4b022f94 100644 --- a/l10ntools/source/gConvTree.cxx +++ b/l10ntools/source/gConvTree.cxx @@ -49,7 +49,6 @@ convert_tree::~convert_tree() -extern int treelex(void); void convert_tree::doExecute() { string sLang; diff --git a/l10ntools/source/gConvUi.cxx b/l10ntools/source/gConvUi.cxx index 5b5b1bcf48f4..3a6bd687791d 100644 --- a/l10ntools/source/gConvUi.cxx +++ b/l10ntools/source/gConvUi.cxx @@ -20,11 +20,13 @@ #include using namespace std; -#include "gL10nMem.hxx" + +#include "gL10nMem.hxx" #include "gConvUi.hxx" + convert_ui::convert_ui(l10nMem& crMemory) : convert_gen(crMemory) { @@ -32,7 +34,6 @@ convert_ui::convert_ui(l10nMem& crMemory) -extern int uilex(void); void convert_ui::doExecute() { uilex(); diff --git a/l10ntools/source/gConvUlf.cxx b/l10ntools/source/gConvUlf.cxx index 556d0e4aefa4..3cd675a879e6 100644 --- a/l10ntools/source/gConvUlf.cxx +++ b/l10ntools/source/gConvUlf.cxx @@ -25,7 +25,6 @@ using namespace std; -extern int ulflex(void); void convert_ulf::doExecute() { ulflex(); diff --git a/l10ntools/source/gConvXcs.cxx b/l10ntools/source/gConvXcs.cxx index dc8a4a63d136..c00f23f9fde9 100644 --- a/l10ntools/source/gConvXcs.cxx +++ b/l10ntools/source/gConvXcs.cxx @@ -33,7 +33,6 @@ convert_xcs::convert_xcs(l10nMem& crMemory) -extern int xcslex(void); void convert_xcs::doExecute() { if (mbMergeMode) diff --git a/l10ntools/source/gConvXcu.cxx b/l10ntools/source/gConvXcu.cxx index 87a9927bd0d6..fe8e07f63bcb 100644 --- a/l10ntools/source/gConvXcu.cxx +++ b/l10ntools/source/gConvXcu.cxx @@ -32,7 +32,6 @@ convert_xcu::convert_xcu(l10nMem& crMemory) -extern int xculex(void); void convert_xcu::doExecute() { xculex(); diff --git a/l10ntools/source/gConvXhp.cxx b/l10ntools/source/gConvXhp.cxx index db19ba1df531..9c07772f0b38 100644 --- a/l10ntools/source/gConvXhp.cxx +++ b/l10ntools/source/gConvXhp.cxx @@ -22,6 +22,9 @@ using namespace std; #include "gL10nMem.hxx" #include "gConvXhp.hxx" + + + convert_xhp::convert_xhp(l10nMem& crMemory) : convert_gen(crMemory), meExpectValue(VALUE_NOT_USED), @@ -48,7 +51,6 @@ convert_xhp::~convert_xhp() -extern int xhplex(void); void convert_xhp::doExecute() { string sLang; diff --git a/l10ntools/source/gConvXrm.cxx b/l10ntools/source/gConvXrm.cxx index 2a075feed843..c1ff12811862 100644 --- a/l10ntools/source/gConvXrm.cxx +++ b/l10ntools/source/gConvXrm.cxx @@ -35,7 +35,6 @@ convert_xrm::convert_xrm(l10nMem& crMemory) -extern int xrmlex(void); void convert_xrm::doExecute() { xrmlex(); diff --git a/l10ntools/source/gL10nMem.cxx b/l10ntools/source/gL10nMem.cxx index fb50ac96985a..f5c5d410fd18 100644 --- a/l10ntools/source/gL10nMem.cxx +++ b/l10ntools/source/gL10nMem.cxx @@ -24,7 +24,9 @@ using namespace std; #include "gL10nMem.hxx" -#include "gConvPO.hxx" +#include "gConvPo.hxx" + + l10nMem *myMem; diff --git a/l10ntools/source/gLang.cxx b/l10ntools/source/gLang.cxx index b1b38b542e5f..ae45779211f5 100644 --- a/l10ntools/source/gLang.cxx +++ b/l10ntools/source/gLang.cxx @@ -32,8 +32,8 @@ class handler handler() {}; ~handler() {}; - void showRunTimeError(string sErr); - void showUsage(string sErr); + static void showRunTimeError(string sErr); + static void showUsage(string sErr); void checkCommandLine(int argc, char *argv[]); void run(); @@ -300,6 +300,7 @@ void handler::runConvert() // convert + loadL10MEM(true); mcMemory.setConvert(true, false); // loop through all source files, and extract messages from each file -- cgit