# HG changeset patch # User nkeynes # Date 1193831615 0 # Node ID d28c2992f5ee3613e55ebc21a25ebb2c573c5720 # Parent e030b18d27445520fd5a692535bb2ef943aea40a Fix miscellaneous warnings --- a/src/config.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/config.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: config.c,v 1.6 2007-10-31 09:06:48 nkeynes Exp $ + * $Id: config.c,v 1.7 2007-10-31 11:53:35 nkeynes Exp $ * * User configuration support * @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "dream.h" #include "config.h" @@ -56,6 +57,7 @@ gboolean lxdream_find_config() { + gboolean result = TRUE; char *home = getenv("HOME"); if( lxdream_config_save_filename == NULL ) { lxdream_config_save_filename = g_strdup_printf("%s/.%s", home, DEFAULT_CONFIG_FILENAME); @@ -69,8 +71,10 @@ lxdream_config_load_filename = g_strdup("./" DEFAULT_CONFIG_FILENAME); } else { lxdream_config_load_filename = g_strdup(lxdream_config_save_filename); + result = FALSE; } - } + } + return result; } void lxdream_set_config_filename( const gchar *filename ) --- a/src/dreamcast.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/dreamcast.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: dreamcast.c,v 1.27 2007-10-31 09:10:23 nkeynes Exp $ + * $Id: dreamcast.c,v 1.28 2007-10-31 11:53:35 nkeynes Exp $ * Central switchboard for the system. This pulls all the individual modules * together into some kind of coherent structure. This is also where you'd * add Naomi support, if I ever get a board to play with... @@ -307,7 +307,6 @@ int dreamcast_load_state( const gchar *filename ) { int i,j; - uint32_t len; int module_count; int have_read[MAX_MODULES]; --- a/src/gdrom/gdimage.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gdrom/gdimage.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gdimage.c,v 1.4 2007-10-28 07:23:46 nkeynes Exp $ + * $Id: gdimage.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $ * * GD-Rom image-file common functions. * @@ -74,7 +74,7 @@ img->file = NULL; } if( disc->name != NULL ) { - g_free( disc->name ); + g_free( (gpointer)disc->name ); disc->name = NULL; } free( disc ); @@ -87,7 +87,7 @@ img->file = NULL; } if( disc->name != NULL ) { - g_free( disc->name ); + g_free( (gpointer)disc->name ); disc->name = NULL; } free( disc ); --- a/src/gdrom/linux.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gdrom/linux.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: linux.c,v 1.7 2007-10-28 07:23:46 nkeynes Exp $ + * $Id: linux.c,v 1.8 2007-10-31 11:53:35 nkeynes Exp $ * * Linux cd-rom device driver. * @@ -15,6 +15,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#include #include #include #include @@ -211,7 +212,7 @@ return 0; } -static gdrom_error_t linux_play_audio( gdrom_disc_t disc, uint32_t lba, uint32_t endlba ) + gdrom_error_t linux_play_audio( gdrom_disc_t disc, uint32_t lba, uint32_t endlba ) { int fd = fileno( ((gdrom_image_t)disc)->file ); uint32_t real_sector = lba - CD_MSF_OFFSET; @@ -230,7 +231,7 @@ return linux_send_command( fd, cmd, NULL, &buflen, CGC_DATA_NONE ); } -static gdrom_error_t linux_stop_audio( gdrom_disc_t disc ) +gdrom_error_t linux_stop_audio( gdrom_disc_t disc ) { int fd = fileno( ((gdrom_image_t)disc)->file ); uint32_t buflen = 0; --- a/src/gui.h Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui.h Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gui.h,v 1.2 2007-10-16 12:36:29 nkeynes Exp $ + * $Id: gui.h,v 1.3 2007-10-31 11:53:35 nkeynes Exp $ * * Public GUI declarations (used from elsewhere in the system) * @@ -55,4 +55,9 @@ */ void gui_update_io_activity( io_activity_type activity, gboolean active ); +/** + * Open a gdrom filename via the menu. FIXME: Should be generic + */ +gboolean gdrom_menu_open_file( const char *filename ); + #endif /* __lxdream_gui_H */ --- a/src/gui/ctrl_dlg.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui/ctrl_dlg.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: ctrl_dlg.c,v 1.4 2007-10-23 10:47:17 nkeynes Exp $ + * $Id: ctrl_dlg.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $ * * Define the main (emu) GTK window, along with its menubars, * toolbars, etc. @@ -132,7 +132,6 @@ gtk_object_set_data( GTK_OBJECT(table), "maple_device", device ); for( i=0; iregs_size ); GtkWidget *vbox; - GtkWidget *frame; data->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (data->window), 1000, 700); --- a/src/gui/gtkcb.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui/gtkcb.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gtkcb.c,v 1.6 2007-10-31 09:10:23 nkeynes Exp $ + * $Id: gtkcb.c,v 1.7 2007-10-31 11:53:35 nkeynes Exp $ * * Action callbacks from the main window * @@ -23,27 +23,6 @@ #include "gui/gtkui.h" #include "pvr2/pvr2.h" -typedef gboolean (*file_callback_t)( const gchar *filename ); - -static gboolean dreamcast_paused = FALSE; - -void dreamcast_pause() -{ - if( dreamcast_is_running() ) { - dreamcast_paused = TRUE; - dreamcast_stop(); - } -} - -void dreamcast_unpause() -{ - if( dreamcast_paused ) { - dreamcast_paused = FALSE; - if( !dreamcast_is_running() ) { - dreamcast_run(); - } - } -} static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname ) @@ -249,6 +228,8 @@ save_file_dialog( "Save next scene...", pvr2_save_next_scene, "*.dsc", "lxdream scene file (*.dsc)", dir ); } +int debug_window_get_selected_row( debug_window_t data ); + void debug_step_action_callback( GtkAction *action, gpointer user_data) { debug_window_single_step(gtk_gui_get_debugger()); --- a/src/gui/gtkui.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui/gtkui.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gtkui.c,v 1.9 2007-10-31 09:10:23 nkeynes Exp $ + * $Id: gtkui.c,v 1.10 2007-10-31 11:53:35 nkeynes Exp $ * * Core GTK-based user interface * @@ -25,7 +25,6 @@ #include "gui/gtkui.h" -void gtk_gui_update( void ); void gtk_gui_start( void ); void gtk_gui_stop( void ); void gtk_gui_alloc_resources ( void ); @@ -49,7 +48,6 @@ * UIManager and action helpers */ static GtkUIManager *global_ui_manager; -static GtkAccelGroup *global_accel_group; static GtkActionGroup *global_action_group; /** @@ -437,7 +435,7 @@ GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer ) { - return gdk_pixbuf_new_from_data( buffer->data, + return gdk_pixbuf_new_from_data( (unsigned char *)buffer->data, GDK_COLORSPACE_RGB, (buffer->colour_format == COLFMT_BGRA8888), 8, --- a/src/gui/gtkui.h Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui/gtkui.h Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: gtkui.h,v 1.9 2007-10-31 09:10:23 nkeynes Exp $ + * $Id: gtkui.h,v 1.10 2007-10-31 11:53:35 nkeynes Exp $ * * Core GTK-based user interface * @@ -20,6 +20,7 @@ #define __lxdream_gtkui_H #include +#include "lxdream.h" #include "gui.h" #include "cpu.h" @@ -54,15 +55,19 @@ mmio_window_t mmio_window_new( const gchar *title ); void mmio_window_show( mmio_window_t win, gboolean show ); +void mmio_window_update(mmio_window_t win); dump_window_t dump_window_new( const gchar *title ); +void dump_window_update_all(); void maple_dialog_run(); void path_dialog_run(); +void gtk_gui_update( void ); main_window_t gtk_gui_get_main(); debug_window_t gtk_gui_get_debugger(); mmio_window_t gtk_gui_get_mmio(); +void gtk_gui_show_mmio(); void gtk_gui_show_debugger(); /********************* Helper functions **********************/ @@ -71,10 +76,15 @@ void gtk_gui_enable_action( const gchar *action, gboolean enabled ); gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn ); + +typedef gboolean (*file_callback_t)( const gchar *filename ); +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname, + gchar const *initial_dir ); + /** * Construct a new pixbuf that takes ownership of the frame buffer */ -GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t ); +GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer ); void gdrom_menu_init(); GtkWidget *gdrom_menu_new(); --- a/src/gui/main_win.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/gui/main_win.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: main_win.c,v 1.7 2007-10-21 11:38:02 nkeynes Exp $ + * $Id: main_win.c,v 1.8 2007-10-31 11:53:35 nkeynes Exp $ * * Define the main (emu) GTK window, along with its menubars, * toolbars, etc. @@ -98,7 +98,7 @@ { char buf[32]; - snprintf( buf, 32, "Running (%2.4f%)", speed ); + snprintf( buf, 32, "Running (%2.4f%%)", speed ); gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 ); gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf ); --- a/src/main.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/main.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: main.c,v 1.33 2007-10-28 08:29:29 nkeynes Exp $ + * $Id: main.c,v 1.34 2007-10-31 11:53:35 nkeynes Exp $ * * Main program, initializes dreamcast and gui, then passes control off to * the gtk main loop (currently). @@ -40,7 +40,7 @@ struct option longopts[1] = { { NULL, 0, 0, 0 } }; char *aica_program = NULL; char *s3m_file = NULL; -char *disc_file = NULL; +const char *disc_file = NULL; char *display_driver_name = "gtk"; char *audio_driver_name = "esd"; gboolean start_immediately = FALSE; @@ -68,7 +68,7 @@ bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); textdomain (PACKAGE); #endif - gboolean ui_initialized = gui_parse_cmdline(&argc, &argv); + gui_parse_cmdline(&argc, &argv); while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) { switch( opt ) { --- a/src/maple/maple.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/maple/maple.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: maple.c,v 1.11 2007-10-17 11:26:45 nkeynes Exp $ + * $Id: maple.c,v 1.12 2007-10-31 11:53:35 nkeynes Exp $ * * Implements the core Maple bus, including DMA transfers to and from the bus. * @@ -18,6 +18,7 @@ #define MODULE maple_module #include +#include #include "dream.h" #include "mem.h" #include "asic.h" @@ -44,7 +45,7 @@ return NULL; } -const maple_device_class_t maple_get_device_class( const gchar *name ) +maple_device_class_t maple_get_device_class( const gchar *name ) { int i; for( i=0; maple_device_classes[i] != NULL; i++ ) { @@ -56,7 +57,7 @@ const struct maple_device_class **maple_get_device_classes() { - return maple_device_classes; + return (const struct maple_device_class **)maple_device_classes; } lxdream_config_entry_t maple_get_device_config( maple_device_t dev ) --- a/src/maple/maple.h Wed Oct 31 11:22:10 2007 +0000 +++ b/src/maple/maple.h Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: maple.h,v 1.8 2007-10-23 10:47:17 nkeynes Exp $ + * $Id: maple.h,v 1.9 2007-10-31 11:53:35 nkeynes Exp $ * * Maple bus definitions * @@ -55,7 +55,7 @@ #define MAPLE_DEVICE_TAG 0x4D41504C #define MAPLE_DEVICE(x) ((maple_device_t)x) -typedef struct maple_device_class *maple_device_class_t; +typedef const struct maple_device_class *maple_device_class_t; typedef struct maple_device *maple_device_t; struct maple_device_class { @@ -92,7 +92,7 @@ maple_device_t maple_new_device( const gchar *name ); maple_device_t maple_get_device( unsigned int port, unsigned int periph ); -const maple_device_class_t maple_get_device_class( const gchar *name ); +const struct maple_device_class *maple_get_device_class( const gchar *name ); const struct maple_device_class **maple_get_device_classes(); lxdream_config_entry_t maple_get_device_config( maple_device_t dev ); --- a/src/mem.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/mem.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: mem.c,v 1.18 2007-10-31 09:10:23 nkeynes Exp $ + * $Id: mem.c,v 1.19 2007-10-31 11:53:35 nkeynes Exp $ * mem.c is responsible for creating and maintaining the overall system memory * map, as visible from the SH4 processor. * @@ -269,7 +269,6 @@ const gchar *region_name ) { char *mem; - int fd; uint32_t calc_crc; mem = mem_get_region(base); --- a/src/watch.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/watch.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,4 +1,5 @@ #include +#include #include "mem.h" struct watch_point { --- a/src/x86dasm/x86dasm.c Wed Oct 31 11:22:10 2007 +0000 +++ b/src/x86dasm/x86dasm.c Wed Oct 31 11:53:35 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: x86dasm.c,v 1.4 2007-10-08 11:48:10 nkeynes Exp $ + * $Id: x86dasm.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $ * * Wrapper around i386-dis to supply the same behaviour as the other * disassembly functions. @@ -18,6 +18,7 @@ */ #include +#include #include "x86dasm.h" #include "bfd.h" #include "dis-asm.h"