mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +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:
committed by
Carlos R. Mafra
parent
79a95d7173
commit
d28edde23e
@@ -591,7 +591,7 @@ void WMSetUDFloatForKey(WMUserDefaults * database, float value, const char *defa
|
|||||||
WMPropList *object;
|
WMPropList *object;
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
|
|
||||||
sprintf(buffer, "%f", value);
|
sprintf(buffer, "%f", (double)value);
|
||||||
object = WMCreatePLString(buffer);
|
object = WMCreatePLString(buffer);
|
||||||
|
|
||||||
WMSetUDObjectForKey(database, object, defaultName);
|
WMSetUDObjectForKey(database, object, defaultName);
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ static void scrollCallback(WMWidget * scroller, void *self)
|
|||||||
|
|
||||||
floatValue = (floatValue * value) / value;
|
floatValue = (floatValue * value) / value;
|
||||||
|
|
||||||
newFirst = rint(floatValue * (float)(bPtr->columnCount - bPtr->maxVisibleColumns));
|
newFirst = rint(floatValue * (double)(bPtr->columnCount - bPtr->maxVisibleColumns));
|
||||||
|
|
||||||
if (bPtr->firstVisibleColumn != newFirst)
|
if (bPtr->firstVisibleColumn != newFirst)
|
||||||
scrollToColumn(bPtr, newFirst, False);
|
scrollToColumn(bPtr, newFirst, False);
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ static void showData(_Panel * panel)
|
|||||||
WMSetSliderValue(panel->speedS, (accel - 0.25F) / 0.25F);
|
WMSetSliderValue(panel->speedS, (accel - 0.25F) / 0.25F);
|
||||||
|
|
||||||
panel->acceleration = accel;
|
panel->acceleration = accel;
|
||||||
sprintf(buffer, "%.2f", accel);
|
sprintf(buffer, "%.2f", (double)accel);
|
||||||
WMSetTextFieldText(panel->acceT, buffer);
|
WMSetTextFieldText(panel->acceT, buffer);
|
||||||
|
|
||||||
/**/ b = GetIntegerForKey("DoubleClickTime");
|
/**/ b = GetIntegerForKey("DoubleClickTime");
|
||||||
|
|||||||
Reference in New Issue
Block a user