1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 23:22:30 +01:00

Fixed floating point constants defined as double but expected as float

To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-05-24 15:49:06 +02:00
committed by Carlos R. Mafra
parent 1df08cc492
commit 79a95d7173
8 changed files with 31 additions and 31 deletions

View File

@@ -201,14 +201,14 @@ void slide_windows(Window wins[], int n, int from_x, int from_y, int to_x, int t
px = slide_steps;
else if (px > -slide_steps && px < 0)
px = -slide_steps;
py = (is_dx_nul ? 0.0 : px * dy / dx);
py = (is_dx_nul ? 0.0F : px * dy / dx);
} else {
py = dy / slide_slowdown;
if (py < slide_steps && py > 0)
py = slide_steps;
else if (py > -slide_steps && py < 0)
py = -slide_steps;
px = (is_dy_nul ? 0.0 : py * dx / dy);
px = (is_dy_nul ? 0.0F : py * dx / dy);
}
while (((int)x) != to_x ||
@@ -221,19 +221,19 @@ void slide_windows(Window wins[], int n, int from_x, int from_y, int to_x, int t
y = (float)to_y;
if (dx_is_bigger) {
px = px * (1.0 - 1 / (float)slide_slowdown);
px = px * (1.0F - 1 / (float)slide_slowdown);
if (px < slide_steps && px > 0)
px = slide_steps;
else if (px > -slide_steps && px < 0)
px = -slide_steps;
py = (is_dx_nul ? 0.0 : px * dy / dx);
py = (is_dx_nul ? 0.0F : px * dy / dx);
} else {
py = py * (1.0 - 1 / (float)slide_slowdown);
py = py * (1.0F - 1 / (float)slide_slowdown);
if (py < slide_steps && py > 0)
py = slide_steps;
else if (py > -slide_steps && py < 0)
py = -slide_steps;
px = (is_dy_nul ? 0.0 : py * dx / dy);
px = (is_dy_nul ? 0.0F : py * dx / dy);
}
for (i = 0; i < n; i++) {