resolve certain double/float comparisons in with increased correctness
ref 03d0f1d2dc
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
parent
dda64c8f12
commit
6f1f165d32
|
@ -809,7 +809,7 @@ e_bindings_edge_get(const char *action, E_Zone_Edge edge, int click)
|
|||
EINA_LIST_FOREACH(edge_bindings, l, binding)
|
||||
{
|
||||
if ((binding->edge == edge) &&
|
||||
((click && EINA_DBL_CMP(binding->delay, -1.0 * click))
|
||||
((click && EINA_FLT_CMP(binding->delay, -1.0 * click))
|
||||
|| (!click && (binding->delay >= 0.0))) &&
|
||||
(binding->action) && (action) &&
|
||||
(!strcmp(action, binding->action)))
|
||||
|
|
|
@ -80,21 +80,21 @@ popup_update(Instance *inst)
|
|||
snprintf(buf, sizeof(buf), _("Longitude: %f"), inst->longitude);
|
||||
e_widget_label_text_set(inst->popup_longitude, buf);
|
||||
|
||||
if (inst->altitude <= -DBL_MAX)
|
||||
if (eina_dbleq(inst->altitude, -DBL_MAX))
|
||||
snprintf(buf, sizeof(buf), _("Altitude: %f"), inst->altitude);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Altitude: N/A"));
|
||||
|
||||
e_widget_label_text_set(inst->popup_altitude, buf);
|
||||
|
||||
if (inst->speed <= -1.0)
|
||||
if (eina_dbleq(inst->speed, -1.0))
|
||||
snprintf(buf, sizeof(buf), _("Speed: %f"), inst->speed);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Speed: N/A"));
|
||||
|
||||
e_widget_label_text_set(inst->popup_speed, buf);
|
||||
|
||||
if (inst->heading <= -1.0)
|
||||
if (eina_dbleq(inst->heading, -1.0))
|
||||
snprintf(buf, sizeof(buf), _("Heading: %f"), inst->heading);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Heading: N/A"));
|
||||
|
@ -146,7 +146,7 @@ popup_new(Instance *inst)
|
|||
inst->popup_longitude = e_widget_label_add(evas, buf);
|
||||
e_widget_list_object_append(list, inst->popup_longitude, 1, 1, 0.5);
|
||||
|
||||
if (inst->altitude <= -DBL_MAX)
|
||||
if (eina_dbleq(inst->altitude, -DBL_MAX))
|
||||
snprintf(buf, sizeof(buf), _("Altitude: %f"), inst->altitude);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Altitude: N/A"));
|
||||
|
@ -154,7 +154,7 @@ popup_new(Instance *inst)
|
|||
inst->popup_altitude = e_widget_label_add(evas, buf);
|
||||
e_widget_list_object_append(list, inst->popup_altitude, 1, 1, 0.5);
|
||||
|
||||
if (inst->speed <= -1.0)
|
||||
if (eina_dbleq(inst->speed, -1.0))
|
||||
snprintf(buf, sizeof(buf), _("Speed: %f"), inst->speed);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Speed: N/A"));
|
||||
|
@ -162,7 +162,7 @@ popup_new(Instance *inst)
|
|||
inst->popup_speed = e_widget_label_add(evas, buf);
|
||||
e_widget_list_object_append(list, inst->popup_speed, 1, 1, 0.5);
|
||||
|
||||
if (inst->heading <= -1.0)
|
||||
if (eina_dbleq(inst->heading, -1.0))
|
||||
snprintf(buf, sizeof(buf), _("Heading: %f"), inst->heading);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), _("Heading: N/A"));
|
||||
|
|
|
@ -997,7 +997,7 @@ _move_or_resize(E_Client *ec)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if ((!EINA_DBL_CMP(w_diff, 1.0)) || (!EINA_DBL_CMP(h_diff, 1.0)))
|
||||
if ((!eina_dbleq(w_diff, 1.0)) || (!eina_dbleq(h_diff, 1.0)))
|
||||
{
|
||||
if (!tiling_window_tree_node_resize(item, w_dir, w_diff, h_dir,
|
||||
h_diff))
|
||||
|
|
|
@ -457,7 +457,7 @@ tiling_window_tree_node_resize(Window_Tree *node, int w_dir, double w_diff,
|
|||
h_parent = parent;
|
||||
}
|
||||
|
||||
if ((!EINA_DBL_CMP(h_diff, 1.0)) && h_parent)
|
||||
if ((!eina_dbleq(h_diff, 1.0)) && h_parent)
|
||||
{
|
||||
Window_Tree *tmp_node = (h_parent == parent) ? node : parent;
|
||||
|
||||
|
@ -466,7 +466,7 @@ tiling_window_tree_node_resize(Window_Tree *node, int w_dir, double w_diff,
|
|||
h_diff, h_dir);
|
||||
}
|
||||
|
||||
if ((!EINA_DBL_CMP(w_diff, 1.0)) && w_parent)
|
||||
if ((!eina_dbleq(w_diff, 1.0)) && w_parent)
|
||||
{
|
||||
Window_Tree *tmp_node = (w_parent == parent) ? node : parent;
|
||||
|
||||
|
|
Loading…
Reference in New Issue