From: Hugo Villeneuve Date: Fri, 3 Jan 2014 06:43:55 +0000 (-0500) Subject: Fix warnings about unused function parameters X-Git-Tag: v2.0.0~21 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=702da8f53198200be75f7b78011c3ffb1f4936a8;p=emu8051.git Fix warnings about unused function parameters --- diff --git a/src/common/sfr.c b/src/common/sfr.c index 1bbeb8e..165ba2e 100644 --- a/src/common/sfr.c +++ b/src/common/sfr.c @@ -39,12 +39,16 @@ static unsigned int regwin_read_pc(int dummy) { + (void) dummy; /* Remove compiler warning about unused variable. */ + return cpu8051.pc; } static void regwin_write_pc(int param, int val) { + (void) param; /* Remove compiler warning about unused variable. */ + cpu8051.pc = (u_int16_t) val; } @@ -71,6 +75,8 @@ regwin_read_bank_offset(void) static unsigned int regwin_read_bank(int dummy) { + (void) dummy; /* Remove compiler warning about unused variable. */ + return regwin_read_bank_offset() >> 3; } @@ -79,6 +85,8 @@ regwin_write_bank(int param, int bank_number) { u_int8_t psw = memory_sfr_read8(_PSW_); + (void) param; /* Remove compiler warning about unused variable. */ + if ((bank_number < 0) || (bank_number > 3)) { log_info("Error: invalid bank number: %d", bank_number); bank_number = 0; diff --git a/src/gtk/emugtk.c b/src/gtk/emugtk.c index b5ef13f..308bdeb 100644 --- a/src/gtk/emugtk.c +++ b/src/gtk/emugtk.c @@ -89,6 +89,8 @@ emugtk_stop_running() static gboolean emugtk_running(gpointer data) { + (void) data; /* Remove compiler warning about unused variable. */ + cpu8051_Exec(); if (IsBreakpoint(cpu8051.pc)) { log_info("Breakpoint Hit"); @@ -139,6 +141,11 @@ emugtk_Reset(void) static void emugtk_ResetEvent(GtkWidget *widget, GdkEvent *event, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) event; + (void) data; + log_info("ResetEvent()"); emugtk_stop_running(); emugtk_Reset(); @@ -156,6 +163,11 @@ emugtk_Step(void) static void emugtk_RunEvent(GtkWidget *widget, GdkEvent *event, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) event; + (void) data; + log_info("RunEvent()"); if (running) @@ -168,6 +180,11 @@ emugtk_RunEvent(GtkWidget *widget, GdkEvent *event, gpointer data) static void emugtk_StopEvent(GtkWidget *widget, GdkEvent *event, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) event; + (void) data; + log_info("StopEvent()"); emugtk_stop_running(); } @@ -176,6 +193,11 @@ emugtk_StopEvent(GtkWidget *widget, GdkEvent *event, gpointer data) static void emugtk_StepEvent(GtkWidget *widget, GdkEvent *event, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) event; + (void) data; + log_info("StepEvent()"); emugtk_stop_running(); emugtk_Step(); @@ -241,6 +263,10 @@ AddMenu(void) static int mainwin_configure_event(GtkWindow *window, GdkEvent *event, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) window; + (void) data; + cfg->win_width = event->configure.width; cfg->win_height = event->configure.height; @@ -257,6 +283,10 @@ hpaned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; + /* Remove compiler warning about unused variables. */ + (void) window; + (void) event; + cfg->hpane_pos = gtk_paned_get_position(GTK_PANED(paned)); } @@ -265,6 +295,10 @@ vpaned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; + /* Remove compiler warning about unused variables. */ + (void) window; + (void) event; + cfg->vpane_pos = gtk_paned_get_position(GTK_PANED(paned)); } @@ -273,6 +307,10 @@ main_paned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; + /* Remove compiler warning about unused variables. */ + (void) window; + (void) event; + cfg->main_pane_pos = gtk_paned_get_position(GTK_PANED(paned)); } diff --git a/src/gtk/filemenu.c b/src/gtk/filemenu.c index d2dae9c..1332bb0 100644 --- a/src/gtk/filemenu.c +++ b/src/gtk/filemenu.c @@ -63,6 +63,10 @@ FileOpenEvent(GtkObject *object, gpointer data) char *dir; char *cwd = NULL; + /* Remove compiler warning about unused variables. */ + (void) object; + (void) data; + log_info("FileOpenEvent()"); /* Create a new file selection widget. */ @@ -107,6 +111,9 @@ FileOpenEvent(GtkObject *object, gpointer data) static void FileQuitEvent(gchar *string) { + /* Remove compiler warning about unused variables. */ + (void) string; + emugtk_quit_gui(); } diff --git a/src/gtk/helpmenu.c b/src/gtk/helpmenu.c index 4a8d9dc..6d3f9e0 100644 --- a/src/gtk/helpmenu.c +++ b/src/gtk/helpmenu.c @@ -44,6 +44,8 @@ static void HelpCommandsEvent(gchar *string) { + (void) string; /* Remove compiler warning about unused variables. */ + ShowMessage("Command Line Options", COMMAND_LINE_OPTIONS, GTK_JUSTIFY_LEFT, MESSAGE_DIALOG_FIXED_FONT); } @@ -51,6 +53,10 @@ HelpCommandsEvent(gchar *string) static void HelpAboutEvent(GtkWidget *widget, gpointer data) { + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) data; + const char *authors[] = { "Hugo Villeneuve ", "Jonathan St-André", diff --git a/src/gtk/pgmwin.c b/src/gtk/pgmwin.c index 0e8961b..15f26b5 100644 --- a/src/gtk/pgmwin.c +++ b/src/gtk/pgmwin.c @@ -128,6 +128,11 @@ pgmwin_sel_changed_event(GtkWidget *widget, GdkEvent *event, gpointer data) GtkTreeModel *model; GtkTreeIter iter; + /* Remove compiler warning about unused variables. */ + (void) widget; + (void) event; + (void) data; + log_debug("pgmwin_sel_changed_event()"); /* This will only work in single or browse selection mode! */ diff --git a/src/gtk/regwin.c b/src/gtk/regwin.c index 8c4cd4d..af16a7c 100644 --- a/src/gtk/regwin.c +++ b/src/gtk/regwin.c @@ -82,6 +82,8 @@ regwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, char *str; struct regwin_infos_t *regwin_infos; + (void) cell; /* Remove compiler warning about unused variables. */ + if (!model) { g_error("Unable to get model from cell renderer"); } diff --git a/src/gtk/viewmenu.c b/src/gtk/viewmenu.c index 3377329..166ab88 100644 --- a/src/gtk/viewmenu.c +++ b/src/gtk/viewmenu.c @@ -61,6 +61,8 @@ void toggle_bits_per_row(GtkWidget *widget, gpointer data) void toggle_int_memory(GtkWidget *widget, gpointer data) { + (void) data; /* Remove compiler warning about unused variables. */ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" View internal memory"); cfg->view_int_memory = 1; @@ -73,6 +75,8 @@ void toggle_int_memory(GtkWidget *widget, gpointer data) void toggle_sfr_memory(GtkWidget *widget, gpointer data) { + (void) data; /* Remove compiler warning about unused variables. */ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" View SFR memory"); cfg->view_sfr_memory = 1; @@ -85,6 +89,8 @@ void toggle_sfr_memory(GtkWidget *widget, gpointer data) void toggle_ext_memory(GtkWidget *widget, gpointer data) { + (void) data; /* Remove compiler warning about unused variables. */ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" View external memory"); cfg->view_ext_memory = 1;