mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-16 14:15:46 +01:00
Fix various abs() issues.
The abs() function should take an int as argument, but there were several instances in the code where it was taking an unsigned int or a double. In these case, we took one of the following approaches: * If the argument was a double, use fabs() instead. * If the argument was unsigned and was certainly going to be positive (i.e,. no subtraction), then drop abs() altogether. * If the argument was unsigned as result of adding or subtracting signed and unsigned ints, then we cast all the unsigned ints to signed ints.
This commit is contained in:
committed by
Carlos R. Mafra
parent
dfa92906c0
commit
44bc9cc264
@@ -2002,8 +2002,8 @@ static int getResizeDirection(WWindow * wwin, int x, int y, int dy, int flags)
|
||||
int ydir = (abs(y) < (wwin->client.height / 2)) ? UP : DOWN;
|
||||
|
||||
/* How much resize space is allowed */
|
||||
int spacew = abs(wwin->client.width / 3);
|
||||
int spaceh = abs(wwin->client.height / 3);
|
||||
int spacew = wwin->client.width / 3;
|
||||
int spaceh = wwin->client.height / 3;
|
||||
|
||||
/* Determine where x fits */
|
||||
if ((abs(x) > wwin->client.width/2 - spacew/2) &&
|
||||
|
||||
Reference in New Issue
Block a user