From c85a3c8f1d28929bb18afc72ec3abd3dd9ed4b7c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Oct 2008 15:35:58 +0200 Subject: [PATCH] store MPD_UPDATE_TIME as guint The glib function g_timeout_add() wants the interval as guint in milliseconds. Store the update interval in this form, instead of having to multiply MPD_UPDATE_TIME with 1000. --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 5c2d0e5..da9f553 100644 --- a/src/main.c +++ b/src/main.c @@ -40,7 +40,7 @@ #include /* time between mpd updates [s] */ -static const float MPD_UPDATE_TIME = 0.5; +static const guint update_interval = 500; #define BUFSIZE 1024 @@ -284,7 +284,7 @@ keyboard_event(mpd_unused GIOChannel *source, if (cmd == CMD_VOLUME_UP || cmd == CMD_VOLUME_DOWN) { /* make sure we dont update the volume yet */ g_source_remove(update_source_id); - update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000), + update_source_id = g_timeout_add(update_interval, timer_mpd_update, GINT_TO_POINTER(TRUE)); } @@ -433,7 +433,7 @@ main(int argc, const char *argv[]) /* attempt to connect */ reconnect_source_id = g_timeout_add(1, timer_reconnect, NULL); - update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000), + update_source_id = g_timeout_add(update_interval, timer_mpd_update, GINT_TO_POINTER(TRUE)); g_timeout_add(10000, timer_check_key_bindings, NULL); -- 2.30.2