Merge lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517 into lp:ubuntu/oneiric/gnome-settings-daemon

Proposed by Kamal Mostafa
Status: Merged
Merge reported by: Luke Yelavich
Merged at revision: not available
Proposed branch: lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517
Merge into: lp:ubuntu/oneiric/gnome-settings-daemon
Diff against target: 46 lines (+26/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/50_fix_brightness_step.patch (+18/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+71784@code.launchpad.net

Description of the change

The BRIGHTNESS_STEP_AMOUNT macro calculates a bogus value when called
as BRIGHTNESS_STEP_AMOUNT(max - min + 1) due to missing parentheses.

This simple patch fixes the macro.

To post a comment you must log in.
Revision history for this message
Jani Monoses (jani) wrote :

Hello, was this fix submitted upstream?

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

Hi Jani- No, I have not submitted it upstream. I'd be grateful if the Ubuntu gnome3 folks would submit it on my behalf; if that's not possible I will submit it, but please don't hold off applying this obvious and necessary fix to Ubuntu -- we need this fix in Oneiric (see bugs 827517 and 568611).

Revision history for this message
Luke Yelavich (themuso) wrote :

Merged in the lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu packaging branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-08-16 10:31:48 +0000
+++ debian/changelog 2011-08-16 22:16:25 +0000
@@ -1,3 +1,10 @@
1gnome-settings-daemon (3.1.5-0ubuntu2) oneiric; urgency=low
2
3 * debian/patches/50_fix_brightness_step.patch
4 - fix the broken BRIGHTNESS_STEP_AMOUNT macro (LP: #827517)
5
6 -- Kamal Mostafa <kamal@canonical.com> Mon, 15 Aug 2011 16:50:45 -0700
7
1gnome-settings-daemon (3.1.5-0ubuntu1) oneiric; urgency=low8gnome-settings-daemon (3.1.5-0ubuntu1) oneiric; urgency=low
29
3 * New upstream release10 * New upstream release
411
=== added file 'debian/patches/50_fix_brightness_step.patch'
--- debian/patches/50_fix_brightness_step.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/50_fix_brightness_step.patch 2011-08-16 22:16:25 +0000
@@ -0,0 +1,18 @@
1Description: fix BRIGHTESS_STEP_AMOUNT calculation macro
2Author: Kamal Mostafa <kamal@canonical.com>
3Bug-Ubuntu: https://launchpad.net/bugs/827517
4
5The BRIGHTNESS_STEP_AMOUNT macro calculates a bogus value when called
6as BRIGHTNESS_STEP_AMOUNT(max - min + 1) due to missing parentheses.
7
8--- gnome-settings-daemon-3.1.4.orig/plugins/power/gsd-power-manager.c
9+++ gnome-settings-daemon-3.1.4/plugins/power/gsd-power-manager.c
10@@ -121,7 +121,7 @@ static const gchar introspection_xml[] =
11 "</node>";
12
13 /* on ACPI machines we have 4-16 levels, on others it's ~150 */
14-#define BRIGHTNESS_STEP_AMOUNT(max) (max < 20 ? 1 : max / 20)
15+#define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20)
16
17 /* take a discrete value with offset and convert to percentage */
18 #define ABS_TO_PERCENTAGE(min, max, value) (((value - min) * 100) / (max - min))
019
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-08-15 10:14:05 +0000
+++ debian/patches/series 2011-08-16 22:16:25 +0000
@@ -6,3 +6,4 @@
640_xres_lcddefault.patch640_xres_lcddefault.patch
742_onlyshowin_unity.patch742_onlyshowin_unity.patch
843_disable_locale_settings.patch843_disable_locale_settings.patch
950_fix_brightness_step.patch

Subscribers

People subscribed via source and target branches

to all changes: