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 authored and Carlos R. Mafra committed 2015-05-24 23:25:57 +01:00
1 parent 79a95d7173
commit d28edde23e
3 files changed
+3 -3

No files matched your search

+1 -1
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);
+1 -1
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);
+1 -1
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");