From 93b76533735fc1d9fd666787acd65db8507d9119 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 1 Sep 2015 18:01:53 +1200 Subject: Enforced staticness --- TODO.md | 8 +------- bat_tray.c | 4 ++-- common.c | 1 - defaults.c | 8 -------- getcore.c | 3 +-- getfreq.c | 4 ++-- getgov.c | 4 ++-- 7 files changed, 8 insertions(+), 24 deletions(-) diff --git a/TODO.md b/TODO.md index 7e46b42..a20649d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,19 +1,13 @@ To do ===== -High Priority -------------- -* Make tooltip strings cached - Normal Priority --------------- -* Remove some calls to debug, replace with assertions * Remove all calls to asprintf, replace with snprintf * Get rid of various magic numbers * Sniff for memory leaks -* Investigate shared library rather than calling paramano-set Low Priority ------------ -* Ensure all is aligns to an explicit style +* Ensure all code aligns to an explicit style * Make a curses-based version of paramano diff --git a/bat_tray.c b/bat_tray.c index 3480a75..8e9997e 100644 --- a/bat_tray.c +++ b/bat_tray.c @@ -21,8 +21,8 @@ static GtkStatusIcon* tray; static char tooltip_text[1024]; -int bat_num; // Shortcoming: we only detect one battery -char *CHARGE_VALUE_PATH, *CHARGE_STATE_PATH; +static int bat_num; // Shortcoming: we only detect one battery +static char *CHARGE_VALUE_PATH, *CHARGE_STATE_PATH; /*********************************************************************** * Return the battery level percentage diff --git a/common.c b/common.c index b7e661f..d1be19b 100644 --- a/common.c +++ b/common.c @@ -20,7 +20,6 @@ #include - /*********************************************************************** * Return integer value from first line in file (formatted filename) **********************************************************************/ diff --git a/defaults.c b/defaults.c index 5bd25e7..23a662c 100644 --- a/defaults.c +++ b/defaults.c @@ -18,14 +18,6 @@ #include "paramano.h" -/*char* DEFAULT_GOV; -char* DEFAULT_FREQ; -char* DEFAULT_PROG; -char* DEFAULT_BAT_GOV; -char* DEFAULT_AC_GOV; -bool DEFAULT_SHOW_BATTERY = true; -char* DEFAULT_THEME;*/ - void defaults_init() { DEFAULT_GOV = NULL; diff --git a/getcore.c b/getcore.c index 2624c34..4c7bd32 100644 --- a/getcore.c +++ b/getcore.c @@ -18,8 +18,7 @@ #include "paramano.h" -unsigned int cores; - +static unsigned int cores; /*********************************************************************** * Return true/false if specified core num exists diff --git a/getfreq.c b/getfreq.c index c5a92bc..c655ffd 100644 --- a/getfreq.c +++ b/getfreq.c @@ -22,8 +22,8 @@ #define MAX_FREQS 50 #define FREQ_LENGTH 14 -char freqs[MAX_CORES][MAX_FREQS][FREQ_LENGTH]; -int total_freqs; // Number of freqs for core 0 +static char freqs[MAX_CORES][MAX_FREQS][FREQ_LENGTH]; +static int total_freqs; // Number of freqs for core 0 /*********************************************************************** diff --git a/getgov.c b/getgov.c index 68732a8..e86f7fd 100644 --- a/getgov.c +++ b/getgov.c @@ -19,8 +19,8 @@ #include "paramano.h" /* [CORE][GOVERNOR NUMBER] */ -char governors[999][50][13]; -int total_governors; +static char governors[999][50][13]; +static int total_governors; /*********************************************************************** * Grab all available governors -- cgit v1.1