Kaydet (Commit) 11231f91 authored tarafından jan iversen's avatar jan iversen

genlang, removed clang problems

The clang plugin does not not like
   for (<foo>;<foo>;<foo>) ;
(most compilers do not complain, when using the ' ')

Also a virtual destructor need "override" in the
implementing class.

Change-Id: Ib99702f11dbd24595935594ee97c136c8e604aff
üst a5728dca
......@@ -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
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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:
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -47,7 +47,7 @@ using namespace std;
convert_gen * convert_gen::mcImpl = NULL;
convert_gen * convert_gen::mcImpl;
......
......@@ -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");
......
......@@ -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);
}
......
......@@ -49,7 +49,6 @@ convert_tree::~convert_tree()
extern int treelex(void);
void convert_tree::doExecute()
{
string sLang;
......
......@@ -20,11 +20,13 @@
#include <vector>
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();
......
......@@ -25,7 +25,6 @@ using namespace std;
extern int ulflex(void);
void convert_ulf::doExecute()
{
ulflex();
......
......@@ -33,7 +33,6 @@ convert_xcs::convert_xcs(l10nMem& crMemory)
extern int xcslex(void);
void convert_xcs::doExecute()
{
if (mbMergeMode)
......
......@@ -32,7 +32,6 @@ convert_xcu::convert_xcu(l10nMem& crMemory)
extern int xculex(void);
void convert_xcu::doExecute()
{
xculex();
......
......@@ -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;
......
......@@ -35,7 +35,6 @@ convert_xrm::convert_xrm(l10nMem& crMemory)
extern int xrmlex(void);
void convert_xrm::doExecute()
{
xrmlex();
......
......@@ -24,7 +24,9 @@
using namespace std;
#include "gL10nMem.hxx"
#include "gConvPO.hxx"
#include "gConvPo.hxx"
l10nMem *myMem;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment