summaryrefslogtreecommitdiff
path: root/gtk2_ardour/gtk_pianokeyboard.c
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2016-02-21 21:54:31 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:11:02 -0500
commitad35ab78ebafdf5fe82ad05f31476d4fa23fcb77 (patch)
treedd4d41bf848601f1c0e129bd0a749221214878ed /gtk2_ardour/gtk_pianokeyboard.c
parent1afbdaff58ac2b45ebf1ea046ff5a4d79b98be74 (diff)
Fix compilation warnings. (gtk2_ardour part)
Diffstat (limited to 'gtk2_ardour/gtk_pianokeyboard.c')
-rw-r--r--gtk2_ardour/gtk_pianokeyboard.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c
index 8917017960..1b628acd59 100644
--- a/gtk2_ardour/gtk_pianokeyboard.c
+++ b/gtk2_ardour/gtk_pianokeyboard.c
@@ -247,11 +247,11 @@ key_binding(PianoKeyboard *pk, const char *key)
}
static void
-bind_key(PianoKeyboard *pk, const char *key, int note)
+bind_key(PianoKeyboard *pk, char *key, int note)
{
assert(pk->key_bindings != NULL);
- g_hash_table_insert(pk->key_bindings, (const gpointer)key, (gpointer)((intptr_t)note));
+ g_hash_table_insert(pk->key_bindings, (gpointer)key, (gpointer)((intptr_t)note));
}
static void
@@ -686,7 +686,12 @@ piano_keyboard_new(void)
pk->note_being_pressed_using_mouse = -1;
pk->last_key = 0;
pk->monophonic = FALSE;
- memset((void *)pk->notes, 0, sizeof(struct PKNote) * NNOTES);
+
+ /* Avoiding memset due to pk->notes being volatile. */
+ for (int i = 0; i<sizeof(struct PKNote)*NNOTES; i++) {
+ ((volatile int*)pk->notes)[i] = 0;
+ }
+
pk->key_bindings = g_hash_table_new(g_str_hash, g_str_equal);
bind_keys_qwerty(pk);