Search
lxdream.org :: lxdream :: r480:d28c2992f5ee
lxdream 0.9.1
released Jun 29
Download Now
changeset480:d28c2992f5ee
parent479:e030b18d2744
child481:3b2d6c5a19ad
authornkeynes
dateWed Oct 31 11:53:35 2007 +0000 (12 years ago)
Fix miscellaneous warnings
src/config.c
src/dreamcast.c
src/gdrom/gdimage.c
src/gdrom/linux.c
src/gui.h
src/gui/ctrl_dlg.c
src/gui/debug_win.c
src/gui/gtkcb.c
src/gui/gtkui.c
src/gui/gtkui.h
src/gui/main_win.c
src/main.c
src/maple/maple.c
src/maple/maple.h
src/mem.c
src/watch.c
src/x86dasm/x86dasm.c
1.1 --- a/src/config.c Wed Oct 31 11:22:10 2007 +0000
1.2 +++ b/src/config.c Wed Oct 31 11:53:35 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: config.c,v 1.6 2007-10-31 09:06:48 nkeynes Exp $
1.6 + * $Id: config.c,v 1.7 2007-10-31 11:53:35 nkeynes Exp $
1.7 *
1.8 * User configuration support
1.9 *
1.10 @@ -21,6 +21,7 @@
1.11 #include <errno.h>
1.12 #include <stdlib.h>
1.13 #include <string.h>
1.14 +#include <glib/gmem.h>
1.15 #include <glib/gstrfuncs.h>
1.16 #include "dream.h"
1.17 #include "config.h"
1.18 @@ -56,6 +57,7 @@
1.19
1.20 gboolean lxdream_find_config()
1.21 {
1.22 + gboolean result = TRUE;
1.23 char *home = getenv("HOME");
1.24 if( lxdream_config_save_filename == NULL ) {
1.25 lxdream_config_save_filename = g_strdup_printf("%s/.%s", home, DEFAULT_CONFIG_FILENAME);
1.26 @@ -69,8 +71,10 @@
1.27 lxdream_config_load_filename = g_strdup("./" DEFAULT_CONFIG_FILENAME);
1.28 } else {
1.29 lxdream_config_load_filename = g_strdup(lxdream_config_save_filename);
1.30 + result = FALSE;
1.31 }
1.32 - }
1.33 + }
1.34 + return result;
1.35 }
1.36
1.37 void lxdream_set_config_filename( const gchar *filename )
2.1 --- a/src/dreamcast.c Wed Oct 31 11:22:10 2007 +0000
2.2 +++ b/src/dreamcast.c Wed Oct 31 11:53:35 2007 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: dreamcast.c,v 1.27 2007-10-31 09:10:23 nkeynes Exp $
2.6 + * $Id: dreamcast.c,v 1.28 2007-10-31 11:53:35 nkeynes Exp $
2.7 * Central switchboard for the system. This pulls all the individual modules
2.8 * together into some kind of coherent structure. This is also where you'd
2.9 * add Naomi support, if I ever get a board to play with...
2.10 @@ -307,7 +307,6 @@
2.11 int dreamcast_load_state( const gchar *filename )
2.12 {
2.13 int i,j;
2.14 - uint32_t len;
2.15 int module_count;
2.16 int have_read[MAX_MODULES];
2.17
3.1 --- a/src/gdrom/gdimage.c Wed Oct 31 11:22:10 2007 +0000
3.2 +++ b/src/gdrom/gdimage.c Wed Oct 31 11:53:35 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: gdimage.c,v 1.4 2007-10-28 07:23:46 nkeynes Exp $
3.6 + * $Id: gdimage.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $
3.7 *
3.8 * GD-Rom image-file common functions.
3.9 *
3.10 @@ -74,7 +74,7 @@
3.11 img->file = NULL;
3.12 }
3.13 if( disc->name != NULL ) {
3.14 - g_free( disc->name );
3.15 + g_free( (gpointer)disc->name );
3.16 disc->name = NULL;
3.17 }
3.18 free( disc );
3.19 @@ -87,7 +87,7 @@
3.20 img->file = NULL;
3.21 }
3.22 if( disc->name != NULL ) {
3.23 - g_free( disc->name );
3.24 + g_free( (gpointer)disc->name );
3.25 disc->name = NULL;
3.26 }
3.27 free( disc );
4.1 --- a/src/gdrom/linux.c Wed Oct 31 11:22:10 2007 +0000
4.2 +++ b/src/gdrom/linux.c Wed Oct 31 11:53:35 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: linux.c,v 1.7 2007-10-28 07:23:46 nkeynes Exp $
4.6 + * $Id: linux.c,v 1.8 2007-10-31 11:53:35 nkeynes Exp $
4.7 *
4.8 * Linux cd-rom device driver.
4.9 *
4.10 @@ -15,6 +15,7 @@
4.11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.12 * GNU General Public License for more details.
4.13 */
4.14 +#include <unistd.h>
4.15 #include <stdlib.h>
4.16 #include <stdio.h>
4.17 #include <string.h>
4.18 @@ -211,7 +212,7 @@
4.19 return 0;
4.20 }
4.21
4.22 -static gdrom_error_t linux_play_audio( gdrom_disc_t disc, uint32_t lba, uint32_t endlba )
4.23 + gdrom_error_t linux_play_audio( gdrom_disc_t disc, uint32_t lba, uint32_t endlba )
4.24 {
4.25 int fd = fileno( ((gdrom_image_t)disc)->file );
4.26 uint32_t real_sector = lba - CD_MSF_OFFSET;
4.27 @@ -230,7 +231,7 @@
4.28 return linux_send_command( fd, cmd, NULL, &buflen, CGC_DATA_NONE );
4.29 }
4.30
4.31 -static gdrom_error_t linux_stop_audio( gdrom_disc_t disc )
4.32 +gdrom_error_t linux_stop_audio( gdrom_disc_t disc )
4.33 {
4.34 int fd = fileno( ((gdrom_image_t)disc)->file );
4.35 uint32_t buflen = 0;
5.1 --- a/src/gui.h Wed Oct 31 11:22:10 2007 +0000
5.2 +++ b/src/gui.h Wed Oct 31 11:53:35 2007 +0000
5.3 @@ -1,5 +1,5 @@
5.4 /**
5.5 - * $Id: gui.h,v 1.2 2007-10-16 12:36:29 nkeynes Exp $
5.6 + * $Id: gui.h,v 1.3 2007-10-31 11:53:35 nkeynes Exp $
5.7 *
5.8 * Public GUI declarations (used from elsewhere in the system)
5.9 *
5.10 @@ -55,4 +55,9 @@
5.11 */
5.12 void gui_update_io_activity( io_activity_type activity, gboolean active );
5.13
5.14 +/**
5.15 + * Open a gdrom filename via the menu. FIXME: Should be generic
5.16 + */
5.17 +gboolean gdrom_menu_open_file( const char *filename );
5.18 +
5.19 #endif /* __lxdream_gui_H */
6.1 --- a/src/gui/ctrl_dlg.c Wed Oct 31 11:22:10 2007 +0000
6.2 +++ b/src/gui/ctrl_dlg.c Wed Oct 31 11:53:35 2007 +0000
6.3 @@ -1,5 +1,5 @@
6.4 /**
6.5 - * $Id: ctrl_dlg.c,v 1.4 2007-10-23 10:47:17 nkeynes Exp $
6.6 + * $Id: ctrl_dlg.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $
6.7 *
6.8 * Define the main (emu) GTK window, along with its menubars,
6.9 * toolbars, etc.
6.10 @@ -132,7 +132,6 @@
6.11 gtk_object_set_data( GTK_OBJECT(table), "maple_device", device );
6.12 for( i=0; i<count; i++ ) {
6.13 GtkWidget *text, *text2;
6.14 - GQuark quark;
6.15 char buf[64];
6.16 int x=0;
6.17 int y=i;
6.18 @@ -260,7 +259,6 @@
6.19 GtkWidget *maple_panel_new()
6.20 {
6.21 GtkWidget *table = gtk_table_new(4, 3, TRUE);
6.22 - GtkTreeIter iter;
6.23 int i,j;
6.24 const struct maple_device_class **devices = maple_get_device_classes();
6.25
7.1 --- a/src/gui/debug_win.c Wed Oct 31 11:22:10 2007 +0000
7.2 +++ b/src/gui/debug_win.c Wed Oct 31 11:53:35 2007 +0000
7.3 @@ -1,5 +1,5 @@
7.4 /**
7.5 - * $Id: debug_win.c,v 1.26 2007-10-21 11:38:02 nkeynes Exp $
7.6 + * $Id: debug_win.c,v 1.27 2007-10-31 11:53:35 nkeynes Exp $
7.7 * This file is responsible for the main debugger gui frame.
7.8 *
7.9 * Copyright (c) 2005 Nathan Keynes.
7.10 @@ -32,6 +32,7 @@
7.11
7.12 void init_register_list( debug_window_t data );
7.13 uint32_t row_to_address( debug_window_t data, int row );
7.14 +int address_to_row( debug_window_t data, uint32_t address );
7.15 void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select );
7.16 void set_disassembly_region( debug_window_t data, unsigned int page );
7.17 void set_disassembly_cpu( debug_window_t data, const gchar *cpu );
7.18 @@ -65,7 +66,6 @@
7.19 {
7.20 debug_window_t data = g_malloc0( sizeof(struct debug_window_info) + cpu_list[0]->regs_size );
7.21 GtkWidget *vbox;
7.22 - GtkWidget *frame;
7.23
7.24 data->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
7.25 gtk_window_set_default_size (GTK_WINDOW (data->window), 1000, 700);
8.1 --- a/src/gui/gtkcb.c Wed Oct 31 11:22:10 2007 +0000
8.2 +++ b/src/gui/gtkcb.c Wed Oct 31 11:53:35 2007 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: gtkcb.c,v 1.6 2007-10-31 09:10:23 nkeynes Exp $
8.6 + * $Id: gtkcb.c,v 1.7 2007-10-31 11:53:35 nkeynes Exp $
8.7 *
8.8 * Action callbacks from the main window
8.9 *
8.10 @@ -23,27 +23,6 @@
8.11 #include "gui/gtkui.h"
8.12 #include "pvr2/pvr2.h"
8.13
8.14 -typedef gboolean (*file_callback_t)( const gchar *filename );
8.15 -
8.16 -static gboolean dreamcast_paused = FALSE;
8.17 -
8.18 -void dreamcast_pause()
8.19 -{
8.20 - if( dreamcast_is_running() ) {
8.21 - dreamcast_paused = TRUE;
8.22 - dreamcast_stop();
8.23 - }
8.24 -}
8.25 -
8.26 -void dreamcast_unpause()
8.27 -{
8.28 - if( dreamcast_paused ) {
8.29 - dreamcast_paused = FALSE;
8.30 - if( !dreamcast_is_running() ) {
8.31 - dreamcast_run();
8.32 - }
8.33 - }
8.34 -}
8.35
8.36
8.37 static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname )
8.38 @@ -249,6 +228,8 @@
8.39 save_file_dialog( "Save next scene...", pvr2_save_next_scene, "*.dsc", "lxdream scene file (*.dsc)", dir );
8.40 }
8.41
8.42 +int debug_window_get_selected_row( debug_window_t data );
8.43 +
8.44 void debug_step_action_callback( GtkAction *action, gpointer user_data)
8.45 {
8.46 debug_window_single_step(gtk_gui_get_debugger());
9.1 --- a/src/gui/gtkui.c Wed Oct 31 11:22:10 2007 +0000
9.2 +++ b/src/gui/gtkui.c Wed Oct 31 11:53:35 2007 +0000
9.3 @@ -1,5 +1,5 @@
9.4 /**
9.5 - * $Id: gtkui.c,v 1.9 2007-10-31 09:10:23 nkeynes Exp $
9.6 + * $Id: gtkui.c,v 1.10 2007-10-31 11:53:35 nkeynes Exp $
9.7 *
9.8 * Core GTK-based user interface
9.9 *
9.10 @@ -25,7 +25,6 @@
9.11 #include "gui/gtkui.h"
9.12
9.13
9.14 -void gtk_gui_update( void );
9.15 void gtk_gui_start( void );
9.16 void gtk_gui_stop( void );
9.17 void gtk_gui_alloc_resources ( void );
9.18 @@ -49,7 +48,6 @@
9.19 * UIManager and action helpers
9.20 */
9.21 static GtkUIManager *global_ui_manager;
9.22 -static GtkAccelGroup *global_accel_group;
9.23 static GtkActionGroup *global_action_group;
9.24
9.25 /**
9.26 @@ -437,7 +435,7 @@
9.27
9.28 GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer )
9.29 {
9.30 - return gdk_pixbuf_new_from_data( buffer->data,
9.31 + return gdk_pixbuf_new_from_data( (unsigned char *)buffer->data,
9.32 GDK_COLORSPACE_RGB,
9.33 (buffer->colour_format == COLFMT_BGRA8888),
9.34 8,
10.1 --- a/src/gui/gtkui.h Wed Oct 31 11:22:10 2007 +0000
10.2 +++ b/src/gui/gtkui.h Wed Oct 31 11:53:35 2007 +0000
10.3 @@ -1,5 +1,5 @@
10.4 /**
10.5 - * $Id: gtkui.h,v 1.9 2007-10-31 09:10:23 nkeynes Exp $
10.6 + * $Id: gtkui.h,v 1.10 2007-10-31 11:53:35 nkeynes Exp $
10.7 *
10.8 * Core GTK-based user interface
10.9 *
10.10 @@ -20,6 +20,7 @@
10.11 #define __lxdream_gtkui_H
10.12
10.13 #include <gtk/gtk.h>
10.14 +#include "lxdream.h"
10.15 #include "gui.h"
10.16 #include "cpu.h"
10.17
10.18 @@ -54,15 +55,19 @@
10.19
10.20 mmio_window_t mmio_window_new( const gchar *title );
10.21 void mmio_window_show( mmio_window_t win, gboolean show );
10.22 +void mmio_window_update(mmio_window_t win);
10.23
10.24 dump_window_t dump_window_new( const gchar *title );
10.25 +void dump_window_update_all();
10.26
10.27 void maple_dialog_run();
10.28 void path_dialog_run();
10.29
10.30 +void gtk_gui_update( void );
10.31 main_window_t gtk_gui_get_main();
10.32 debug_window_t gtk_gui_get_debugger();
10.33 mmio_window_t gtk_gui_get_mmio();
10.34 +void gtk_gui_show_mmio();
10.35 void gtk_gui_show_debugger();
10.36
10.37 /********************* Helper functions **********************/
10.38 @@ -71,10 +76,15 @@
10.39 void gtk_gui_enable_action( const gchar *action, gboolean enabled );
10.40 gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
10.41
10.42 +
10.43 +typedef gboolean (*file_callback_t)( const gchar *filename );
10.44 +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
10.45 + gchar const *initial_dir );
10.46 +
10.47 /**
10.48 * Construct a new pixbuf that takes ownership of the frame buffer
10.49 */
10.50 -GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t );
10.51 +GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer );
10.52
10.53 void gdrom_menu_init();
10.54 GtkWidget *gdrom_menu_new();
11.1 --- a/src/gui/main_win.c Wed Oct 31 11:22:10 2007 +0000
11.2 +++ b/src/gui/main_win.c Wed Oct 31 11:53:35 2007 +0000
11.3 @@ -1,5 +1,5 @@
11.4 /**
11.5 - * $Id: main_win.c,v 1.7 2007-10-21 11:38:02 nkeynes Exp $
11.6 + * $Id: main_win.c,v 1.8 2007-10-31 11:53:35 nkeynes Exp $
11.7 *
11.8 * Define the main (emu) GTK window, along with its menubars,
11.9 * toolbars, etc.
11.10 @@ -98,7 +98,7 @@
11.11 {
11.12 char buf[32];
11.13
11.14 - snprintf( buf, 32, "Running (%2.4f%)", speed );
11.15 + snprintf( buf, 32, "Running (%2.4f%%)", speed );
11.16 gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
11.17 gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf );
11.18
12.1 --- a/src/main.c Wed Oct 31 11:22:10 2007 +0000
12.2 +++ b/src/main.c Wed Oct 31 11:53:35 2007 +0000
12.3 @@ -1,5 +1,5 @@
12.4 /**
12.5 - * $Id: main.c,v 1.33 2007-10-28 08:29:29 nkeynes Exp $
12.6 + * $Id: main.c,v 1.34 2007-10-31 11:53:35 nkeynes Exp $
12.7 *
12.8 * Main program, initializes dreamcast and gui, then passes control off to
12.9 * the gtk main loop (currently).
12.10 @@ -40,7 +40,7 @@
12.11 struct option longopts[1] = { { NULL, 0, 0, 0 } };
12.12 char *aica_program = NULL;
12.13 char *s3m_file = NULL;
12.14 -char *disc_file = NULL;
12.15 +const char *disc_file = NULL;
12.16 char *display_driver_name = "gtk";
12.17 char *audio_driver_name = "esd";
12.18 gboolean start_immediately = FALSE;
12.19 @@ -68,7 +68,7 @@
12.20 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
12.21 textdomain (PACKAGE);
12.22 #endif
12.23 - gboolean ui_initialized = gui_parse_cmdline(&argc, &argv);
12.24 + gui_parse_cmdline(&argc, &argv);
12.25
12.26 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
12.27 switch( opt ) {
13.1 --- a/src/maple/maple.c Wed Oct 31 11:22:10 2007 +0000
13.2 +++ b/src/maple/maple.c Wed Oct 31 11:53:35 2007 +0000
13.3 @@ -1,5 +1,5 @@
13.4 /**
13.5 - * $Id: maple.c,v 1.11 2007-10-17 11:26:45 nkeynes Exp $
13.6 + * $Id: maple.c,v 1.12 2007-10-31 11:53:35 nkeynes Exp $
13.7 *
13.8 * Implements the core Maple bus, including DMA transfers to and from the bus.
13.9 *
13.10 @@ -18,6 +18,7 @@
13.11 #define MODULE maple_module
13.12
13.13 #include <assert.h>
13.14 +#include <glib/gstrfuncs.h>
13.15 #include "dream.h"
13.16 #include "mem.h"
13.17 #include "asic.h"
13.18 @@ -44,7 +45,7 @@
13.19 return NULL;
13.20 }
13.21
13.22 -const maple_device_class_t maple_get_device_class( const gchar *name )
13.23 +maple_device_class_t maple_get_device_class( const gchar *name )
13.24 {
13.25 int i;
13.26 for( i=0; maple_device_classes[i] != NULL; i++ ) {
13.27 @@ -56,7 +57,7 @@
13.28
13.29 const struct maple_device_class **maple_get_device_classes()
13.30 {
13.31 - return maple_device_classes;
13.32 + return (const struct maple_device_class **)maple_device_classes;
13.33 }
13.34
13.35 lxdream_config_entry_t maple_get_device_config( maple_device_t dev )
14.1 --- a/src/maple/maple.h Wed Oct 31 11:22:10 2007 +0000
14.2 +++ b/src/maple/maple.h Wed Oct 31 11:53:35 2007 +0000
14.3 @@ -1,5 +1,5 @@
14.4 /**
14.5 - * $Id: maple.h,v 1.8 2007-10-23 10:47:17 nkeynes Exp $
14.6 + * $Id: maple.h,v 1.9 2007-10-31 11:53:35 nkeynes Exp $
14.7 *
14.8 * Maple bus definitions
14.9 *
14.10 @@ -55,7 +55,7 @@
14.11 #define MAPLE_DEVICE_TAG 0x4D41504C
14.12 #define MAPLE_DEVICE(x) ((maple_device_t)x)
14.13
14.14 -typedef struct maple_device_class *maple_device_class_t;
14.15 +typedef const struct maple_device_class *maple_device_class_t;
14.16 typedef struct maple_device *maple_device_t;
14.17
14.18 struct maple_device_class {
14.19 @@ -92,7 +92,7 @@
14.20
14.21 maple_device_t maple_new_device( const gchar *name );
14.22 maple_device_t maple_get_device( unsigned int port, unsigned int periph );
14.23 -const maple_device_class_t maple_get_device_class( const gchar *name );
14.24 +const struct maple_device_class *maple_get_device_class( const gchar *name );
14.25 const struct maple_device_class **maple_get_device_classes();
14.26 lxdream_config_entry_t maple_get_device_config( maple_device_t dev );
14.27
15.1 --- a/src/mem.c Wed Oct 31 11:22:10 2007 +0000
15.2 +++ b/src/mem.c Wed Oct 31 11:53:35 2007 +0000
15.3 @@ -1,5 +1,5 @@
15.4 /**
15.5 - * $Id: mem.c,v 1.18 2007-10-31 09:10:23 nkeynes Exp $
15.6 + * $Id: mem.c,v 1.19 2007-10-31 11:53:35 nkeynes Exp $
15.7 * mem.c is responsible for creating and maintaining the overall system memory
15.8 * map, as visible from the SH4 processor.
15.9 *
15.10 @@ -269,7 +269,6 @@
15.11 const gchar *region_name )
15.12 {
15.13 char *mem;
15.14 - int fd;
15.15 uint32_t calc_crc;
15.16
15.17 mem = mem_get_region(base);
16.1 --- a/src/watch.c Wed Oct 31 11:22:10 2007 +0000
16.2 +++ b/src/watch.c Wed Oct 31 11:53:35 2007 +0000
16.3 @@ -1,4 +1,5 @@
16.4 #include <stdlib.h>
16.5 +#include <string.h>
16.6 #include "mem.h"
16.7
16.8 struct watch_point {
17.1 --- a/src/x86dasm/x86dasm.c Wed Oct 31 11:22:10 2007 +0000
17.2 +++ b/src/x86dasm/x86dasm.c Wed Oct 31 11:53:35 2007 +0000
17.3 @@ -1,5 +1,5 @@
17.4 /**
17.5 - * $Id: x86dasm.c,v 1.4 2007-10-08 11:48:10 nkeynes Exp $
17.6 + * $Id: x86dasm.c,v 1.5 2007-10-31 11:53:35 nkeynes Exp $
17.7 *
17.8 * Wrapper around i386-dis to supply the same behaviour as the other
17.9 * disassembly functions.
17.10 @@ -18,6 +18,7 @@
17.11 */
17.12
17.13 #include <stdarg.h>
17.14 +#include <string.h>
17.15 #include "x86dasm.h"
17.16 #include "bfd.h"
17.17 #include "dis-asm.h"
.