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:
parent
3311307227
commit
8b94bfaf0a
|
@ -5349,4 +5349,8 @@ HFONT CreateFont(
|
||||||
<define name="LOBYTE(wValue)" value="((BYTE)(((DWORD_PTR)(wValue)) & 0xff))"/>
|
<define name="LOBYTE(wValue)" value="((BYTE)(((DWORD_PTR)(wValue)) & 0xff))"/>
|
||||||
<!-- BYTE HIBYTE(WORD wValue); -->
|
<!-- BYTE HIBYTE(WORD wValue); -->
|
||||||
<define name="HIBYTE(wValue)" value="((BYTE)((((DWORD_PTR)(wValue)) >> 8) & 0xff))"/>
|
<define name="HIBYTE(wValue)" value="((BYTE)((((DWORD_PTR)(wValue)) >> 8) & 0xff))"/>
|
||||||
|
<!-- BOOL SUCCEEDED(HRESULT hr); -->
|
||||||
|
<define name="SUCCEEDED(hr)" value="(((HRESULT)(hr)) >= 0)"/>
|
||||||
|
<!-- BOOL FAILED(HRESULT hr); -->
|
||||||
|
<define name="FAILED(hr)" value="(((HRESULT)(hr)) < 0)"/>
|
||||||
</def>
|
</def>
|
||||||
|
|
|
@ -706,3 +706,12 @@ void uninitvar_towupper(_locale_t l)
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
(void)_towupper_l(i, l);
|
(void)_towupper_l(i, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void oppositeInnerCondition_SUCCEEDED_FAILED(HRESULT hr)
|
||||||
|
{
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
// TODO ticket #8596 cppcheck-suppress oppositeInnerCondition
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue