summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2015-05-11 13:31:21 +0200
committerSebastian Dransfeld <sd@tango.flipp.net>2015-05-11 13:34:10 +0200
commit9e0a00d768b90917a0b190420c65db8d4c640ed2 (patch)
tree66b9d62ea6150c914c85081cc32c6ed39460876d /src/lib/efreet
parent3433c1449e69bcc3701dd1ca204d5d4d2ba3853e (diff)
efreet: fix signed warning
Update to 6a0d23. Casting to int isn't a real solution, since we could have values which overflows. Since we want the absolute value, just make sure we subtract the larger value from the smaller.
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_icon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_icon.c b/src/lib/efreet/efreet_icon.c
index 89e87f015b..3cb7f5c8f5 100644
--- a/src/lib/efreet/efreet_icon.c
+++ b/src/lib/efreet/efreet_icon.c
@@ -612,7 +612,10 @@ static double
612efreet_icon_size_distance(Efreet_Cache_Icon_Element *elem, unsigned int size) 612efreet_icon_size_distance(Efreet_Cache_Icon_Element *elem, unsigned int size)
613{ 613{
614 if (elem->type == EFREET_ICON_SIZE_TYPE_FIXED) 614 if (elem->type == EFREET_ICON_SIZE_TYPE_FIXED)
615 return (abs((int) elem->normal - (int) size)); 615 {
616 if (elem->normal > size) return elem->normal - size;
617 else return size - elem->normal;
618 }
616 619
617 if ((elem->type == EFREET_ICON_SIZE_TYPE_SCALABLE) || 620 if ((elem->type == EFREET_ICON_SIZE_TYPE_SCALABLE) ||
618 (elem->type == EFREET_ICON_SIZE_TYPE_THRESHOLD)) 621 (elem->type == EFREET_ICON_SIZE_TYPE_THRESHOLD))