gnome-power-manager r3253 - in branches/gnome-2-24: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3253 - in branches/gnome-2-24: . src
- Date: Thu, 12 Feb 2009 11:54:22 +0000 (UTC)
Author: rhughes
Date: Thu Feb 12 11:54:22 2009
New Revision: 3253
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3253&view=rev
Log:
2009-02-12 Josselin Mouette <joss malsain org>
* src/gpm-brightness-xrandr.c:
(gpm_brightness_xrandr_output_get_internal):
Use memcpy instead of casting a char* to an int* without
alignment guarantees.
Fixes #566115 (fails to build on sparc)
2009-02-12 Richard Hughes <richard hughsie com>
* configure.ac:
Add Wno-strict-aliasing to fix the compile thanks to GCC 4.4
* src/gpm-brightness-xrandr.c: (gpm_brightness_xrandr_output_set):
Don't step through each brightness state when we fade modes, some
devices using XRandR have an insane number of steps. Use the step
value we calculated for the _up and _down logic.
Fixes #566095
Modified:
branches/gnome-2-24/ChangeLog
branches/gnome-2-24/configure.ac
branches/gnome-2-24/src/gpm-brightness-xrandr.c
Modified: branches/gnome-2-24/configure.ac
==============================================================================
--- branches/gnome-2-24/configure.ac (original)
+++ branches/gnome-2-24/configure.ac Thu Feb 12 11:54:22 2009
@@ -23,7 +23,7 @@
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
- CPPFLAGS="$CPPFLAGS -Wall -Wformat-security"
+ CPPFLAGS="$CPPFLAGS -Wall -Wformat-security -Wno-strict-aliasing"
fi
dnl ---------------------------------------------------------------------------
Modified: branches/gnome-2-24/src/gpm-brightness-xrandr.c
==============================================================================
--- branches/gnome-2-24/src/gpm-brightness-xrandr.c (original)
+++ branches/gnome-2-24/src/gpm-brightness-xrandr.c Thu Feb 12 11:54:22 2009
@@ -101,7 +101,7 @@
return FALSE;
}
if (actual_type == XA_INTEGER && nitems == 1 && actual_format == 32) {
- *cur = *((int *) prop);
+ memcpy (cur, prop, sizeof (guint));
ret = TRUE;
}
XFree (prop);
@@ -309,6 +309,7 @@
guint min, max;
gint i;
gint shared_value_abs;
+ guint step;
g_return_val_if_fail (GPM_IS_BRIGHTNESS_XRANDR (brightness), FALSE);
@@ -336,8 +337,13 @@
/* step the correct way */
if (cur < shared_value_abs) {
+
+ /* some adaptors have a large number of steps */
+ step = gpm_brightness_get_step (shared_value_abs - cur);
+ egg_debug ("using step of %i", step);
+
/* going up */
- for (i=cur; i<=shared_value_abs; i++) {
+ for (i=cur; i<=shared_value_abs; i+=step) {
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
if (!ret) {
break;
@@ -347,8 +353,13 @@
}
}
} else {
+
+ /* some adaptors have a large number of steps */
+ step = gpm_brightness_get_step (cur - shared_value_abs);
+ egg_debug ("using step of %i", step);
+
/* going down */
- for (i=cur; i>=shared_value_abs; i--) {
+ for (i=cur; i>=shared_value_abs; i-=step) {
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
if (!ret) {
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]