Address some compiler warnings.
authorAlexander Koenig <alex@lisas.de>
Thu, 16 Jun 2016 22:00:14 +0000 (00:00 +0200)
committerAlexander Koenig <alex@lisas.de>
Thu, 16 Jun 2016 22:00:14 +0000 (00:00 +0200)
src/tX_audiodevice.cc
src/tX_dialog.cc
src/tX_flash.c
src/tX_knobloader.c
src/tX_pbutton.cc

index 6e8223bc2b4665591e03af8dd58d5b1995992cb8..2f0168df6434d5010139f9f06dca69001937d5a2 100644 (file)
@@ -396,21 +396,28 @@ void tX_audiodevice_pulse::context_state_callback(pa_context *context) {
 
        tX_debug("pulseaudio context state: %i", state);
        switch (state) {
+               case PA_CONTEXT_UNCONNECTED:
+               case PA_CONTEXT_CONNECTING:
+               case PA_CONTEXT_AUTHORIZING:
+               case PA_CONTEXT_SETTING_NAME:
+                       break;
                case PA_CONTEXT_FAILED:
                case PA_CONTEXT_TERMINATED:
-                       tX_error("pulseaudio disconnected");
+                       if (!engine->is_stopped()) {
+                               tX_error("pulseaudio disconnected");
+                       }
                        break;
 
                case PA_CONTEXT_READY:
                        pa_sample_spec spec = {
                                .format = PA_SAMPLE_S16LE,
                                .rate = 44100,
-                               .channels = 2
+                               .channels = 2
                        };
        
                        pa_buffer_attr attr = {
                                .maxlength = (uint32_t) -1,
-                               .tlength = globals.pulse_buffer_length * 4, // 2 bytes per sample, 2 channels
+                               .tlength = (uint32_t) (globals.pulse_buffer_length * 4), // 2 bytes per sample, 2 channels
                                .prebuf = (uint32_t) -1,
                                .minreq = (uint32_t) -1,
                                .fragsize = (uint32_t) -1
@@ -418,7 +425,7 @@ void tX_audiodevice_pulse::context_state_callback(pa_context *context) {
 
                        pa_stream_flags_t flags = PA_STREAM_ADJUST_LATENCY;
 
-                       if (stream = pa_stream_new(context, "terminatorX", &spec, NULL)) {
+                       if ((stream = pa_stream_new(context, "terminatorX", &spec, NULL))) {
                                tX_debug("pulseaudio stream created");
                                //pa_stream_set_started_callback(stream, tX_audiodevice_pulse::wrap_stream_started_callback, this);
                                //pa_stream_set_underflow_callback(stream, tX_audiodevice_pulse::wrap_stream_underflow_callback, this);
@@ -434,7 +441,7 @@ void tX_audiodevice_pulse::context_state_callback(pa_context *context) {
                        }       else {
                                tX_error("Failed to create pulseaudio stream: %s", pa_strerror(pa_context_errno(context)));
                        }
-
+                       break;
        }
 }
 
index 2baf1bdc29014332eed43738aab28f07bf559d16..b5b0b1d91785106604e80d33d1dbbb89db4dcc43 100644 (file)
@@ -712,7 +712,7 @@ void tX_set_icon(GtkWidget *widget)
 {      
        if (!tX_window_icon) {
                GError *error = NULL;
-               GResource* resource = g_resource_new_from_data(g_bytes_new_static(tX_dialog_resource_data.data, sizeof(tX_dialog_resource_data.data)), &error);
+               g_resource_new_from_data(g_bytes_new_static(tX_dialog_resource_data.data, sizeof(tX_dialog_resource_data.data)), &error);
                if (error) {
                    tX_error("Error accesing tX_dialog resources: %s", error->message);
                }
index 0f8ac634e4d5b9511bf2fd8878408c451bafe1c1..f69cf0813ab3af7313a90e3f031df3d87357e24c 100644 (file)
@@ -169,7 +169,6 @@ static void gtk_tx_flash_realize (GtkWidget *widget)
 {
        GtkTxFlash *tx_flash;
        GdkWindowAttr attributes;
-       GtkStyleContext *context;
        gint attributes_mask;
        
        g_return_if_fail (widget != NULL);
@@ -196,8 +195,6 @@ static void gtk_tx_flash_realize (GtkWidget *widget)
        
        gdk_window_set_user_data (gtk_widget_get_window(widget), widget);
        
-       context = gtk_widget_get_style_context(widget);
-       
        if (tx_flash->surface) {
                cairo_surface_destroy (tx_flash->surface);
        }
index 9991b67859ea6639f4b53c40b2f3e806da6e2a40..20499d85383883b2e508d4ab4d9d5da91c536911 100644 (file)
@@ -35,7 +35,7 @@ void load_knob_pixs(int fontHeight, int scaleFactor)
        int i;
        GError *error = NULL;
 
-       GResource* resource = g_resource_new_from_data(g_bytes_new_static(tX_knob_resource_data.data, sizeof(tX_knob_resource_data.data)), &error);
+       g_resource_new_from_data(g_bytes_new_static(tX_knob_resource_data.data, sizeof(tX_knob_resource_data.data)), &error);
        if (error) {
            tX_error("failed accessing tX_dial resources: %s\n", error->message);
        }
index 12b62af82cc0a066388ed4c4094d81506dc9d748..aef85a8b86900c8451a4dc884c57bd1a54097c53 100644 (file)
@@ -41,7 +41,7 @@ void tx_icons_init(int size)
        tx_icon_size=size;
 
        GError *error = NULL;
-       GResource* resource = g_resource_new_from_data(g_bytes_new_static(tX_icons_resource_data.data, sizeof(tX_icons_resource_data.data)), &error);
+       g_resource_new_from_data(g_bytes_new_static(tX_icons_resource_data.data, sizeof(tX_icons_resource_data.data)), &error);
        if (error) {
          tX_error("failed accessing tX_icons resources: %s", error->message);
        }