wxwidgets.cfg: Added support for some wxTextFile functions.

This commit is contained in:
orbitcowboy 2017-09-04 14:52:10 +02:00
parent 9465dca583
commit 095e435031
3 changed files with 194 additions and 10 deletions

View File

@ -557,6 +557,189 @@
<returnValue type="unsigned char"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- void AddLine (const wxString &str, wxTextFileType type=typeDefault) -->
<function name="wxTextFile::AddLine">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" default="typeDefault">
<not-uninit/>
</arg>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- void Clear () -->
<function name="wxTextFile::Clear">
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool Close () -->
<function name="wxTextFile::Close">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool Create () -->
<function name="wxTextFile::Create">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool Create (const wxString &strFile) -->
<function name="wxTextFile::Create">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool Eof () const -->
<function name="wxTextFile::Eof">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool Exists () const -->
<function name="wxTextFile::Exists">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- size_t GetCurrentLine () const -->
<function name="wxTextFile::GetCurrentLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="size_t"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxString & GetFirstLine () -->
<function name="wxTextFile::GetFirstLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxString"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxString & GetLastLine () -->
<function name="wxTextFile::GetLastLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxString"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- size_t GetLineCount () const -->
<function name="wxTextFile::GetLineCount">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="size_t"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxTextFileType GetLineType (size_t n) const -->
<function name="wxTextFile::GetLineType">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxTextFileType"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- const wxString & GetName () const -->
<function name="wxTextFile::GetName">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="const wxString"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxString & GetNextLine () -->
<function name="wxTextFile::GetNextLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxString"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxString & GetPrevLine () -->
<function name="wxTextFile::GetPrevLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxString"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- void GoToLine (size_t n) -->
<function name="wxTextFile::GoToLine">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxTextFileType GuessType () const -->
<function name="wxTextFile::GuessType">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxTextFileType"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- void InsertLine (const wxString &str, size_t n, wxTextFileType type=typeDefault) -->
<function name="wxTextFile::InsertLine">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3" default="typeDefault">
<not-uninit/>
</arg>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- bool IsOpened () const -->
<function name="wxTextFile::IsOpened">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="bool"/>
<use-retval/>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- void RemoveLine (size_t n) -->
<function name="wxTextFile::RemoveLine">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- http://docs.wxwidgets.org/trunk/classwx_text_file.html -->
<!-- wxString & GetLine (size_t n) -->
<!-- const wxString & GetLine (size_t n) const -->
<function name="wxTextFile::GetLine">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="wxString"/>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- Override macros which don't necessarily require semicolons at the end -->
<define name="DECLARE_CLASS(n)" value=""/>
<define name="DECLARE_DYNAMIC_CLASS(n)" value=""/>

View File

@ -51,12 +51,13 @@ namespace {
CheckCondition instance;
}
bool CheckCondition::isAliased(const std::set<unsigned int> &vars) const {
bool CheckCondition::isAliased(const std::set<unsigned int> &vars) const
{
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
if (Token::Match(tok, "= & %var% ;") && vars.find(tok->tokAt(2)->varId()) != vars.end())
return true;
}
return false;
if (Token::Match(tok, "= & %var% ;") && vars.find(tok->tokAt(2)->varId()) != vars.end())
return true;
}
return false;
}
void CheckCondition::assignIf()
@ -524,14 +525,14 @@ void CheckCondition::multiCondition2()
if (type == MULTICONDITIONTYPE::INNER) {
if (isOppositeCond(false, _tokenizer->isCPP(), cond1, cond2, _settings->library, true)) {
if (!isAliased(vars))
oppositeInnerConditionError(cond1, cond2);
if (!isAliased(vars))
oppositeInnerConditionError(cond1, cond2);
}
} else {
if (isSameExpression(_tokenizer->isCPP(), true, cond1, cond2, _settings->library, true)) {
if (!isAliased(vars))
sameConditionAfterEarlyExitError(cond1, cond2);
}
sameConditionAfterEarlyExitError(cond1, cond2);
}
}
}

View File

@ -114,7 +114,7 @@ public:
void checkInvalidTestForOverflow();
private:
bool isAliased(const std::set<unsigned int> &vars) const;
bool isAliased(const std::set<unsigned int> &vars) const;
bool isOverlappingCond(const Token * const cond1, const Token * const cond2, bool pure) const;
void assignIfError(const Token *tok1, const Token *tok2, const std::string &condition, bool result);
void mismatchingBitAndError(const Token *tok1, const MathLib::bigint num1, const Token *tok2, const MathLib::bigint num2);