Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void TAB_SetupScrolling(
- TAB_INFO* infoPtr,
- const RECT* clientRect)
- {
- ....
- /*
- * Calculate the position of the scroll control.
- */
- if(infoPtr->dwStyle & TCS_VERTICAL)
- {
- controlPos.right = clientRect->right;
- controlPos.left = controlPos.right -
- 2 * GetSystemMetrics(SM_CXHSCROLL);
- if (infoPtr->dwStyle & TCS_BOTTOM)
- {
- controlPos.top = clientRect->bottom -
- infoPtr->tabHeight;
- controlPos.bottom = controlPos.top +
- GetSystemMetrics(SM_CYHSCROLL);
- }
- else
- {
- controlPos.bottom = clientRect->top + infoPtr->tabHeight;
- controlPos.top = controlPos.bottom -
- GetSystemMetrics(SM_CYHSCROLL);
- }
- }
- else
- {
- controlPos.right = clientRect->right;
- controlPos.left = controlPos.right -
- 2 * GetSystemMetrics(SM_CXHSCROLL);
- if (infoPtr->dwStyle & TCS_BOTTOM)
- {
- controlPos.top = clientRect->bottom -
- infoPtr->tabHeight;
- controlPos.bottom = controlPos.top +
- GetSystemMetrics(SM_CYHSCROLL);
- }
- else
- {
- controlPos.bottom = clientRect->top + infoPtr->tabHeight;
- controlPos.top = controlPos.bottom -
- GetSystemMetrics(SM_CYHSCROLL);
- }
- }
- ....
- }
- This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
- Warning message is:
- V523 The 'then' statement is equivalent to the 'else' statement. tab.c 1043
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment