diff options
author | David Robillard <d@drobilla.net> | 2020-12-16 16:49:57 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-16 16:49:57 +0100 |
commit | bbff4459368ea25f1ae1ee3452a5b5c5dcd64e06 (patch) | |
tree | efc1fb7fd89f9e36d34d15a94482706e5c445b0c /plugins/eg-scope.lv2/examploscope_ui.c | |
parent | 37ec8d59b349b9b735b58134a72e7372f36345dc (diff) | |
download | lv2-bbff4459368ea25f1ae1ee3452a5b5c5dcd64e06.tar.xz |
Isolate variable declarations and initialize all variables
Diffstat (limited to 'plugins/eg-scope.lv2/examploscope_ui.c')
-rw-r--r-- | plugins/eg-scope.lv2/examploscope_ui.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 33f1b0a..5e244af 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -193,8 +193,7 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data) const float gain = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_amp)); // Get cairo type for the gtk window - cairo_t* cr; - cr = gdk_cairo_create(ui->darea->window); + cairo_t* cr = gdk_cairo_create(ui->darea->window); // Limit cairo-drawing to exposed area cairo_rectangle(cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); @@ -392,9 +391,9 @@ update_scope(EgScopeUI* ui, return; } - uint32_t idx_start; // Display pixel start - uint32_t idx_end; // Display pixel end - int overflow; // Received more audio-data than display-pixel + uint32_t idx_start = 0; // Display pixel start + uint32_t idx_end = 0; // Display pixel end + int overflow = 0; // Received more audio-data than display-pixel // Process this channel's audio-data for display ScoChan* chn = &ui->chn[channel]; |