1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Added some explicit conversion to double precision

When the result of the operation is expected to use double precision, this
patchs adds an explicit conversion to that type to tell the compiler that
this is what we want, and not an unexpected side effect.

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

View File

@@ -591,7 +591,7 @@ void WMSetUDFloatForKey(WMUserDefaults * database, float value, const char *defa
WMPropList *object;
char buffer[128];
sprintf(buffer, "%f", value);
sprintf(buffer, "%f", (double)value);
object = WMCreatePLString(buffer);
WMSetUDObjectForKey(database, object, defaultName);

View File

@@ -565,7 +565,7 @@ static void scrollCallback(WMWidget * scroller, void *self)
floatValue = (floatValue * value) / value;
newFirst = rint(floatValue * (float)(bPtr->columnCount - bPtr->maxVisibleColumns));
newFirst = rint(floatValue * (double)(bPtr->columnCount - bPtr->maxVisibleColumns));
if (bPtr->firstVisibleColumn != newFirst)
scrollToColumn(bPtr, newFirst, False);

View File

@@ -301,7 +301,7 @@ static void showData(_Panel * panel)
WMSetSliderValue(panel->speedS, (accel - 0.25F) / 0.25F);
panel->acceleration = accel;
sprintf(buffer, "%.2f", accel);
sprintf(buffer, "%.2f", (double)accel);
WMSetTextFieldText(panel->acceT, buffer);
/**/ b = GetIntegerForKey("DoubleClickTime");