revision 1298:d0eb2307b847
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1298:d0eb2307b847 |
parent | 1297:7e98a164b2d9 |
child | 1299:645ccec8dfb0 |
author | nkeynes |
date | Wed Feb 04 08:38:23 2015 +1000 (9 years ago) |
Fix assorted compile warnings reported by Clang
1.1 --- a/src/bios.c Sun Jan 18 20:00:38 2015 +10001.2 +++ b/src/bios.c Wed Feb 04 08:38:23 2015 +10001.3 @@ -213,12 +213,12 @@1.4 * Locate the active config block. FIXME: This isn't completely correct, but it works1.5 * under at least some circumstances.1.6 */1.7 -static char *bios_find_flash_config( sh4addr_t segment, uint32_t length )1.8 +static sh4ptr_t bios_find_flash_config( sh4addr_t segment, uint32_t length )1.9 {1.10 - char *start = mem_get_region(segment);1.11 - char *p = start + 0x80;1.12 - char *end = p + length;1.13 - char *result = NULL;1.14 + sh4ptr_t start = mem_get_region(segment);1.15 + sh4ptr_t p = start + 0x80;1.16 + sh4ptr_t end = p + length;1.17 + sh4ptr_t result = NULL;1.19 if( memcmp( start, FLASH_PARTITION_MAGIC, 16 ) != 0 )1.20 return NULL; /* Missing magic */1.21 @@ -236,8 +236,8 @@1.22 */1.23 static void bios_sysinfo_vector( uint32_t syscallid )1.24 {1.25 - char *flash_segment, *flash_config;1.26 - char *dest;1.27 + sh4ptr_t flash_segment, flash_config;1.28 + sh4ptr_t dest;1.29 DEBUG( "BIOS SYSINFO: r4 = %08X, r5 = %08X, r6 = %08x, r7= %08X", sh4r.r[4], sh4r.r[5], sh4r.r[6], sh4r.r[7] );1.31 switch( sh4r.r[7] ) {1.32 @@ -269,7 +269,6 @@1.34 static void bios_flashrom_vector( uint32_t syscallid )1.35 {1.36 - char *dest;1.37 DEBUG( "BIOS FLASHROM: r4 = %08X, r5 = %08X, r6 = %08x, r7= %08X", sh4r.r[4], sh4r.r[5], sh4r.r[6], sh4r.r[7] );1.39 switch( sh4r.r[7] ) {1.40 @@ -413,7 +412,7 @@1.41 } else if( iso_file_source_open(file) == 1 ) {1.42 size_t len;1.43 if( unscramble ) {1.44 - char *tmp = g_malloc(st.st_size);1.45 + unsigned char *tmp = g_malloc(st.st_size);1.46 len = iso_file_source_read(file, tmp, st.st_size);1.47 bootprogram_unscramble(buffer, tmp, st.st_size);1.48 g_free(tmp);1.49 @@ -453,7 +452,6 @@1.50 ERROR( "Disc is not bootable" );1.51 return FALSE;1.52 }1.53 - uint32_t lba = track->lba;1.54 uint32_t sectors = cdrom_disc_get_track_size(disc,track);1.55 if( sectors < MIN_ISO_SECTORS ) {1.56 ERROR( "Disc is not bootable" );
2.1 --- a/src/cocoaui/cocoa_cfg.m Sun Jan 18 20:00:38 2015 +10002.2 +++ b/src/cocoaui/cocoa_cfg.m Wed Feb 04 08:38:23 2015 +10002.3 @@ -249,7 +249,7 @@2.4 - (void)openFileDialog: (id)sender2.5 {2.6 int tag = [sender tag];2.7 - NSString *text = [fields[tag][0] stringValue];2.8 + /* NSString *text = [fields[tag][0] stringValue]; */2.9 NSOpenPanel *panel = [NSOpenPanel openPanel];2.10 int result = [panel runModalForDirectory: nil file: nil types: nil];2.11 if( result == NSOKButton && [[panel filenames] count] > 0 ) {2.12 @@ -263,7 +263,7 @@2.13 - (void)openDirDialog: (id)sender2.14 {2.15 int tag = [sender tag];2.16 - NSString *text = [fields[tag][0] stringValue];2.17 + /* NSString *text = [fields[tag][0] stringValue]; */2.18 NSOpenPanel *panel = [NSOpenPanel openPanel];2.19 [panel setCanChooseDirectories: YES];2.20 [panel setCanCreateDirectories: YES];2.21 @@ -313,14 +313,14 @@2.22 fields[i][0] = [[KeyBindingField alloc] initWithFrame: frame];2.23 [fields[i][0] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];2.24 [fields[i][0] setTag: i];2.25 - [fields[i][0] setDelegate: self];2.26 + [fields[i][0] setDelegate: (id)self];2.27 [self addSubview: fields[i][0]];2.29 frame = NSMakeRect( x + labelWidth + KEYBINDING_SIZE + (TEXT_GAP*2), y, KEYBINDING_SIZE, TEXT_HEIGHT);2.30 fields[i][1] = [[KeyBindingField alloc] initWithFrame: frame];2.31 [fields[i][1] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];2.32 [fields[i][1] setTag: i];2.33 - [fields[i][1] setDelegate: self];2.34 + [fields[i][1] setDelegate: (id)self];2.35 [self addSubview: fields[i][1]];2.37 if( config->params[i].value != NULL ) {2.38 @@ -341,7 +341,7 @@2.39 NSTextField *field = [[NSTextField alloc] initWithFrame: frame];2.40 [field setTag: i];2.41 [field setStringValue: [NSString stringWithCString: config->params[i].value]];2.42 - [field setDelegate: self];2.43 + [field setDelegate: (id)self];2.44 [field setAutoresizingMask: (NSViewMinYMargin|NSViewWidthSizable)];2.46 frame = NSMakeRect( x+ labelWidth + fieldWidth + (TEXT_GAP*2), y, TEXT_HEIGHT, TEXT_HEIGHT );
3.1 --- a/src/cocoaui/cocoa_ctrl.m Sun Jan 18 20:00:38 2015 +10003.2 +++ b/src/cocoaui/cocoa_ctrl.m Wed Feb 04 08:38:23 2015 +10003.3 @@ -220,7 +220,7 @@3.4 if( [super initWithFrame: frameRect title: NS_("Controllers")] == nil ) {3.5 return nil;3.6 } else {3.7 - int i,j;3.8 + int i;3.9 int y = [self contentHeight] - TEXT_HEIGHT - TEXT_GAP;3.11 memset( radio, 0, sizeof(radio) );3.12 @@ -320,7 +320,7 @@3.13 NSArray *array = [NSArray arrayWithObjects: @"vmu", nil];3.14 NSOpenPanel *panel = [NSOpenPanel openPanel];3.15 VMULoadValidator *valid = [[VMULoadValidator alloc] autorelease];3.16 - [panel setDelegate: valid];3.17 + [panel setDelegate: (id)valid];3.18 int result = [panel runModalForDirectory: [NSString stringWithUTF8String: get_gui_path(CONFIG_VMU_PATH)]3.19 file: nil types: array];3.20 if( result == NSOKButton ) {3.21 @@ -340,7 +340,7 @@3.22 [panel setCanCreateDirectories: YES];3.23 [panel setRequiredFileType: @"vmu"];3.24 VMUCreateValidator *valid = [[VMUCreateValidator alloc] autorelease];3.25 - [panel setDelegate: valid];3.26 + [panel setDelegate: (id)valid];3.27 int result = [panel runModalForDirectory: [NSString stringWithUTF8String: get_gui_path(CONFIG_VMU_PATH)]3.28 file: nil];3.29 if( result == NSFileHandlingPanelOKButton ) {
4.1 --- a/src/cocoaui/cocoa_prefs.m Sun Jan 18 20:00:38 2015 +10004.2 +++ b/src/cocoaui/cocoa_prefs.m Wed Feb 04 08:38:23 2015 +10004.3 @@ -105,7 +105,7 @@4.4 return nil;4.5 } else {4.6 [self setTitle: NS_("Preferences")];4.7 - [self setDelegate: self];4.8 + [self setDelegate: (id)self];4.9 [self setMinSize: NSMakeSize(400,300)];4.10 [self initToolbar];4.11 config_panes[0] = [[LxdreamPrefsPane alloc] initWithFrame: NSMakeRect(0,0,600,400)4.12 @@ -163,7 +163,7 @@4.13 NSArray *values = [NSArray arrayWithObjects: paths, ctrls, hotkeys, nil ];4.14 toolbar_items = [NSDictionary dictionaryWithObjects: values forKeys: toolbar_ids];4.16 - [toolbar setDelegate: self];4.17 + [toolbar setDelegate: (id)self];4.18 [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];4.19 [toolbar setSizeMode: NSToolbarSizeModeSmall];4.20 [toolbar setSelectedItemIdentifier: @"Paths"];
5.1 --- a/src/cocoaui/cocoa_win.m Sun Jan 18 20:00:38 2015 +10005.2 +++ b/src/cocoaui/cocoa_win.m Wed Feb 04 08:38:23 2015 +10005.3 @@ -141,7 +141,7 @@5.4 isGrabbed = NO;5.5 video = (LxdreamVideoView *)video_osx_create_drawable();5.6 [video setFrameOrigin: NSMakePoint(0.0,STATUSBAR_HEIGHT)];5.7 - [video setDelegate: self];5.8 + [video setDelegate: (id)self];5.10 status =5.11 [[NSTextField alloc] initWithFrame: NSMakeRect(0.0,0.0,videoRect.size.width,STATUS_TEXT_HEIGHT)];5.12 @@ -159,13 +159,13 @@5.13 [self setContentBorderThickness: STATUSBAR_HEIGHT forEdge: NSMinYEdge];5.15 // Share the app delegate for the purposes of keeping it in one place5.16 - [self setDelegate: [NSApp delegate]];5.17 + [self setDelegate: (id)[NSApp delegate]];5.18 [self setContentMinSize: contentRect.size];5.19 [self setAcceptsMouseMovedEvents: YES];5.20 [self updateTitle];5.22 NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"LxdreamToolbar"];5.23 - [toolbar setDelegate: [[LxdreamToolbarDelegate alloc] init]];5.24 + [toolbar setDelegate: (id)[[LxdreamToolbarDelegate alloc] init]];5.25 [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];5.26 [toolbar setSizeMode: NSToolbarSizeModeSmall];5.27 [toolbar setSelectedItemIdentifier: @"Pause"];
6.1 --- a/src/cocoaui/cocoaui.h Sun Jan 18 20:00:38 2015 +10006.2 +++ b/src/cocoaui/cocoaui.h Wed Feb 04 08:38:23 2015 +10006.3 @@ -28,6 +28,8 @@6.4 #ifdef __cplusplus6.5 extern "C" {6.6 #endif6.7 +6.8 +struct maple_device;6.10 #define NS_(x) [NSString stringWithUTF8String: _(x)]
7.1 --- a/src/cocoaui/cocoaui.m Sun Jan 18 20:00:38 2015 +10007.2 +++ b/src/cocoaui/cocoaui.m Wed Feb 04 08:38:23 2015 +10007.3 @@ -357,7 +357,7 @@7.4 [NSApplication sharedApplication];7.6 LxdreamDelegate *delegate = [[LxdreamDelegate alloc] init];7.7 - [NSApp setDelegate: delegate];7.8 + [NSApp setDelegate: (id)delegate];7.9 NSString *iconFile = [[NSBundle mainBundle] pathForResource:@"lxdream" ofType:@"png"];7.10 NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile: iconFile];7.11 [iconImage setName: @"NSApplicationIcon"];7.12 @@ -403,7 +403,7 @@7.13 va_list args;7.14 va_start(args, msg);7.15 error_string = [[NSString alloc] initWithFormat: [NSString stringWithCString: msg] arguments: args];7.16 - NSRunAlertPanel(NS_("Error in Lxdream"), error_string, nil, nil, nil);7.17 + NSRunAlertPanel(NS_("Error in Lxdream"), @"%@", nil, nil, nil, error_string);7.18 va_end(args);7.19 return TRUE;7.20 } else {
8.1 --- a/src/display.c Sun Jan 18 20:00:38 2015 +10008.2 +++ b/src/display.c Wed Feb 04 08:38:23 2015 +10008.3 @@ -453,7 +453,6 @@8.5 /***************** System mouse driver ****************/8.7 -static struct keymap_entry *mouse_keymap[MAX_MOUSE_BUTTONS];8.8 static struct mouse_entry *mousehooks = NULL;8.9 static uint32_t mouse_x = -1, mouse_y = -1, mouse_buttons = 0;
9.1 --- a/src/drivers/cdrom/cd_cdi.c Sun Jan 18 20:00:38 2015 +10009.2 +++ b/src/drivers/cdrom/cd_cdi.c Wed Feb 04 08:38:23 2015 +10009.3 @@ -38,7 +38,7 @@9.5 static const char TRACK_START_MARKER[20] = { 0,0,1,0,0,0,255,255,255,255,9.6 0,0,1,0,0,0,255,255,255,255 };9.7 -static const char EXT_MARKER[9] = {0,255,255,255,255,255,255,255,255 };9.8 +//static const char EXT_MARKER[9] = {0,255,255,255,255,255,255,255,255 };9.10 struct cdi_trailer {9.11 uint32_t cdi_version;
10.1 --- a/src/drivers/cdrom/cd_gdi.c Sun Jan 18 20:00:38 2015 +100010.2 +++ b/src/drivers/cdrom/cd_gdi.c Wed Feb 04 08:38:23 2015 +100010.3 @@ -53,7 +53,6 @@10.4 {10.5 int i;10.6 uint32_t track_count;10.7 - struct stat st;10.8 char line[512];10.9 int session = 1;10.10 gchar *dirname;
11.1 --- a/src/drivers/cdrom/cd_mmc.c Sun Jan 18 20:00:38 2015 +100011.2 +++ b/src/drivers/cdrom/cd_mmc.c Wed Feb 04 08:38:23 2015 +100011.3 @@ -35,7 +35,6 @@11.4 int max_track = 0;11.5 int max_session = 0;11.6 int last_track = -1;11.7 - int leadout = -1;11.8 int len = (buf[0] << 8) | buf[1];11.9 int session_type = -1;11.10 int i;11.11 @@ -192,7 +191,6 @@11.13 static cdrom_error_t cdrom_disc_scsi_stop_audio( cdrom_disc_t disc )11.14 {11.15 - uint32_t buflen = 0;11.16 char cmd[12] = {0x4E,0,0,0, 0,0,0,0, 0,0,0,0};11.18 return SCSI_TRANSPORT(disc)->packet_cmd( disc, cmd );
12.1 --- a/src/drivers/cdrom/cd_nrg.c Sun Jan 18 20:00:38 2015 +100012.2 +++ b/src/drivers/cdrom/cd_nrg.c Wed Feb 04 08:38:23 2015 +100012.3 @@ -133,7 +133,7 @@12.4 case 3: return SECTOR_SEMIRAW_MODE2;12.5 case 7: return SECTOR_CDDA;12.6 case 16: return SECTOR_CDDA_SUBCHANNEL;12.7 - default: return -1;12.8 + default: return SECTOR_UNKNOWN;12.9 }12.10 }12.12 @@ -233,7 +233,7 @@12.13 for( i=0; i<count; i++ ) {12.14 uint32_t offset = GUINT32_FROM_BE(dao->track[i].offset);12.15 sector_mode_t mode = nrg_track_mode( dao->track[i].mode );12.16 - if( mode == -1 ) {12.17 + if( mode == SECTOR_UNKNOWN ) {12.18 RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", dao->track[i].mode);12.19 }12.20 if( CDROM_SECTOR_SIZE(mode) != GUINT32_FROM_BE(dao->track[i].sector_size) ) {12.21 @@ -259,7 +259,7 @@12.22 for( i=0; i<count; i++ ) {12.23 uint32_t offset = (uint32_t)GUINT64_FROM_BE(daox->track[i].offset);12.24 sector_mode_t mode = nrg_track_mode( daox->track[i].mode );12.25 - if( mode == -1 ) {12.26 + if( mode == SECTOR_UNKNOWN ) {12.27 RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", daox->track[i].mode);12.28 }12.29 if( CDROM_SECTOR_SIZE(mode) != GUINT32_FROM_BE(daox->track[i].sector_size) ) {12.30 @@ -287,7 +287,7 @@12.31 for( i=0; i < count; i++, etnf++ ) {12.32 uint32_t offset = GUINT32_FROM_BE(etnf->offset);12.33 sector_mode_t mode = nrg_track_mode( GUINT32_FROM_BE(etnf->mode) );12.34 - if( mode == -1 ) {12.35 + if( mode == SECTOR_UNKNOWN ) {12.36 RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", etnf->mode);12.37 }12.38 cdrom_count_t sector_count = GUINT32_FROM_BE(etnf->length) /12.39 @@ -308,7 +308,7 @@12.40 for( i=0; i < count; i++, etn2++ ) {12.41 uint32_t offset = (uint32_t)GUINT64_FROM_BE(etn2->offset);12.42 sector_mode_t mode = nrg_track_mode( GUINT32_FROM_BE(etn2->mode) );12.43 - if( mode == -1 ) {12.44 + if( mode == SECTOR_UNKNOWN ) {12.45 RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", etn2->mode);12.46 }12.47 cdrom_count_t sector_count = (uint32_t)(GUINT64_FROM_BE(etn2->length) /
13.1 --- a/src/drivers/cdrom/cd_osx.c Sun Jan 18 20:00:38 2015 +100013.2 +++ b/src/drivers/cdrom/cd_osx.c Wed Feb 04 08:38:23 2015 +100013.3 @@ -33,8 +33,6 @@13.4 #define MAXTOCENTRIES 600 /* This is a fairly generous overestimate really */13.5 #define MAXTOCSIZE 4 + (MAXTOCENTRIES*11)13.7 -static gboolean cdrom_osx_image_is_valid( FILE *f );13.8 -static cdrom_disc_t cdrom_osx_open_file( FILE *f, const gchar *filename, ERROR *err );13.9 static gboolean cdrom_osx_read_toc( cdrom_disc_t disc, ERROR *err );13.10 static cdrom_error_t cdrom_osx_read_sectors( sector_source_t disc, cdrom_lba_t sector, cdrom_count_t count,13.11 cdrom_read_mode_t mode, unsigned char *buf, size_t *length );13.12 @@ -77,8 +75,6 @@13.14 static cdrom_disc_t cdrom_osx_open( cdrom_drive_t drive, ERROR *err )13.15 {13.16 - cdrom_disc_t result = NULL;13.17 -13.18 osx_cdrom_drive_t osx_drive = osx_cdrom_open_drive(drive->name);13.19 if( osx_drive == NULL ) {13.20 SET_ERROR( err, LX_ERR_FILE_NOOPEN, "Unable to open CDROM drive" );13.21 @@ -106,16 +102,6 @@13.22 osx_register_iokit_notifications();13.23 }13.25 -static gboolean cdrom_osx_image_is_valid( FILE *f )13.26 -{13.27 - return FALSE;13.28 -}13.29 -13.30 -static cdrom_disc_t cdrom_osx_open_file( FILE *f, const gchar *filename, ERROR *err )13.31 -{13.32 - return NULL; /* Not supported */13.33 -}13.34 -13.35 static gboolean cdrom_osx_read_toc( cdrom_disc_t disc, ERROR *err )13.36 {13.37 osx_cdrom_drive_t drive = OSX_DRIVE(disc);13.38 @@ -152,7 +138,7 @@13.39 {13.40 cdrom_disc_t disc = (cdrom_disc_t)source;13.41 int sector_size = 2352;13.42 - char data[CDROM_MAX_SECTOR_SIZE];13.43 + unsigned char data[CDROM_MAX_SECTOR_SIZE];13.44 osx_cdrom_drive_t drive = OSX_DRIVE(disc);13.46 int fh = osx_cdrom_get_media_handle(drive);
14.1 --- a/src/drivers/cdrom/cdrom.c Sun Jan 18 20:00:38 2015 +100014.2 +++ b/src/drivers/cdrom/cdrom.c Wed Feb 04 08:38:23 2015 +100014.3 @@ -161,7 +161,7 @@14.4 {14.5 int type = CDROM_DISC_NONE, i;14.6 for( i=0; i<disc->track_count; i++ ) {14.7 - if( (disc->track[i].flags & TRACK_FLAG_DATA == 0) ) {14.8 + if( ((disc->track[i].flags & TRACK_FLAG_DATA) == 0) ) {14.9 if( type == CDROM_DISC_NONE )14.10 type = CDROM_DISC_AUDIO;14.11 } else if( disc->track[i].source != NULL &&
15.1 --- a/src/drivers/cdrom/drive.h Sun Jan 18 20:00:38 2015 +100015.2 +++ b/src/drivers/cdrom/drive.h Wed Feb 04 08:38:23 2015 +100015.3 @@ -90,6 +90,11 @@15.4 */15.5 cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err );15.7 +/**15.8 + * Scan the system for physical host CD-ROM devices (Platform-specific implementation)15.9 + */15.10 +void cdrom_drive_scan();15.11 +15.12 #ifdef __cplusplus15.13 }15.14 #endif
16.1 --- a/src/drivers/cdrom/isofs.c Sun Jan 18 20:00:38 2015 +100016.2 +++ b/src/drivers/cdrom/isofs.c Wed Feb 04 08:38:23 2015 +100016.3 @@ -190,9 +190,8 @@16.4 return NULL;16.5 }16.7 - char buf[2048];16.8 + unsigned char buf[2048];16.9 cdrom_count_t expect = size/2048;16.10 - cdrom_count_t count = 0;16.11 int fd = file_sector_source_get_fd(source);16.12 source->size = expect;16.13 lseek( fd, 0, SEEK_SET );
17.1 --- a/src/drivers/gl_fbo.c Sun Jan 18 20:00:38 2015 +100017.2 +++ b/src/drivers/gl_fbo.c Wed Feb 04 08:38:23 2015 +100017.3 @@ -298,8 +298,6 @@17.5 static void gl_fbo_destroy_render_buffer( render_buffer_t buffer )17.6 {17.7 - int i,j;17.8 -17.9 gl_fbo_detach_render_buffer( buffer );17.11 if( buffer->buf_id != buffer->tex_id ) {17.12 @@ -344,7 +342,7 @@17.13 static void gl_fbo_load_frame_buffer( frame_buffer_t frame, render_buffer_t buffer )17.14 {17.15 gl_fbo_detach();17.16 - gl_load_frame_buffer( frame, buffer->buf_id );17.17 + gl_frame_buffer_to_tex( frame, buffer->buf_id );17.18 }17.20 static void gl_fbo_display_blank( uint32_t colour )
18.1 --- a/src/drivers/gl_vbo.c Sun Jan 18 20:00:38 2015 +100018.2 +++ b/src/drivers/gl_vbo.c Wed Feb 04 08:38:23 2015 +100018.3 @@ -188,6 +188,7 @@18.5 /************************** vertex_buffer_object *****************************/18.7 +#ifdef ENABLE_VBO18.8 #ifdef GL_ARRAY_BUFFER_ARB18.10 static void *vbo_map( vertex_buffer_t buf, uint32_t size )18.11 @@ -230,6 +231,7 @@18.12 }18.14 #endif18.15 +#endif18.17 /**18.18 * Auto-detect the supported vertex buffer types, and select between them.
19.1 --- a/src/drivers/io_osx.m Sun Jan 18 20:00:38 2015 +100019.2 +++ b/src/drivers/io_osx.m Wed Feb 04 08:38:23 2015 +100019.3 @@ -30,8 +30,6 @@19.4 struct io_osx_cbinfo *next;19.5 };19.7 -static struct io_osx_cbinfo *cbinfo_list = NULL;19.8 -19.9 void io_unregister_callback( struct io_osx_cbinfo *cbinfo )19.10 {19.11 CFRunLoopRemoveSource( CFRunLoopGetCurrent(), cbinfo->sourceRef, kCFRunLoopCommonModes );19.12 @@ -114,7 +112,7 @@19.13 fdContext.version = 0;19.14 fdContext.retain = NULL;19.15 fdContext.info = cbinfo;19.16 - fdContext.release = io_osx_release;19.17 + fdContext.release = ( void (*)(void *) )io_osx_release;19.18 fdContext.copyDescription = NULL;19.20 CFFileDescriptorRef ref = CFFileDescriptorCreate( kCFAllocatorDefault, fd, FALSE,
20.1 --- a/src/drivers/video_gl.c Sun Jan 18 20:00:38 2015 +100020.2 +++ b/src/drivers/video_gl.c Wed Feb 04 08:38:23 2015 +100020.3 @@ -433,7 +433,7 @@20.4 return TRUE;20.5 }20.7 -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id )20.8 +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id )20.9 {20.10 int size = frame->width * frame->height;20.11 uint32_t tmp[size];20.12 @@ -442,7 +442,6 @@20.13 glBindTexture( GL_TEXTURE_2D, tex_id );20.14 glTexSubImage2D( GL_TEXTURE_2D, 0, 0,0, frame->width, frame->height, GL_RGBA, type, tmp );20.15 gl_check_error("gl_load_frame_buffer:glTexSubImage2DBGRA");20.16 - return TRUE;20.17 }20.19 #else20.20 @@ -466,7 +465,7 @@20.21 return TRUE;20.22 }20.24 -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id )20.25 +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id )20.26 {20.27 GLenum type = colour_formats[frame->colour_format].type;20.28 GLenum format = colour_formats[frame->colour_format].format;20.29 @@ -478,10 +477,14 @@20.30 glTexSubImage2DBGRA( 0, 0,0,20.31 frame->width, frame->height, format, type, frame->data, FALSE );20.32 glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );20.33 - return TRUE;20.34 }20.35 #endif20.37 +static void gl_load_frame_buffer( frame_buffer_t frame, render_buffer_t render )20.38 +{20.39 + gl_frame_buffer_to_tex( frame, render->tex_id );20.40 +}20.41 +20.43 gboolean gl_init_driver( display_driver_t driver, gboolean need_fbo )20.44 {20.45 @@ -494,9 +497,9 @@20.46 }20.48 /* Use SL shaders if available */20.49 - gboolean have_shaders = glsl_init(driver);20.50 + glsl_init(driver);20.51 #ifndef HAVE_OPENGL_FIXEDFUNC20.52 - if( !have_shaders ) { /* Shaders are required if we don't have fixed-functionality */20.53 + if( !driver->has_sl ) { /* Shaders are required if we don't have fixed-functionality */20.54 gl_fbo_shutdown();20.55 return FALSE;20.56 }
21.1 --- a/src/drivers/video_gl.h Sun Jan 18 20:00:38 2015 +100021.2 +++ b/src/drivers/video_gl.h Wed Feb 04 08:38:23 2015 +100021.3 @@ -33,7 +33,7 @@21.4 /**21.5 * Generic GL routine to draw the given frame buffer into a texture21.6 */21.7 -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id );21.8 +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id );21.10 /**21.11 * Reset the GL state to its initial values
22.1 --- a/src/gdbserver.c Sun Jan 18 20:00:38 2015 +100022.2 +++ b/src/gdbserver.c Wed Feb 04 08:38:23 2015 +100022.3 @@ -128,7 +128,7 @@22.4 size_t gdb_read_binary_data( struct gdb_server *server, unsigned char *buf, char *data, int datalen )22.5 {22.6 unsigned char *q = buf;22.7 - for( int i=0, j=0; i<datalen; i++ ) {22.8 + for( int i=0; i<datalen; i++ ) {22.9 if( data[i] == 0x7D ) {22.10 if( i == datalen-1 ) {22.11 return -1;
23.1 --- a/src/hotkeys.c Sun Jan 18 20:00:38 2015 +100023.2 +++ b/src/hotkeys.c Wed Feb 04 08:38:23 2015 +100023.3 @@ -28,8 +28,6 @@23.4 #include "config.h"23.6 static void hotkey_key_callback( void *data, uint32_t value, uint32_t pressure, gboolean isKeyDown );23.7 -static gboolean hotkey_config_changed( void *data, lxdream_config_group_t group, unsigned key,23.8 - const gchar *oldval, const gchar *newval );23.10 #define TAG_RESUME 023.11 #define TAG_STOP 1
24.1 --- a/src/loader.c Sun Jan 18 20:00:38 2015 +100024.2 +++ b/src/loader.c Wed Feb 04 08:38:23 2015 +100024.3 @@ -148,7 +148,7 @@24.4 if( disc != NULL ) {24.5 gdrom_mount_disc(disc);24.6 return FILE_DISC;24.7 - } else if( err != LX_ERR_FILE_UNKNOWN ) {24.8 + } else if( !IS_ERROR_CODE(err,LX_ERR_FILE_UNKNOWN) ) {24.9 return FILE_ERROR;24.10 }24.12 @@ -226,26 +226,17 @@24.13 g_free(bootstrap_file);24.14 }24.16 -24.17 -static gboolean is_sh4_elf( Elf32_Ehdr *head )24.18 -{24.19 +static gboolean is_arch( Elf32_Ehdr *head, Elf32_Half mach ) {24.20 return ( head->e_ident[EI_CLASS] == ELFCLASS32 &&24.21 head->e_ident[EI_DATA] == ELFDATA2LSB &&24.22 head->e_ident[EI_VERSION] == 1 &&24.23 head->e_type == ET_EXEC &&24.24 - head->e_machine == EM_SH &&24.25 + head->e_machine == mach &&24.26 head->e_version == 1 );24.27 }24.29 -static gboolean is_arm_elf( Elf32_Ehdr *head )24.30 -{24.31 - return ( head->e_ident[EI_CLASS] == ELFCLASS32 &&24.32 - head->e_ident[EI_DATA] == ELFDATA2LSB &&24.33 - head->e_ident[EI_VERSION] == 1 &&24.34 - head->e_type == ET_EXEC &&24.35 - head->e_machine == EM_ARM &&24.36 - head->e_version == 1 );24.37 -}24.38 +#define is_sh4_elf(head) is_arch(head, EM_SH)24.39 +#define is_arm_elf(head) is_arch(head, EM_ARM)24.41 static gboolean file_load_elf( const gchar *filename, int fd, ERROR *err )24.42 {24.43 @@ -437,7 +428,7 @@24.44 }24.46 /* Load the program into memory */24.47 - char *program = g_malloc0( end-start );24.48 + unsigned char *program = g_malloc0( end-start );24.49 for( i=0; i<head.e_phnum; i++ ) {24.50 if( phdr[i].p_type == PT_LOAD ) {24.51 lseek( fd, phdr[i].p_offset, SEEK_SET );24.52 @@ -458,7 +449,7 @@24.53 static cdrom_disc_t cdrom_wrap_binary( cdrom_disc_type_t type, const gchar *filename, int fd, ERROR *err )24.54 {24.55 struct stat st;24.56 - char *data;24.57 + unsigned char *data;24.58 size_t len;24.60 if( fstat(fd, &st) == -1 ) {
25.1 --- a/src/lxdream.h Sun Jan 18 20:00:38 2015 +100025.2 +++ b/src/lxdream.h Wed Feb 04 08:38:23 2015 +100025.3 @@ -108,7 +108,7 @@25.5 #define SET_ERROR(err, n, ...) if( (err) != NULL ) { (err)->code = n; snprintf( (err)->msg, sizeof((err)->msg), __VA_ARGS__ ); }25.6 #define CLEAR_ERROR(err) do { (err)->code = 0; (err)->msg[0] = 0; } while(0)25.7 -25.8 +#define IS_ERROR_CODE(err, n) ( (err) != NULL && (err)->code == (n) )25.10 #ifdef HAVE_FASTCALL25.11 #define FASTCALL __attribute__((regparm(3)))
26.1 --- a/src/lxpaths.c Sun Jan 18 20:00:38 2015 +100026.2 +++ b/src/lxpaths.c Wed Feb 04 08:38:23 2015 +100026.3 @@ -169,7 +169,6 @@26.5 gchar *get_filename_at( const gchar *at, const gchar *filename )26.6 {26.7 - char tmp[PATH_MAX];26.8 char *p = strrchr( at, '/' );26.9 if( p == NULL ) {26.10 /* No path at all, so just return filename */
27.1 --- a/src/maple/controller.c Sun Jan 18 20:00:38 2015 +100027.2 +++ b/src/maple/controller.c Wed Feb 04 08:38:23 2015 +100027.3 @@ -123,11 +123,6 @@27.4 /* Get the controller_device * from a lxdream_config_group_t */27.5 #define DEV_FROM_CONFIG_GROUP(grp) ((controller_device_t)(((char *)grp) - offsetof( struct controller_device, config )))27.7 -static int config_button_map[] = {27.8 - BUTTON_DPAD_LEFT, BUTTON_DPAD_RIGHT, BUTTON_DPAD_UP, BUTTON_DPAD_DOWN,27.9 - JOY_LEFT, JOY_RIGHT, JOY_UP, JOY_DOWN, BUTTON_X, BUTTON_Y, BUTTON_A,27.10 - BUTTON_B, BUTTON_LEFT_TRIGGER, BUTTON_RIGHT_TRIGGER, BUTTON_START };27.11 -27.12 #define CONTROLLER(x) ((controller_device_t)(x))27.14 static maple_device_t controller_new( )
28.1 --- a/src/maple/lightgun.c Sun Jan 18 20:00:38 2015 +100028.2 +++ b/src/maple/lightgun.c Wed Feb 04 08:38:23 2015 +100028.3 @@ -64,9 +64,6 @@28.4 static void lightgun_start_gun( maple_device_t dev );28.5 static void lightgun_stop_gun( maple_device_t dev );28.7 -static gboolean lightgun_set_config_value( lxdream_config_group_t group, unsigned int key,28.8 - const gchar *oldvalue, const gchar *value );28.9 -28.10 typedef struct lightgun_device {28.11 struct maple_device dev;28.12 uint32_t condition[2];
29.1 --- a/src/maple/vmu.c Sun Jan 18 20:00:38 2015 +100029.2 +++ b/src/maple/vmu.c Wed Feb 04 08:38:23 2015 +100029.3 @@ -62,6 +62,8 @@29.4 const gchar *oldvalue, const gchar *value );29.5 static int vmu_get_condition( maple_device_t dev, int function, unsigned char *outbuf,29.6 unsigned int *outlen );29.7 +static int vmu_set_condition(struct maple_device *dev, int function,29.8 + unsigned char *inbuf, unsigned int buflen);29.9 static int vmu_get_meminfo( maple_device_t dev, int function, unsigned int pt,29.10 unsigned char *outbuf, unsigned int *outlen );29.11 static void vmu_attach(struct maple_device *dev);29.12 @@ -89,7 +91,7 @@29.13 VMU_IDENT, VMU_VERSION,29.14 vmu_get_config,29.15 vmu_attach, vmu_detach, vmu_destroy,29.16 - vmu_clone, NULL, NULL, vmu_get_condition, NULL,29.17 + vmu_clone, NULL, NULL, vmu_get_condition, vmu_set_condition,29.18 vmu_get_meminfo, vmu_read_block, vmu_write_block, NULL, NULL },29.19 NULL, {0},29.20 {"Sega VMU", vmu_set_config_value, NULL, NULL,29.21 @@ -160,7 +162,7 @@29.22 static void vmu_destroy( maple_device_t dev )29.23 {29.24 vmu_device_t vmu = (vmu_device_t)dev;29.25 - free( dev );29.26 + free( vmu );29.27 }29.29 static int vmu_get_condition(struct maple_device *dev, int function,
30.1 --- a/src/pvr2/glrender.c Sun Jan 18 20:00:38 2015 +100030.2 +++ b/src/pvr2/glrender.c Wed Feb 04 08:38:23 2015 +100030.3 @@ -142,7 +142,7 @@30.4 #endif30.7 -#ifdef HAVE_OPENGL_CLEAR_DEPTHF30.8 +#ifdef HAVE_GLES230.9 glClearDepthf(0);30.10 #else30.11 glClearDepth(0);
31.1 --- a/src/pvr2/glutil.c Sun Jan 18 20:00:38 2015 +100031.2 +++ b/src/pvr2/glutil.c Wed Feb 04 08:38:23 2015 +100031.3 @@ -24,8 +24,8 @@31.5 gboolean isOpenGLES2()31.6 {31.7 - const char *str = glGetString(GL_VERSION);31.8 - if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) {31.9 + const GLubyte *str = glGetString(GL_VERSION);31.10 + if( strncmp((const char *)str, "OpenGL ES 2.", 12) == 0 ) {31.11 return TRUE;31.12 }31.13 return FALSE;31.14 @@ -192,7 +192,7 @@31.15 return;31.17 gchar *ext_dup = g_strdup(extensions);31.18 - gchar **ext_split = g_strsplit(g_strstrip(extensions), " ", 0);31.19 + gchar **ext_split = g_strsplit(g_strstrip(ext_dup), " ", 0);31.20 for( count = 0; ext_split[count] != NULL; count++ ) {31.21 unsigned len = strlen(ext_split[count]);31.22 if( len > maxlen )31.23 @@ -264,6 +264,7 @@31.24 return TRUE;31.25 }31.27 +#if 031.28 static int bgra_to_rgba_type( int glFormatType )31.29 {31.30 switch( glFormatType ) {31.31 @@ -278,6 +279,7 @@31.32 return glFormatType;31.33 }31.34 }31.35 +#endif31.37 /**31.38 * Convert BGRA data in buffer to RGBA format in-place (for systems that don't natively31.39 @@ -290,7 +292,6 @@31.40 */31.41 static int bgra_to_rgba( unsigned char *data, unsigned nPixels, int glFormatType )31.42 {31.43 - unsigned i;31.44 switch( glFormatType ) {31.45 case GL_UNSIGNED_SHORT_1_5_5_5_REV: {31.46 uint16_t *p = (uint16_t *)data;31.47 @@ -333,7 +334,7 @@31.48 if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) {31.49 if( preserveData ) {31.50 size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2);31.51 - char buf[size];31.52 + unsigned char buf[size];31.53 memcpy(buf, data, size);31.54 GLint rgbaType = bgra_to_rgba( buf, width*height, type );31.55 glTexImage2D( GL_TEXTURE_2D, level, intFormat, width, height, 0, GL_RGBA, rgbaType,31.56 @@ -354,7 +355,7 @@31.57 if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) {31.58 if( preserveData ) {31.59 size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2);31.60 - char buf[size];31.61 + unsigned char buf[size];31.62 memcpy(buf, data, size);31.63 GLint rgbaType = bgra_to_rgba( buf, width*height, type );31.64 glTexSubImage2D( GL_TEXTURE_2D, level, xoff, yoff, width, height, GL_RGBA, rgbaType,
32.1 --- a/src/pvr2/rendsort.c Sun Jan 18 20:00:38 2015 +100032.2 +++ b/src/pvr2/rendsort.c Wed Feb 04 08:38:23 2015 +100032.3 @@ -171,7 +171,6 @@32.4 {32.5 int i;32.6 for( i=0; i<num_triangles; i++ ) {32.7 - struct polygon_struct *poly = triangles[i]->poly;32.8 gl_render_triangle(triangles[i]->poly, triangles[i]->triangle_num);32.9 }32.10 }32.11 @@ -190,7 +189,6 @@32.12 tri2->bounds[3] <= tri1->bounds[2] )32.13 return 0; /* tri1 and tri2 don't actually overlap at all */32.14 else {32.15 - struct vertex_struct *tri1v = &pvr2_scene.vertex_array[tri1->poly->vertex_index + tri1->triangle_num];32.16 struct vertex_struct *tri2v = &pvr2_scene.vertex_array[tri2->poly->vertex_index + tri2->triangle_num];32.17 float v[3];32.18 int i;
33.1 --- a/src/pvr2/scene.c Sun Jan 18 20:00:38 2015 +100033.2 +++ b/src/pvr2/scene.c Wed Feb 04 08:38:23 2015 +100033.3 @@ -37,11 +37,6 @@33.4 rgba[3] = ((float)(((bgra&0xFF000000)>>24) + 1)) / 256.0;33.5 }33.7 -static inline uint32_t bgra_to_rgba(uint32_t bgra)33.8 -{33.9 - return (bgra&0xFF00FF00) | ((bgra&0x00FF0000)>>16) | ((bgra&0x000000FF)<<16);33.10 -}33.11 -33.12 /**33.13 * Convert a half-float (16-bit) FP number to a regular 32-bit float.33.14 * Source is 1-bit sign, 5-bit exponent, 10-bit mantissa.33.15 @@ -468,7 +463,7 @@33.17 static void scene_add_cheap_shadow_vertexes( struct vertex_struct *src, struct vertex_struct *dest, int count )33.18 {33.19 - unsigned int i, j;33.20 + unsigned int i;33.22 for( i=0; i<count; i++ ) {33.23 dest->x = src->x;
34.1 --- a/src/pvr2/texcache.c Sun Jan 18 20:00:38 2015 +100034.2 +++ b/src/pvr2/texcache.c Wed Feb 04 08:38:23 2015 +100034.3 @@ -261,7 +261,7 @@34.4 int bpp = 2;34.5 uint32_t *palette = (uint32_t *)mmio_region_PVR2PAL.mem;34.6 uint16_t packed_palette[1024];34.7 - char *data = (char *)palette;34.8 + unsigned char *data = (unsigned char *)palette;34.10 switch( texcache_palette_mode ) {34.11 case 0: /* ARGB1555 */34.12 @@ -290,14 +290,14 @@34.13 for( i=0; i<1024; i++ ) {34.14 packed_palette[i] = (uint16_t)palette[i];34.15 }34.16 - data = (char *)packed_palette;34.17 + data = (unsigned char *)packed_palette;34.18 }34.20 glActiveTexture(GL_TEXTURE1);34.21 if( format_changed )34.22 - glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (char *)palette );34.23 + glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (unsigned char *)palette );34.24 else34.25 - glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (char *)palette);34.26 + glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (unsigned char *)palette);34.27 glActiveTexture(GL_TEXTURE0);34.28 texcache_palette_valid = TRUE;34.29 }34.30 @@ -479,16 +479,6 @@34.31 }34.32 }34.34 -static gboolean is_npot_texture( int width )34.35 -{34.36 - while( width != 0 ) {34.37 - if( width & 1 )34.38 - return width != 1;34.39 - width >>= 1;34.40 - }34.41 - return TRUE;34.42 -}34.43 -34.44 /**34.45 * Load texture data from the given address and parameters into the currently34.46 * bound OpenGL texture.34.47 @@ -704,7 +694,6 @@34.48 {34.49 uint32_t texture_addr = (texture_word & 0x000FFFFF)<<3;34.50 uint32_t texture_page = texture_addr >> 12;34.51 - texcache_entry_index next;34.52 texcache_entry_index idx = texcache_page_lookup[texture_page];34.53 while( idx != EMPTY_ENTRY ) {34.54 texcache_entry_t entry = &texcache_active_list[idx];34.55 @@ -809,6 +798,17 @@34.56 }34.58 #if 034.59 +34.60 +static gboolean is_npot_texture( int width )34.61 +{34.62 + while( width != 0 ) {34.63 + if( width & 1 )34.64 + return width != 1;34.65 + width >>= 1;34.66 + }34.67 + return TRUE;34.68 +}34.69 +34.70 render_buffer_t texcache_get_render_buffer( uint32_t texture_addr, int mode, int width, int height )34.71 {34.72 uint32_t texture_word = ((texture_addr >> 3) & 0x000FFFFF) | PVR2_TEX_UNTWIDDLED;34.73 @@ -910,8 +910,8 @@34.74 {34.75 unsigned x,y;34.76 int src_bytes = (width*width>>1);34.77 - char tmp[src_bytes];34.78 - char data[width*width];34.79 + unsigned char tmp[src_bytes];34.80 + unsigned char data[width*width];34.81 pvr2_vram64_read_twiddled_4( tmp, texture_addr, width, width );34.82 decode_pal4_to_pal8( data, tmp, src_bytes );34.83 for( y=0; y<width; y++ ) {
35.1 --- a/src/pvr2/tileiter.h Sun Jan 18 20:00:38 2015 +100035.2 +++ b/src/pvr2/tileiter.h Wed Feb 04 08:38:23 2015 +100035.3 @@ -116,7 +116,7 @@35.4 }35.5 }35.7 -static void tileiter_init( tileiter *it, uint32_t segptr )35.8 +static inline void tileiter_init( tileiter *it, uint32_t segptr )35.9 {35.10 if( IS_TILE_PTR(segptr) ) {35.11 it->ptr = (uint32_t *)(pvr2_main_ram + (segptr & 0x007FFFFF));
36.1 --- a/src/sh4/mmu.c Sun Jan 18 20:00:38 2015 +100036.2 +++ b/src/sh4/mmu.c Wed Feb 04 08:38:23 2015 +100036.3 @@ -424,7 +424,7 @@36.5 static void mmu_set_tlb_enabled( int tlb_on )36.6 {36.7 - mem_region_fn_t *ptr, *uptr;36.8 + mem_region_fn_t *ptr;36.9 int i;36.11 /* Reset the storequeue area */36.12 @@ -819,11 +819,8 @@36.14 static void mmu_utlb_remove_entry( int entry )36.15 {36.16 - int i, j;36.17 struct utlb_entry *ent = &mmu_utlb[entry];36.18 sh4addr_t start_addr = ent->vpn&ent->mask;36.19 - mem_region_fn_t *ptr = &sh4_address_space[start_addr >> 12];36.20 - mem_region_fn_t *uptr = &sh4_user_address_space[start_addr >> 12];36.21 gboolean unmap_user;36.22 int npages = get_tlb_size_pages(ent->flags);
37.1 --- a/src/sh4/sh4trans.c Sun Jan 18 20:00:38 2015 +100037.2 +++ b/src/sh4/sh4trans.c Wed Feb 04 08:38:23 2015 +100037.3 @@ -92,7 +92,7 @@37.4 {37.5 sh4addr_t pc = start;37.6 sh4addr_t lastpc = (pc&0xFFFFF000)+0x1000;37.7 - int done, i;37.8 + int done;37.9 xlat_current_block = xlat_start_block( GET_ICACHE_PHYS(start) );37.10 xlat_output = (uint8_t *)xlat_current_block->code;37.11 xlat_recovery_posn = 0;
38.1 --- a/src/sh4/sh4x86.in Sun Jan 18 20:00:38 2015 +100038.2 +++ b/src/sh4/sh4x86.in Wed Feb 04 08:38:23 2015 +100038.3 @@ -116,7 +116,8 @@38.4 static struct sh4_x86_state sh4_x86;38.6 static uint8_t sh4_entry_stub[128];38.7 -void FASTCALL (*sh4_translate_enter)(void *code);38.8 +typedef FASTCALL void (*entry_point_t)(void *);38.9 +entry_point_t sh4_translate_enter;38.11 static uint32_t max_int = 0x7FFFFFFF;38.12 static uint32_t min_int = 0x80000000;38.13 @@ -171,7 +172,7 @@38.14 POP_r32(REG_EBX);38.15 POP_r32(REG_EBP);38.16 RET();38.17 - sh4_translate_enter = sh4_entry_stub;38.18 + sh4_translate_enter = (entry_point_t)sh4_entry_stub;38.19 }38.21 void sh4_translate_init(void)38.22 @@ -3204,13 +3205,11 @@38.24 void *xlat_get_native_pc( void *code, uint32_t code_size )38.25 {38.26 - struct _Unwind_Exception exc;38.27 struct UnwindInfo info;38.29 info.pc = NULL;38.30 info.block_start = (uintptr_t)code;38.31 info.block_end = info.block_start + code_size;38.32 - void *result = NULL;38.33 _Unwind_Backtrace( xlat_check_frame, &info );38.34 return info.pc;38.35 }
39.1 --- a/src/sh4/shadow.c Sun Jan 18 20:00:38 2015 +100039.2 +++ b/src/sh4/shadow.c Wed Feb 04 08:38:23 2015 +100039.3 @@ -89,7 +89,7 @@39.4 }39.5 }39.7 -static void dump_mem_ops()39.8 +void dump_mem_ops()39.9 {39.10 for( unsigned i=0; i<mem_log_posn; i++ ) {39.11 print_mem_op( stderr, mem_log[i].op, mem_log[i].addr, mem_log[i].value );
40.1 --- a/src/test/testlxpaths.c Sun Jan 18 20:00:38 2015 +100040.2 +++ b/src/test/testlxpaths.c Wed Feb 04 08:38:23 2015 +100040.3 @@ -22,7 +22,7 @@40.4 #include <glib.h>40.5 #include "lxpaths.h"40.7 -char *lxdream_get_global_config_path_value() { }40.8 +char *lxdream_get_global_config_path_value() { return NULL; }40.9 void log_message( void *ptr, int level, const gchar *source, const char *msg, ... ) { }40.11 struct expanded_path_case_t {
41.1 --- a/src/tools/gendec.c Sun Jan 18 20:00:38 2015 +100041.2 +++ b/src/tools/gendec.c Wed Feb 04 08:38:23 2015 +100041.3 @@ -176,7 +176,7 @@41.4 static void fprint_action( struct rule *rule, const struct action *action, int depth, FILE *f )41.5 {41.6 int i;41.7 - if( action == NULL ) {41.8 + if( action == NULL || action->text == NULL ) {41.9 fprintf( f, "%*cUNIMP(ir); /* %s */\n", depth*8, ' ', rule->format );41.10 } else {41.11 fprintf( f, "%*c{ /* %s */", depth*8, ' ', rule->format );41.12 @@ -292,7 +292,9 @@41.13 if( emit_warnings ) {41.14 check_actions( rules, token );41.15 }41.16 + fprintf( out, "#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wunused-variable\"\n" );41.17 split_and_generate( rules, token->actions, ruleidx, rules->rule_count, 0, 1, out );41.18 + fprintf( out, "#pragma clang diagnostic pop\n" );41.19 }41.20 token = action_file_next(af);41.21 }
42.1 --- a/src/tools/genmach.c Sun Jan 18 20:00:38 2015 +100042.2 +++ b/src/tools/genmach.c Wed Feb 04 08:38:23 2015 +100042.3 @@ -72,7 +72,7 @@42.4 if( q == NULL ) {42.5 return g_strdup_printf("%s%s", p, ext);42.6 } else {42.7 - return g_strdup_printf("%.*s%s", q-p, p, ext );42.8 + return g_strdup_printf("%.*s%s", (int)(q-p), p, ext );42.9 }42.10 }42.12 @@ -136,9 +136,9 @@42.13 }42.14 }42.16 -char *build_page_initializer( regblock_t block )42.17 +unsigned char *build_page_initializer( regblock_t block )42.18 {42.19 - char *page = g_malloc(LXDREAM_PAGE_SIZE);42.20 + unsigned char *page = g_malloc(LXDREAM_PAGE_SIZE);42.22 /* First, background fill if any */42.23 if( block->flags.fillSizeBytes == 0 ) {42.24 @@ -240,7 +240,7 @@42.25 fprintf( f, " mmio_region_%s_read_word, mmio_region_%s_write_word,\n", block->name, block->name );42.26 fprintf( f, " mmio_region_%s_read_byte, mmio_region_%s_write_byte,\n", block->name, block->name );42.27 fprintf( f, " mmio_region_%s_read_burst, mmio_region_%s_write_burst,\n", block->name, block->name );42.28 - fprintf( f, " unmapped_prefetch, mmio_region_%s_read_byte },\n", block->name, block->name );42.29 + fprintf( f, " unmapped_prefetch, mmio_region_%s_read_byte },\n", block->name );42.30 fprintf( f, " NULL, NULL, {\n" );42.31 for( unsigned i=0; i<block->numRegs; i++ ) {42.32 regdef_t reg = block->regs[i];42.33 @@ -362,7 +362,7 @@42.34 }42.36 for( GList *ptr = block_list; ptr != NULL; ptr = ptr->next ) {42.37 - char *data = build_page_initializer((regblock_t)ptr->data);42.38 + unsigned char *data = build_page_initializer((regblock_t)ptr->data);42.39 fwrite_dump( data, LXDREAM_PAGE_SIZE, stdout );42.40 g_free(data);42.41 }
43.1 --- a/src/tools/mdparse.c Sun Jan 18 20:00:38 2015 +100043.2 +++ b/src/tools/mdparse.c Wed Feb 04 08:38:23 2015 +100043.3 @@ -107,7 +107,7 @@43.4 int yyline;43.5 int yycol;43.6 union {43.7 - long i;43.8 + uint64_t i;43.9 char *s;43.10 } v;43.11 int slen;43.12 @@ -126,7 +126,7 @@43.14 #define YYPARSE_ERROR( msg, ... ) \43.15 do { \43.16 - fprintf( stderr, "Parse error in %s:%d:%d: " msg "\n", yystate.yyfilename, yytok.yyline, yytok.yycol, __VA_ARGS__ ); \43.17 + fprintf( stderr, "Parse error in %s:%d:%d: " msg "\n", yystate.yyfilename, yytok.yyline, yytok.yycol, ## __VA_ARGS__ ); \43.18 exit(2); \43.19 } while(0)43.21 @@ -159,14 +159,14 @@43.22 return strncasecmp(yytok.yytext, cmp, yytok.yylength);43.23 }43.25 -static int yymatch( const char *arr[], unsigned numOptions )43.26 +static int yymatch( const char *arr[], unsigned numOptions, const char *desc )43.27 {43.28 for( unsigned i=0; i<numOptions; i++ ) {43.29 if( yystrcasecmp( arr[i] ) == 0 ) {43.30 return i;43.31 }43.32 }43.33 - return -1;43.34 + YYPARSE_ERROR( "Unknown %s '%s'", desc, yystrdup() );43.35 }43.37 static gint register_block_sort_cb( gconstpointer a, gconstpointer b )43.38 @@ -190,9 +190,9 @@43.39 if( tok == TOK_INTEGER ) {43.40 apv->i = yytok.v.i;43.41 if( *numBytes == 0 ) {43.42 - YYPARSE_ERROR( "Expected string initializer but was an integer (0x%x)", yytok.v.i );43.43 + YYPARSE_ERROR( "Expected string initializer but was an integer (0x%llx)", yytok.v.i );43.44 }43.45 - } else if( tok = TOK_STRING ) {43.46 + } else if( tok == TOK_STRING ) {43.47 if( *numBytes == 0 ) {43.48 *numBytes = yytok.slen;43.49 apv->s = yytok.v.s;43.50 @@ -224,10 +224,7 @@43.51 case TOK_ACCESS:43.52 READ(TOK_EQUALS);43.53 READ(TOK_IDENTIFIER);43.54 - flags->access = yymatch(ACCESS_NAMES,elementsof(ACCESS_NAMES));43.55 - if( flags->access == -1 ) {43.56 - YYPARSE_ERROR("Unknown access mode '%s'", yystrdup());43.57 - }43.58 + flags->access = yymatch(ACCESS_NAMES,elementsof(ACCESS_NAMES), "access mode");43.59 break;43.60 case TOK_MASK:43.61 if( numBytes ) {43.62 @@ -235,32 +232,23 @@43.63 tok = iolex(TOK_INTEGER);43.64 ioparse_apval( tok, &flags->maskValue, numBytes );43.65 } else {43.66 - YYPARSE_ERROR("mask is not valid on a register block",0);43.67 + YYPARSE_ERROR("mask is not valid on a register block");43.68 }43.69 break;43.70 case TOK_ENDIAN:43.71 READ(TOK_EQUALS);43.72 READ(TOK_IDENTIFIER);43.73 - flags->endian = yymatch(ENDIAN_NAMES,elementsof(ENDIAN_NAMES));43.74 - if( flags->endian == -1 ) {43.75 - YYPARSE_ERROR("Unknown endianness '%s'", yystrdup());43.76 - }43.77 + flags->endian = yymatch(ENDIAN_NAMES,elementsof(ENDIAN_NAMES), "endianness");43.78 break;43.79 case TOK_TRACE:43.80 READ(TOK_EQUALS);43.81 READ(TOK_IDENTIFIER);43.82 - flags->traceFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES));43.83 - if( flags->traceFlag == -1 ) {43.84 - YYPARSE_ERROR("Unknown trace flag '%s'", yystrdup());43.85 - }43.86 + flags->traceFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES), "trace flags");43.87 break;43.88 case TOK_TEST:43.89 READ(TOK_EQUALS);43.90 READ(TOK_IDENTIFIER);43.91 - flags->testFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES));43.92 - if( flags->testFlag == -1 ) {43.93 - YYPARSE_ERROR("Unknown test flag '%s'", yystrdup());43.94 - }43.95 + flags->testFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES), "test flag");43.96 break;43.97 case TOK_COMMA:43.98 break;43.99 @@ -274,17 +262,17 @@43.101 static void ioparse_regdef( struct regdef *reg )43.102 {43.103 - reg->offset = yytok.v.i;43.104 + reg->offset = (uint32_t)yytok.v.i;43.105 reg->numElements = 1;43.106 reg->numBytes = 0;43.107 reg->initValue.i = 0;43.108 reg->flags.maskValue.i = -1;43.109 - unsigned rangeOffset = reg->offset;43.110 + uint32_t rangeOffset = reg->offset;43.112 int tok = iolex(TOK_COLON);43.113 if( tok == TOK_RANGE ) {43.114 READ(TOK_INTEGER);43.115 - rangeOffset = yytok.v.i;43.116 + rangeOffset = (uint32_t)yytok.v.i;43.117 if( rangeOffset < reg->offset ) {43.118 YYPARSE_ERROR( "Range end (0x%x) must be greater than the range start (0x%x)", rangeOffset, reg->offset );43.119 }43.120 @@ -293,10 +281,7 @@43.121 YYPARSE_ERROR( "Expected ':' but was %s\n", TOKEN_NAMES[tok] );43.122 }43.123 READ(TOK_IDENTIFIER);43.124 - reg->mode = yymatch(MODE_NAMES, elementsof(MODE_NAMES));43.125 - if( reg->mode == -1 ) {43.126 - YYPARSE_ERROR( "Unknown register mode '%s'", yystrdup() );43.127 - }43.128 + reg->mode = yymatch(MODE_NAMES, elementsof(MODE_NAMES), "register mode");43.129 if( reg->mode == REG_MIRROR ) {43.130 /* Mirror regions have a target range only */43.131 READ(TOK_INTEGER);43.132 @@ -306,14 +291,14 @@43.133 if( tok == TOK_RANGE ) {43.134 READ(TOK_INTEGER);43.135 if( yytok.v.i < reg->initValue.i ) {43.136 - YYPARSE_ERROR( "Invalid mirror target range 0x%x..0x%x", reg->initValue.i, yytok.v.i );43.137 + YYPARSE_ERROR( "Invalid mirror target range 0x%llx..0x%llx", reg->initValue.i, yytok.v.i );43.138 }43.139 - reg->numBytes = yytok.v.i - reg->initValue.i + 1;43.140 + reg->numBytes = (uint32_t)(yytok.v.i - reg->initValue.i + 1);43.141 tok = iolex(TOK_STRIDE);43.142 }43.143 if( tok == TOK_STRIDE ) {43.144 READ(TOK_INTEGER);43.145 - reg->stride = yytok.v.i;43.146 + reg->stride = (uint32_t)yytok.v.i;43.147 tok = iolex(TOK_ACTION);43.148 } else {43.149 reg->stride = reg->numBytes;43.150 @@ -333,10 +318,7 @@43.152 } else {43.153 READ(TOK_IDENTIFIER);43.154 - reg->type = yymatch(TYPE_NAMES, elementsof(TYPE_NAMES));43.155 - if( reg->type == -1 ) {43.156 - YYPARSE_ERROR( "Unknown register type '%s'", yystrdup() );43.157 - }43.158 + reg->type = yymatch(TYPE_NAMES, elementsof(TYPE_NAMES), "register type");43.159 reg->numBytes = TYPE_SIZES[reg->type];43.160 tok = iolex(TOK_IDENTIFIER);43.161 if( tok == TOK_IDENTIFIER ) {43.162 @@ -361,7 +343,7 @@43.163 }43.164 tok = iolex(TOK_ACTION);43.165 } else if( reg->type == REG_STRING ) {43.166 - YYPARSE_ERROR( "String declarations must have an initializer (ie = 'abcd')",0 );43.167 + YYPARSE_ERROR( "String declarations must have an initializer (ie = 'abcd')" );43.168 }43.169 if( tok == TOK_ACTION ) {43.170 // reg->action = yystrdup();43.171 @@ -393,7 +375,7 @@43.172 YYPARSE_ERROR("Expected AT but got %s\n", TOKEN_NAMES[tok] );43.173 }43.174 READ(TOK_INTEGER);43.175 - block->address = yytok.v.i;43.176 + block->address = (uint32_t)yytok.v.i;43.178 tok = iolex(TOK_LBRACE);43.179 if( tok == TOK_LPAREN) {43.180 @@ -450,7 +432,7 @@43.181 free(tmp);43.182 } else if( tok == TOK_SPACE ) {43.183 } else if( tok == TOK_REGISTERS ) {43.184 - struct regblock *block = ioparse_regblock(block);43.185 + struct regblock *block = ioparse_regblock();43.186 count++;43.187 blocks = g_list_insert_sorted(blocks, block, register_block_sort_cb);43.188 } else {43.189 @@ -638,7 +620,7 @@43.190 while( yystate.yyposn < yystate.yyend && isdigit(*yystate.yyposn) )43.191 yystate.yyposn++;43.192 }43.193 - yytok.v.i = strtol( yystart, NULL, 0 );43.194 + yytok.v.i = strtoll( yystart, NULL, 0 );43.195 YYRETURN(TOK_INTEGER);43.196 } else if( isalpha(ch) || ch == '_' ) {43.197 /* IDENTIFIER */
44.1 --- a/src/xlat/disasm/i386-dis.c Sun Jan 18 20:00:38 2015 +100044.2 +++ b/src/xlat/disasm/i386-dis.c Wed Feb 04 08:38:23 2015 +100044.3 @@ -3019,32 +3019,32 @@44.4 if (prefixes & PREFIX_CS)44.5 {44.6 used_prefixes |= PREFIX_CS;44.7 - oappend ("%cs:" + intel_syntax);44.8 + oappend ( &"%cs:"[(int)intel_syntax]);44.9 }44.10 if (prefixes & PREFIX_DS)44.11 {44.12 used_prefixes |= PREFIX_DS;44.13 - oappend ("%ds:" + intel_syntax);44.14 + oappend (&"%ds:"[(int)intel_syntax]);44.15 }44.16 if (prefixes & PREFIX_SS)44.17 {44.18 used_prefixes |= PREFIX_SS;44.19 - oappend ("%ss:" + intel_syntax);44.20 + oappend (&"%ss:"[(int)intel_syntax]);44.21 }44.22 if (prefixes & PREFIX_ES)44.23 {44.24 used_prefixes |= PREFIX_ES;44.25 - oappend ("%es:" + intel_syntax);44.26 + oappend (&"%es:"[(int)intel_syntax]);44.27 }44.28 if (prefixes & PREFIX_FS)44.29 {44.30 used_prefixes |= PREFIX_FS;44.31 - oappend ("%fs:" + intel_syntax);44.32 + oappend (&"%fs:"[(int)intel_syntax]);44.33 }44.34 if (prefixes & PREFIX_GS)44.35 {44.36 used_prefixes |= PREFIX_GS;44.37 - oappend ("%gs:" + intel_syntax);44.38 + oappend (&"%gs:"[(int)intel_syntax]);44.39 }44.40 }44.42 @@ -3898,7 +3898,7 @@44.43 oappend ("BYTE PTR ");44.44 }44.46 - oappend ("%es:" + intel_syntax);44.47 + oappend (&"%es:"[(int)intel_syntax]);44.48 ptr_reg (code, sizeflag);44.49 }
45.1 --- a/src/xlat/xltcache.c Sun Jan 18 20:00:38 2015 +100045.2 +++ b/src/xlat/xltcache.c Wed Feb 04 08:38:23 2015 +100045.3 @@ -678,7 +678,6 @@45.5 unsigned int xlat_get_cache_blocks_by_activity( xlat_block_ref_t outblocks, size_t topN )45.6 {45.7 - int i=0;45.8 int count = xlat_get_active_block_count();45.10 struct xlat_block_ref blocks[count];
.