X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fmain.c;h=f817c14aa451de9f801052362cf82f4f58a69091;hb=138f4d6a450e4ead5da85fdef006e48e906223d8;hp=e9ac03f43d57f3f555489f8da273ffb1ea8e0bac;hpb=24ab97d635e83e919877fed0763b7ddb24cbc3e1;p=psensor.git diff --git a/src/main.c b/src/main.c index e9ac03f..f817c14 100644 --- a/src/main.c +++ b/src/main.c @@ -44,6 +44,7 @@ #include "slog.h" #include "ui_pref.h" #include "ui_graph.h" +#include #include "ui_status.h" #ifdef HAVE_UNITY @@ -64,17 +65,13 @@ #include "ui_appindicator.h" -#ifdef HAVE_LIBNOTIFY -#include "ui_notify.h" -#endif - #ifdef HAVE_GTOP #include #endif static const char *program_name; -static void print_version() +static void print_version(void) { printf("psensor %s\n", VERSION); printf(_("Copyright (C) %s jeanfi@gmail.com\n" @@ -86,7 +83,7 @@ static void print_version() "2010-2014"); } -static void print_help() +static void print_help(void) { printf(_("Usage: %s [OPTION]...\n"), program_name); @@ -211,7 +208,7 @@ static void indicators_update(struct ui_psensor *ui) ui_status_update(ui, attention); } -gboolean ui_refresh_thread(gpointer data) +static gboolean ui_refresh_thread(gpointer data) { struct config *cfg; gboolean ret; @@ -251,10 +248,8 @@ gboolean ui_refresh_thread(gpointer data) static void cb_alarm_raised(struct psensor *sensor, void *data) { -#ifdef HAVE_LIBNOTIFY if (sensor->alarm_enabled) ui_notify(sensor, (struct ui_psensor *)data); -#endif notify_cmd(sensor); } @@ -347,13 +342,11 @@ static void associate_preferences(struct psensor **sensors) s->name = n; } - s->appindicator_enabled = config_is_appindicator_enabled(s->id); - sensor_cur++; } } -static void log_init() +static void log_init(void) { const char *dir; char *path; @@ -372,12 +365,12 @@ static void log_init() } static struct option long_options[] = { - {"version", no_argument, 0, 'v'}, - {"help", no_argument, 0, 'h'}, - {"url", required_argument, 0, 'u'}, - {"debug", required_argument, 0, 'd'}, - {"new-instance", no_argument, 0, 'n'}, - {0, 0, 0, 0} + {"version", no_argument, NULL, 'v'}, + {"help", no_argument, NULL, 'h'}, + {"url", required_argument, NULL, 'u'}, + {"debug", required_argument, NULL, 'd'}, + {"new-instance", no_argument, NULL, 'n'}, + {NULL, 0, NULL, 0} }; static gboolean initial_window_show(gpointer data) @@ -402,7 +395,7 @@ static gboolean initial_window_show(gpointer data) return FALSE; } -static void log_glib_info() +static void log_glib_info(void) { log_debug("Compiled with GLib %d.%d.%d", GLIB_MAJOR_VERSION,