diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-03 09:43:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-03 09:43:06 +0100 |
commit | a39fb49535bbcdecd0a605250f82335aee690937 (patch) | |
tree | 94b8b631c1ca1bf95af14c076f451e8157cc1706 /l10ntools/source | |
parent | fba6f6fb514ee84bd42f765d11a5627590d04cfd (diff) |
various loplugin warnings
Change-Id: I9078ba18d8897a89a472fe75385542dac0c6bf78
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/gConv.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/gConvDB.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/gConvProp.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/gConvSrc.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/gConvTree.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/gConvUlf.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/gConvXcs.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/gConvXcu.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/gConvXhp.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/gConvXrm.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/gL10nMem.cxx | 10 |
11 files changed, 28 insertions, 28 deletions
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx index 562d87aa1b14..15b5625c9ca0 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 88224141d0ae..a6d01a7ef907 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 d03455c16415..159325d02d34 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 b65f2d2d49dd..f579d471f9f3 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 06f577d2574b..d7fca8119c92 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 7f220b1724f4..c766d531b1d7 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 6133bbb6ed3a..ec010d4fe371 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 972e54638baa..8cf309b81c2e 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 6222e2a6668f..0cb925fb4feb 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 daac9adb9203..b86c57931bee 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 f0acb080eb0b..11b379381505 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; |