aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Čerman2019-10-12 20:53:25 +0200
committerOndrej Čerman2019-10-12 20:53:25 +0200
commite409f26106b4a60a64a122e1cb5884360c2cca34 (patch)
tree5f751b4e1c5a5a47a04eec7b11979dfd375fda6d
parent9795d0c5b8f6cbc0bace0d6b819cbad705f71f10 (diff)
Removed unused variables + added static keywords
-rw-r--r--src/gui.c4
-rw-r--r--src/ss/msr.c16
-rw-r--r--src/ss/zenpower.c3
3 files changed, 8 insertions, 15 deletions
diff --git a/src/gui.c b/src/gui.c
index 0a01392..a523bc1 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -23,7 +23,6 @@ static void init_sensors() {
GtkListStore *store;
SensorSource *source;
const SensorInit *data;
- gboolean added;
guint i = 0;
store = GTK_LIST_STORE(model);
@@ -69,7 +68,6 @@ static void set_list_column_value(float num, const gchar *printf_format, GtkTree
static gboolean update_data (gpointer data) {
GtkTreeIter iter;
- guint number;
GSList *node;
SensorSource *source;
const SensorInit *sensorData;
@@ -106,7 +104,6 @@ static gboolean update_data (gpointer data) {
static void add_columns (GtkTreeView *treeview) {
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
- GtkTreeModel *model = gtk_tree_view_get_model (treeview);
// NAME
renderer = gtk_cell_renderer_text_new ();
@@ -160,7 +157,6 @@ static void about_btn_clicked(GtkButton *button, gpointer user_data) {
static void clear_btn_clicked(GtkButton *button, gpointer user_data) {
SensorSource *source;
- const SensorInit *sensorData;
for (source = sensor_sources; source->drv; source++) {
if (!source->enabled)
diff --git a/src/ss/msr.c b/src/ss/msr.c
index aeca262..5703a1d 100644
--- a/src/ss/msr.c
+++ b/src/ss/msr.c
@@ -14,15 +14,15 @@
// AMD PPR = https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf
// AMD OSRR = https://developer.amd.com/wp-content/resources/56255_3_03.PDF
-guint cores = 0;
-gdouble energy_unit = 0;
+static guint cores = 0;
+static gdouble energy_unit = 0;
-gint *msr_files = NULL;
+static gint *msr_files = NULL;
-gulong package_eng_b = 0;
-gulong package_eng_a = 0;
-gulong *core_eng_b = NULL;
-gulong *core_eng_a = NULL;
+static gulong package_eng_b = 0;
+static gulong package_eng_a = 0;
+static gulong *core_eng_b = NULL;
+static gulong *core_eng_a = NULL;
gfloat package_power;
gfloat package_power_min;
@@ -75,7 +75,6 @@ gulong get_core_energy(gint core) {
gboolean msr_init() {
gshort *cpu_dev_ids = NULL;
int i;
- size_t sz;
if (!check_zen())
return FALSE;
@@ -111,7 +110,6 @@ gboolean msr_init() {
}
void msr_update() {
- GSList *list = NULL;
gint i;
package_eng_b = get_package_energy();
diff --git a/src/ss/zenpower.c b/src/ss/zenpower.c
index 57a9960..f44565a 100644
--- a/src/ss/zenpower.c
+++ b/src/ss/zenpower.c
@@ -73,8 +73,7 @@ gboolean zenpower_init() {
const gchar *entry;
gchar *name = NULL;
HwmonSensorType *type;
- HwmonSensor *sensor;
-
+
hwmon = g_dir_open("/sys/class/hwmon", 0, NULL);
if (!hwmon)
return FALSE;