X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fgtk_pianokeyboard.c;h=96742d74622ae94e8a963a7900da82c7af15afab;hb=79731a716deae9a90be646695480f06f92c268f5;hp=4f8d0db693f26a9be84e6362adb27b9051d1530f;hpb=6054d72c1bcb94618f10a40e5c820f55149de4b6;p=ardour.git diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c index 4f8d0db693..96742d7462 100644 --- a/gtk2_ardour/gtk_pianokeyboard.c +++ b/gtk2_ardour/gtk_pianokeyboard.c @@ -251,7 +251,7 @@ bind_key(PianoKeyboard *pk, const char *key, int note) { assert(pk->key_bindings != NULL); - g_hash_table_insert(pk->key_bindings, (gpointer)key, (gpointer)((intptr_t)note)); + g_hash_table_insert(pk->key_bindings, (const gpointer)key, (gpointer)((intptr_t)note)); } static void @@ -367,7 +367,7 @@ keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer ignored) GdkKeymapKey kk; PianoKeyboard *pk = PIANO_KEYBOARD(mk); - (void) ignored; + (void) ignored; /* We're not using event->keyval, because we need keyval with level set to 0. E.g. if user holds Shift and presses '7', we want to get a '7', not '&'. */ @@ -449,7 +449,7 @@ mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer ig int note = get_note_for_xy(pk, x, y); - (void) ignored; + (void) ignored; if (event->button != 1) return TRUE; @@ -488,7 +488,7 @@ mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer ig { int note; - (void) ignored; + (void) ignored; if ((event->state & GDK_BUTTON1_MASK) == 0) return TRUE; @@ -542,7 +542,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event) static void piano_keyboard_size_request(GtkWidget* w, GtkRequisition *requisition) { - (void) w; + (void) w; requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH; requisition->height = PIANO_KEYBOARD_DEFAULT_HEIGHT; @@ -625,8 +625,8 @@ piano_keyboard_class_init(PianoKeyboardClass *klass) 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); piano_keyboard_signals[REST_SIGNAL] = g_signal_new ("rest", - G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION), - 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION), + 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); widget_klass = (GtkWidgetClass*) klass; @@ -687,10 +687,7 @@ piano_keyboard_new(void) pk->last_key = 0; pk->monophonic = FALSE; - /* Avoiding memset due to pk->notes being volatile. */ - for (int i = 0; i<(int)sizeof(struct PKNote)*NNOTES; i++) { - ((volatile int*)pk->notes)[i] = 0; - } + memset((void *)pk->notes, 0, sizeof(struct PKNote) * NNOTES); pk->key_bindings = g_hash_table_new(g_str_hash, g_str_equal); bind_keys_qwerty(pk);