From e988591eafbf25b6c0cbd20a478cad5b4f66f1a9 Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Thu, 15 Oct 2015 23:40:11 -0400 Subject: [PATCH] Fix gui compilation --- tool/gtk/Makefile | 2 +- tool/gtk/main.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tool/gtk/Makefile b/tool/gtk/Makefile index a2d8d87..9733fbf 100644 --- a/tool/gtk/Makefile +++ b/tool/gtk/Makefile @@ -8,7 +8,7 @@ PREFIX=/usr/local PROG=gcn64ctl_gui -OBJS=main.o ../gcn64.o ../mempak.o ../gcn64lib.o +OBJS=main.o ../gcn64.o ../mempak.o ../gcn64lib.o ../hexdump.o .PHONY : clean install diff --git a/tool/gtk/main.c b/tool/gtk/main.c index ec9668a..8d3e594 100644 --- a/tool/gtk/main.c +++ b/tool/gtk/main.c @@ -5,8 +5,8 @@ #include "../gcn64lib.h" #include "../../requests.h" -#define GET_UI_ELEMENT(TYPE, ELEMENT) TYPE *ELEMENT = (TYPE *) \ - gtk_builder_get_object(app->builder, #ELEMENT); +#define GET_ELEMENT(TYPE, ELEMENT) (TYPE *)gtk_builder_get_object(app->builder, #ELEMENT) +#define GET_UI_ELEMENT(TYPE, ELEMENT) TYPE *ELEMENT = GET_ELEMENT(TYPE, ELEMENT) struct application { GtkBuilder *builder; @@ -50,11 +50,11 @@ G_MODULE_EXPORT void config_checkbox_changed(GtkWidget *win, gpointer data) unsigned char cfg_param; GtkCheckButton *chkbtn; } configurable_bits[] = { - { CFG_PARAM_N64_SQUARE, GET_UI_ELEMENT(GtkCheckButton, chkbtn_n64_square) }, - { CFG_PARAM_GC_MAIN_SQUARE, GET_UI_ELEMENT(GtkCheckButton, chkbtn_gc_main_square) }, - { CFG_PARAM_GC_CSTICK_SQUARE, GET_UI_ELEMENT(GtkCheckButton, chkbtn_gc_cstick_square) }, - { CFG_PARAM_FULL_SLIDERS, GET_UI_ELEMENT(GtkCheckButton, chkbtn_gc_full_sliders) }, - { CFG_PARAM_INVERT_TRIG, GET_UI_ELEMENT(GtkCheckButton, chkbtn_gc_invert_trig) }, + { CFG_PARAM_N64_SQUARE, GET_ELEMENT(GtkCheckButton, chkbtn_n64_square) }, + { CFG_PARAM_GC_MAIN_SQUARE, GET_ELEMENT(GtkCheckButton, chkbtn_gc_main_square) }, + { CFG_PARAM_GC_CSTICK_SQUARE, GET_ELEMENT(GtkCheckButton, chkbtn_gc_cstick_square) }, + { CFG_PARAM_FULL_SLIDERS, GET_ELEMENT(GtkCheckButton, chkbtn_gc_full_sliders) }, + { CFG_PARAM_INVERT_TRIG, GET_ELEMENT(GtkCheckButton, chkbtn_gc_invert_trig) }, { }, }; int i; @@ -62,7 +62,7 @@ G_MODULE_EXPORT void config_checkbox_changed(GtkWidget *win, gpointer data) for (i=0; configurable_bits[i].chkbtn; i++) { buf = gtk_toggle_button_get_active(configurable_bits[i].chkbtn); - gcn64lib_setConfig(app->current_adapter_handle, configurable_bits[i], &buf, 1); + gcn64lib_setConfig(app->current_adapter_handle, configurable_bits[i].cfg_param, &buf, 1); } }