- clean up compiler warnings for gcc

This commit is contained in:
Bryce Denney 2001-06-11 20:51:15 +00:00
parent 42f03956f5
commit 2d8fabda22
2 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,6 @@
/*
* gui/control.cc
* $Id: control.cc,v 1.12 2001-06-11 14:07:54 bdenney Exp $
* $Id: control.cc,v 1.13 2001-06-11 20:51:15 bdenney Exp $
*
* This is code for a text-mode control panel. Note that this file
* does NOT include bochs.h. Instead, it does all of its contact with
@ -415,8 +415,6 @@ int bx_control_panel (int menu)
}
case BX_CPANEL_START_MENU:
{
char rc[CPANEL_PATH_LEN];
char *choice_disabled = "Choice 1 not allowed because the default bochsrc file was not found.";
static int read_rc = 0;
int default_choice = 1;
default_choice = read_rc ? 4 : 1;
@ -679,10 +677,10 @@ static void bx_print_log_action_table ()
fprintf (stderr, " Debug Info Error Panic\n");
fprintf (stderr, "ID Device Action Action Action Action\n");
fprintf (stderr, "---- --------- --------- --------- ---------- ----------\n");
int i, imax=SIM->get_n_log_modules ();
for (int i=0; i<imax; i++) {
int i, j, imax=SIM->get_n_log_modules ();
for (i=0; i<imax; i++) {
fprintf (stderr, "%3d. %s ", i, SIM->get_prefix (i));
for (int j=0; j<SIM->get_max_log_level (); j++) {
for (j=0; j<SIM->get_max_log_level (); j++) {
fprintf (stderr, "%10s ", SIM->get_action_name (SIM->get_log_action (i, j)));
}
fprintf (stderr, "\n");
@ -854,6 +852,8 @@ int control_panel_notify_callback (int code)
default:
fprintf (stderr, "Control panel: notify callback called with unknown code %04x\n", code);
}
// error if we fall through the case
return -1;
}
void bx_control_panel_init () {

View File

@ -1,6 +1,6 @@
/*
* gui/siminterface.cc
* $Id: siminterface.cc,v 1.10 2001-06-11 14:03:35 bdenney Exp $
* $Id: siminterface.cc,v 1.11 2001-06-11 20:51:15 bdenney Exp $
*
* Defines the actual link between bx_simulator_interface_c methods
* and the simulator. This file includes bochs.h because it needs
@ -251,6 +251,7 @@ int
bx_real_sim_c::get_disk_options (int drive, bx_disk_options *out)
{
*out = (drive==0)? bx_options.diskc : bx_options.diskd;
return 0;
}
int
@ -266,6 +267,7 @@ bx_real_sim_c::get_cdrom_options (int drive, bx_cdrom_options *out)
{
BX_ASSERT (drive == 0);
*out = bx_options.cdromd;
return 0;
}
int
@ -273,6 +275,7 @@ bx_real_sim_c::set_cdrom_options (int drive, bx_cdrom_options *out)
{
BX_ASSERT (drive == 0);
bx_options.cdromd = *out;
return 0;
}
int
@ -398,9 +401,10 @@ bx_real_sim_c::notify_return (int retcode)
int
bx_real_sim_c::LOCAL_notify (int code)
{
if (callback == NULL)
if (callback == NULL) {
BX_ERROR (("notify called, but no callback function is registered"));
else {
return -1;
} else {
notify_return_val = -999;
(*callback)(code);
if (notify_return_val == -999)