gnome-power-manager r2941 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r2941 - in trunk: . src
- Date: Tue, 9 Sep 2008 07:22:18 +0000 (UTC)
Author: rhughes
Date: Tue Sep 9 07:22:18 2008
New Revision: 2941
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2941&view=rev
Log:
2008-09-09 Richard Hughes <richard hughsie com>
* src/gpm-common.c:
* src/gpm-common.h:
* src/gpm-profile.c: (gpm_exponential_average):
gpm_exponential_average() is only used in one place, move it out
of -common.[c|h]
Modified:
trunk/ChangeLog
trunk/src/gpm-common.c
trunk/src/gpm-common.h
trunk/src/gpm-profile.c
Modified: trunk/src/gpm-common.c
==============================================================================
--- trunk/src/gpm-common.c (original)
+++ trunk/src/gpm-common.c Tue Sep 9 07:22:18 2008
@@ -31,34 +31,6 @@
#include "gpm-common.h"
/**
- * gpm_exponential_average:
- * @previous: The old value
- * @new: The new value
- * @slew: The slew rate as a percentage
- *
- * We should do an exponentially weighted average so that high frequency
- * changes are smoothed. This should mean the output does not change
- * drastically between updates.
- **/
-gint
-gpm_exponential_average (gint previous, gint new, guint slew)
-{
- gint result = 0;
- gfloat factor = 0;
- gfloat factor_inv = 1;
- if (previous == 0 || slew == 0) {
- /* startup, or re-initialization - we have no data */
- egg_debug ("Quoting output with only one value...");
- result = new;
- } else {
- factor = (gfloat) slew / 100.0f;
- factor_inv = 1.0f - factor;
- result = (gint) ((factor_inv * (gfloat) new) + (factor * (gfloat) previous));
- }
- return result;
-}
-
-/**
* gpm_get_timestring:
* @time_secs: The time value to convert in seconds
* @cookie: The cookie we are looking for
Modified: trunk/src/gpm-common.h
==============================================================================
--- trunk/src/gpm-common.h (original)
+++ trunk/src/gpm-common.h Tue Sep 9 07:22:18 2008
@@ -57,9 +57,6 @@
} GpmIconPolicy;
gchar *gpm_get_timestring (guint time);
-gint gpm_exponential_average (gint previous,
- gint new,
- guint slew);
GpmIconPolicy gpm_tray_icon_mode_from_string (const gchar *mode);
const gchar *gpm_tray_icon_mode_to_string (GpmIconPolicy mode);
void gpm_help_display (char *link_id);
Modified: trunk/src/gpm-profile.c
==============================================================================
--- trunk/src/gpm-profile.c (original)
+++ trunk/src/gpm-profile.c Tue Sep 9 07:22:18 2008
@@ -423,6 +423,34 @@
}
/**
+ * gpm_exponential_average:
+ * @previous: The old value
+ * @new: The new value
+ * @slew: The slew rate as a percentage
+ *
+ * We should do an exponentially weighted average so that high frequency
+ * changes are smoothed. This should mean the output does not change
+ * drastically between updates.
+ **/
+static gint
+gpm_exponential_average (gint previous, gint new, guint slew)
+{
+ gint result = 0;
+ gfloat factor = 0;
+ gfloat factor_inv = 1;
+ if (previous == 0 || slew == 0) {
+ /* startup, or re-initialization - we have no data */
+ egg_debug ("Quoting output with only one value...");
+ result = new;
+ } else {
+ factor = (gfloat) slew / 100.0f;
+ factor_inv = 1.0f - factor;
+ result = (gint) ((factor_inv * (gfloat) new) + (factor * (gfloat) previous));
+ }
+ return result;
+}
+
+/**
* gpm_profile_save_percentage:
*
* @profile: This class
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]