[gnome-settings-daemon] Revert "power: Guard against dividing by 0 in ABS_TO_PERCENTAGE macro"
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] Revert "power: Guard against dividing by 0 in ABS_TO_PERCENTAGE macro"
- Date: Wed, 7 Sep 2011 15:46:29 +0000 (UTC)
commit 7742a3bc9619eb79fdf212ab835c2b706ef7e856
Author: Bastien Nocera <hadess hadess net>
Date: Wed Sep 7 15:57:01 2011 +0100
Revert "power: Guard against dividing by 0 in ABS_TO_PERCENTAGE macro"
This reverts commit fcd4e082cc1528b633b7d07732adb2921d244ab8.
This is the wrong fix, as we have gnome-desktop or the backlight
helper giving us back garbage. We want to fix that, not work-around
the problem with sticky tape.
plugins/power/gsd-power-manager.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c6aef22..a67c998 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -126,7 +126,7 @@ static const gchar introspection_xml[] =
#define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20)
/* take a discrete value with offset and convert to percentage */
-#define ABS_TO_PERCENTAGE(min, max, value) (((value - min) * 100) / ((max - min) ? (max - min) : 1))
+#define ABS_TO_PERCENTAGE(min, max, value) (((value - min) * 100) / (max - min))
#define PERCENTAGE_TO_ABS(min, max, value) (min + (((max - min) * value) / 100))
#define GSD_POWER_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_POWER_MANAGER, GsdPowerManagerPrivate))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]