summaryrefslogtreecommitdiffhomepage
path: root/nGenEx
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2012-07-16 17:56:50 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2012-07-16 17:56:50 +0000
commit167d383f8ef1b52ef42373125ebf3daf2ad84418 (patch)
tree08d168563486b785ea77274d88f155ab72e917f8 /nGenEx
parentd247e6df50e9377cc5ecd0f4c29cc40de4165d1a (diff)
downloadstarshatter-167d383f8ef1b52ef42373125ebf3daf2ad84418.zip
starshatter-167d383f8ef1b52ef42373125ebf3daf2ad84418.tar.gz
starshatter-167d383f8ef1b52ef42373125ebf3daf2ad84418.tar.bz2
PVS Studio warning: Cast from false to int
Diffstat (limited to 'nGenEx')
-rw-r--r--nGenEx/ActiveWindow.cpp6
-rw-r--r--nGenEx/ActiveWindow.h2
-rw-r--r--nGenEx/Button.cpp6
-rw-r--r--nGenEx/Button.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/nGenEx/ActiveWindow.cpp b/nGenEx/ActiveWindow.cpp
index cf76063..145b29e 100644
--- a/nGenEx/ActiveWindow.cpp
+++ b/nGenEx/ActiveWindow.cpp
@@ -930,14 +930,14 @@ ActiveWindow::GetCapture()
// +--------------------------------------------------------------------+
-int
+bool
ActiveWindow::SetCapture()
{
EventDispatch* dispatch = EventDispatch::GetInstance();
if (dispatch)
- return dispatch->CaptureMouse(this);
+ return dispatch->CaptureMouse(this) == 1;
- return 0;
+ return false;
}
// +--------------------------------------------------------------------+
diff --git a/nGenEx/ActiveWindow.h b/nGenEx/ActiveWindow.h
index cd7780b..6edb619 100644
--- a/nGenEx/ActiveWindow.h
+++ b/nGenEx/ActiveWindow.h
@@ -172,7 +172,7 @@ public:
virtual Rect TargetRect() const;
virtual ActiveWindow* GetCapture();
- virtual int SetCapture();
+ virtual bool SetCapture();
virtual int ReleaseCapture();
// Property accessors:
diff --git a/nGenEx/Button.cpp b/nGenEx/Button.cpp
index c9cfcab..03c0dff 100644
--- a/nGenEx/Button.cpp
+++ b/nGenEx/Button.cpp
@@ -55,7 +55,7 @@ Button::Button(Screen* s, int ax, int ay, int aw, int ah, DWORD aid)
drop_shadow = false;
sticky = false;
picture_loc = 1;
- captured = 0;
+ captured = false;
pre_state = 0;
text_align = DT_CENTER;
@@ -78,7 +78,7 @@ Button::Button(ActiveWindow* p, int ax, int ay, int aw, int ah, DWORD aid)
drop_shadow = false;
sticky = false;
picture_loc = 1;
- captured = 0;
+ captured = false;
pre_state = 0;
text_align = DT_CENTER;
@@ -475,7 +475,7 @@ int Button::OnLButtonUp(int x, int y)
{
if (captured) {
ReleaseCapture();
- captured = 0;
+ captured = false;
}
button_state = pre_state;
diff --git a/nGenEx/Button.h b/nGenEx/Button.h
index 0b714c1..9868dfd 100644
--- a/nGenEx/Button.h
+++ b/nGenEx/Button.h
@@ -104,7 +104,7 @@ protected:
Color active_color;
Color border_color;
- int captured;
+ bool captured;
int pre_state;
short bevel_width;
short button_state;