windows.cfg: Add macros SUCCEEDED() and FAILED(). (#1264)

Somehow the opposite inner condition is not detected when macros are used. I created this ticket: https://trac.cppcheck.net/ticket/8596
This commit is contained in:
Sebastian 2018-05-24 14:52:32 +02:00 committed by GitHub
parent 3311307227
commit 8b94bfaf0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -5349,4 +5349,8 @@ HFONT CreateFont(
<define name="LOBYTE(wValue)" value="((BYTE)(((DWORD_PTR)(wValue)) &amp; 0xff))"/>
<!-- BYTE HIBYTE(WORD wValue); -->
<define name="HIBYTE(wValue)" value="((BYTE)((((DWORD_PTR)(wValue)) &gt;&gt; 8) &amp; 0xff))"/>
<!-- BOOL SUCCEEDED(HRESULT hr); -->
<define name="SUCCEEDED(hr)" value="(((HRESULT)(hr)) &gt;= 0)"/>
<!-- BOOL FAILED(HRESULT hr); -->
<define name="FAILED(hr)" value="(((HRESULT)(hr)) &lt; 0)"/>
</def>

View File

@ -706,3 +706,12 @@ void uninitvar_towupper(_locale_t l)
// cppcheck-suppress uninitvar
(void)_towupper_l(i, l);
}
void oppositeInnerCondition_SUCCEEDED_FAILED(HRESULT hr)
{
if (SUCCEEDED(hr)) {
// TODO ticket #8596 cppcheck-suppress oppositeInnerCondition
if (FAILED(hr)) {
}
}
}