mail[Wesnoth-commits] r24874 - /trunk/src/mouse_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by bruno on March 19, 2008 - 19:17:
Author: brunowolff
Date: Wed Mar 19 19:17:17 2008
New Revision: 24874

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24874&view=rev
Log:
Thanks for pointing out the intention of the statement, but given that 
intention
It was still wrong. Bitwise and has lower preceence than comparison so parens
are needed around the masking clause. This change gets rid of the gcc 4.3
warning and I think provides the correct semantics.


Modified:
    trunk/src/mouse_events.cpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=24874&r1=24873&r2=24874&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Wed Mar 19 19:17:17 2008
@@ -758,7 +758,7 @@
        // While we check the mouse buttons state, we also grab fresh 
position data.
        int mx = drag_from_x_; // some default value to prevent unlikely SDL 
bug
        int my = drag_from_y_;
-       if (dragging_ && !dragging_started_ && (SDL_GetMouseState(&mx,&my) & 
SDL_BUTTON_LEFT != 0)) {
+       if (dragging_ && !dragging_started_ && (SDL_GetMouseState(&mx,&my) & 
SDL_BUTTON_LEFT) != 0) {
                const double drag_distance = std::pow((double) (drag_from_x_- 
mx), 2) + std::pow((double) (drag_from_y_- my), 2);
                if (drag_distance > drag_threshold*drag_threshold) {
                        dragging_started_ = true;




Related Messages


Powered by MHonArc, Updated Wed Mar 19 19:41:22 2008