Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginClass.cpp

Issue 29333356: Noissue - Eliminate compile warnings in the plugin (Closed)
Patch Set: Created Jan. 11, 2016, 3:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/NotificationMessage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -77,14 +77,22 @@
: public RECT
{
public:
- int Height() const
+ unsigned long Height() const
{
- return bottom - top;
+ if (bottom < top)
+ {
+ throw std::runtime_error("invariant violation: rectangle bottom < top");
+ }
+ return static_cast<unsigned long>(bottom - top);
}
- int Width() const
+ unsigned long Width() const
{
- return right - left;
+ if (right < left)
+ {
+ throw std::runtime_error("invariant violation: rectangle right < left");
+ }
+ return static_cast<unsigned long>(right - left);
}
};
}
@@ -1576,7 +1584,7 @@
tab->OnActivate();
RECT rect;
GetWindowRect(pClass->m_hPaneWnd, &rect);
- pClass->notificationMessage.Move(rect.left + (rect.right - rect.left) / 2, rect.top + (rect.bottom - rect.top) / 2);
+ pClass->notificationMessage.MoveToCenter(rect);
}
if (LOWORD(wParam) == UIS_CLEAR)
{
@@ -1590,7 +1598,7 @@
GetWindowRect(pClass->m_hPaneWnd, &rect);
if (pClass->notificationMessage.IsVisible())
{
- pClass->notificationMessage.Move(rect.left + (rect.right - rect.left) / 2, rect.top + (rect.bottom - rect.top) / 2);
+ pClass->notificationMessage.MoveToCenter(rect);
}
break;
}
« no previous file with comments | « src/plugin/NotificationMessage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld