From c4e740ea7144023507e9b5fe1ad28ccfd96c8ff1 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Sun, 8 Dec 2024 22:11:27 +0530 Subject: [PATCH] minor refactoring --- discovery.c | 5 ++--- protocols.c | 2 +- radio.c | 3 ++- radio.h | 2 +- rust/Cargo.lock | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/discovery.c b/discovery.c index f7d0943..6595458 100644 --- a/discovery.c +++ b/discovery.c @@ -105,9 +105,8 @@ void discovery(void) { // TODO: exit? } - if(d->status == STATE_AVAILABLE) { - radio=(DISCOVERED *)d; - start_radio(); + if(d != NULL && d->status == STATE_AVAILABLE) { + start_radio(d); } } } diff --git a/protocols.c b/protocols.c index 0b23f8b..6cf4159 100644 --- a/protocols.c +++ b/protocols.c @@ -52,7 +52,7 @@ void protocols_save_state() { } -void protocols_restore_state() { +void protocols_restore_state(void) { char *value; loadProperties("protocols.props"); diff --git a/radio.c b/radio.c index 6fcb8f3..8fe112a 100644 --- a/radio.c +++ b/radio.c @@ -708,11 +708,12 @@ static void create_visual() { gtk_widget_show_all(top_window); } -void start_radio() { +void start_radio(DISCOVERED *d) { int i; gdk_window_set_cursor(gtk_widget_get_window(top_window), gdk_cursor_new(GDK_WATCH)); + radio = d; protocol = radio->protocol; device = radio->device; diff --git a/radio.h b/radio.h index 2cc368a..5477a7a 100644 --- a/radio.h +++ b/radio.h @@ -331,7 +331,7 @@ extern gboolean server; extern void radio_stop(); extern void reconfigure_radio(); -extern void start_radio(); +extern void start_radio(DISCOVERED *); //extern void init_radio(); extern void radio_change_receivers(int r); extern void radio_change_sample_rate(int rate); diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3840937..1a59e17 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -364,6 +364,10 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "property" +version = "0.1.0" + [[package]] name = "quote" version = "1.0.37" -- 2.45.2