diff options
author | Bastien Nocera <hadess@hadess.net> | 2011-09-07 15:57:01 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2011-09-07 15:57:01 +0100 |
commit | 7742a3bc9619eb79fdf212ab835c2b706ef7e856 (patch) | |
tree | a0bb4a07e85cbe2cfd57ec843c2f754d8d25961f | |
parent | 34bf5fc0136e15e7a70d36c6573d3606502a275e (diff) | |
download | gnome-settings-daemon-7742a3bc9619eb79fdf212ab835c2b706ef7e856.tar.gz |
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.
-rw-r--r-- | 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 c6aef22e..a67c9981 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)) |