fix some errors and warnings for GCC 6
* do not use std::abs() because math.h includes one, that converts ints to double. Use own iabs(), which directly uses labs() instead. * don't use the word "gamma" as name for variables * don't use a homebrew round() function
This commit is contained in:
@@ -165,12 +165,12 @@ void checkselections()
|
||||
// update current selection, or add a new one
|
||||
void makesel(bool isnew)
|
||||
{
|
||||
if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), abs(lastx-cx)+1, abs(lasty-cy)+1, max(lasth, ch));
|
||||
if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), iabs(lastx-cx)+1, iabs(lasty-cy)+1, max(lasth, ch));
|
||||
else
|
||||
{
|
||||
block &cursel = sels.last();
|
||||
cursel.x = min(lastx, cx); cursel.y = min(lasty, cy);
|
||||
cursel.xs = abs(lastx-cx)+1; cursel.ys = abs(lasty-cy)+1;
|
||||
cursel.xs = iabs(lastx-cx)+1; cursel.ys = iabs(lasty-cy)+1;
|
||||
cursel.h = max(lasth, ch);
|
||||
correctsel(cursel);
|
||||
}
|
||||
@@ -991,7 +991,7 @@ void movemap(int *xop, int *yop, int *zop) // move whole map
|
||||
}
|
||||
if(xo || yo)
|
||||
{
|
||||
block b = { max(-xo, 0), max(-yo, 0), ssize - abs(xo), ssize - abs(yo) }, *cp = blockcopy(b);
|
||||
block b = { max(-xo, 0), max(-yo, 0), ssize - iabs(xo), ssize - iabs(yo) }, *cp = blockcopy(b);
|
||||
cp->x = max(xo, 0);
|
||||
cp->y = max(yo, 0);
|
||||
blockpaste(*cp);
|
||||
|
||||
Reference in New Issue
Block a user