# HG changeset patch # User nkeynes # Date 1423003103 -36000 # Node ID d0eb2307b84714438d99b5366fe030efe35d2945 # Parent 7e98a164b2d9c0bb9457df409e667df85995d70a Fix assorted compile warnings reported by Clang --- a/src/bios.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/bios.c Wed Feb 04 08:38:23 2015 +1000 @@ -213,12 +213,12 @@ * Locate the active config block. FIXME: This isn't completely correct, but it works * under at least some circumstances. */ -static char *bios_find_flash_config( sh4addr_t segment, uint32_t length ) +static sh4ptr_t bios_find_flash_config( sh4addr_t segment, uint32_t length ) { - char *start = mem_get_region(segment); - char *p = start + 0x80; - char *end = p + length; - char *result = NULL; + sh4ptr_t start = mem_get_region(segment); + sh4ptr_t p = start + 0x80; + sh4ptr_t end = p + length; + sh4ptr_t result = NULL; if( memcmp( start, FLASH_PARTITION_MAGIC, 16 ) != 0 ) return NULL; /* Missing magic */ @@ -236,8 +236,8 @@ */ static void bios_sysinfo_vector( uint32_t syscallid ) { - char *flash_segment, *flash_config; - char *dest; + sh4ptr_t flash_segment, flash_config; + sh4ptr_t dest; DEBUG( "BIOS SYSINFO: r4 = %08X, r5 = %08X, r6 = %08x, r7= %08X", sh4r.r[4], sh4r.r[5], sh4r.r[6], sh4r.r[7] ); switch( sh4r.r[7] ) { @@ -269,7 +269,6 @@ static void bios_flashrom_vector( uint32_t syscallid ) { - char *dest; DEBUG( "BIOS FLASHROM: r4 = %08X, r5 = %08X, r6 = %08x, r7= %08X", sh4r.r[4], sh4r.r[5], sh4r.r[6], sh4r.r[7] ); switch( sh4r.r[7] ) { @@ -413,7 +412,7 @@ } else if( iso_file_source_open(file) == 1 ) { size_t len; if( unscramble ) { - char *tmp = g_malloc(st.st_size); + unsigned char *tmp = g_malloc(st.st_size); len = iso_file_source_read(file, tmp, st.st_size); bootprogram_unscramble(buffer, tmp, st.st_size); g_free(tmp); @@ -453,7 +452,6 @@ ERROR( "Disc is not bootable" ); return FALSE; } - uint32_t lba = track->lba; uint32_t sectors = cdrom_disc_get_track_size(disc,track); if( sectors < MIN_ISO_SECTORS ) { ERROR( "Disc is not bootable" ); --- a/src/cocoaui/cocoa_cfg.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoa_cfg.m Wed Feb 04 08:38:23 2015 +1000 @@ -249,7 +249,7 @@ - (void)openFileDialog: (id)sender { int tag = [sender tag]; - NSString *text = [fields[tag][0] stringValue]; + /* NSString *text = [fields[tag][0] stringValue]; */ NSOpenPanel *panel = [NSOpenPanel openPanel]; int result = [panel runModalForDirectory: nil file: nil types: nil]; if( result == NSOKButton && [[panel filenames] count] > 0 ) { @@ -263,7 +263,7 @@ - (void)openDirDialog: (id)sender { int tag = [sender tag]; - NSString *text = [fields[tag][0] stringValue]; + /* NSString *text = [fields[tag][0] stringValue]; */ NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setCanChooseDirectories: YES]; [panel setCanCreateDirectories: YES]; @@ -313,14 +313,14 @@ fields[i][0] = [[KeyBindingField alloc] initWithFrame: frame]; [fields[i][0] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)]; [fields[i][0] setTag: i]; - [fields[i][0] setDelegate: self]; + [fields[i][0] setDelegate: (id)self]; [self addSubview: fields[i][0]]; frame = NSMakeRect( x + labelWidth + KEYBINDING_SIZE + (TEXT_GAP*2), y, KEYBINDING_SIZE, TEXT_HEIGHT); fields[i][1] = [[KeyBindingField alloc] initWithFrame: frame]; [fields[i][1] setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)]; [fields[i][1] setTag: i]; - [fields[i][1] setDelegate: self]; + [fields[i][1] setDelegate: (id)self]; [self addSubview: fields[i][1]]; if( config->params[i].value != NULL ) { @@ -341,7 +341,7 @@ NSTextField *field = [[NSTextField alloc] initWithFrame: frame]; [field setTag: i]; [field setStringValue: [NSString stringWithCString: config->params[i].value]]; - [field setDelegate: self]; + [field setDelegate: (id)self]; [field setAutoresizingMask: (NSViewMinYMargin|NSViewWidthSizable)]; frame = NSMakeRect( x+ labelWidth + fieldWidth + (TEXT_GAP*2), y, TEXT_HEIGHT, TEXT_HEIGHT ); --- a/src/cocoaui/cocoa_ctrl.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoa_ctrl.m Wed Feb 04 08:38:23 2015 +1000 @@ -220,7 +220,7 @@ if( [super initWithFrame: frameRect title: NS_("Controllers")] == nil ) { return nil; } else { - int i,j; + int i; int y = [self contentHeight] - TEXT_HEIGHT - TEXT_GAP; memset( radio, 0, sizeof(radio) ); @@ -320,7 +320,7 @@ NSArray *array = [NSArray arrayWithObjects: @"vmu", nil]; NSOpenPanel *panel = [NSOpenPanel openPanel]; VMULoadValidator *valid = [[VMULoadValidator alloc] autorelease]; - [panel setDelegate: valid]; + [panel setDelegate: (id)valid]; int result = [panel runModalForDirectory: [NSString stringWithUTF8String: get_gui_path(CONFIG_VMU_PATH)] file: nil types: array]; if( result == NSOKButton ) { @@ -340,7 +340,7 @@ [panel setCanCreateDirectories: YES]; [panel setRequiredFileType: @"vmu"]; VMUCreateValidator *valid = [[VMUCreateValidator alloc] autorelease]; - [panel setDelegate: valid]; + [panel setDelegate: (id)valid]; int result = [panel runModalForDirectory: [NSString stringWithUTF8String: get_gui_path(CONFIG_VMU_PATH)] file: nil]; if( result == NSFileHandlingPanelOKButton ) { --- a/src/cocoaui/cocoa_prefs.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoa_prefs.m Wed Feb 04 08:38:23 2015 +1000 @@ -105,7 +105,7 @@ return nil; } else { [self setTitle: NS_("Preferences")]; - [self setDelegate: self]; + [self setDelegate: (id)self]; [self setMinSize: NSMakeSize(400,300)]; [self initToolbar]; config_panes[0] = [[LxdreamPrefsPane alloc] initWithFrame: NSMakeRect(0,0,600,400) @@ -163,7 +163,7 @@ NSArray *values = [NSArray arrayWithObjects: paths, ctrls, hotkeys, nil ]; toolbar_items = [NSDictionary dictionaryWithObjects: values forKeys: toolbar_ids]; - [toolbar setDelegate: self]; + [toolbar setDelegate: (id)self]; [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly]; [toolbar setSizeMode: NSToolbarSizeModeSmall]; [toolbar setSelectedItemIdentifier: @"Paths"]; --- a/src/cocoaui/cocoa_win.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoa_win.m Wed Feb 04 08:38:23 2015 +1000 @@ -141,7 +141,7 @@ isGrabbed = NO; video = (LxdreamVideoView *)video_osx_create_drawable(); [video setFrameOrigin: NSMakePoint(0.0,STATUSBAR_HEIGHT)]; - [video setDelegate: self]; + [video setDelegate: (id)self]; status = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0,0.0,videoRect.size.width,STATUS_TEXT_HEIGHT)]; @@ -159,13 +159,13 @@ [self setContentBorderThickness: STATUSBAR_HEIGHT forEdge: NSMinYEdge]; // Share the app delegate for the purposes of keeping it in one place - [self setDelegate: [NSApp delegate]]; + [self setDelegate: (id)[NSApp delegate]]; [self setContentMinSize: contentRect.size]; [self setAcceptsMouseMovedEvents: YES]; [self updateTitle]; NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"LxdreamToolbar"]; - [toolbar setDelegate: [[LxdreamToolbarDelegate alloc] init]]; + [toolbar setDelegate: (id)[[LxdreamToolbarDelegate alloc] init]]; [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly]; [toolbar setSizeMode: NSToolbarSizeModeSmall]; [toolbar setSelectedItemIdentifier: @"Pause"]; --- a/src/cocoaui/cocoaui.h Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoaui.h Wed Feb 04 08:38:23 2015 +1000 @@ -28,6 +28,8 @@ #ifdef __cplusplus extern "C" { #endif + +struct maple_device; #define NS_(x) [NSString stringWithUTF8String: _(x)] --- a/src/cocoaui/cocoaui.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/cocoaui/cocoaui.m Wed Feb 04 08:38:23 2015 +1000 @@ -357,7 +357,7 @@ [NSApplication sharedApplication]; LxdreamDelegate *delegate = [[LxdreamDelegate alloc] init]; - [NSApp setDelegate: delegate]; + [NSApp setDelegate: (id)delegate]; NSString *iconFile = [[NSBundle mainBundle] pathForResource:@"lxdream" ofType:@"png"]; NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile: iconFile]; [iconImage setName: @"NSApplicationIcon"]; @@ -403,7 +403,7 @@ va_list args; va_start(args, msg); error_string = [[NSString alloc] initWithFormat: [NSString stringWithCString: msg] arguments: args]; - NSRunAlertPanel(NS_("Error in Lxdream"), error_string, nil, nil, nil); + NSRunAlertPanel(NS_("Error in Lxdream"), @"%@", nil, nil, nil, error_string); va_end(args); return TRUE; } else { --- a/src/display.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/display.c Wed Feb 04 08:38:23 2015 +1000 @@ -453,7 +453,6 @@ /***************** System mouse driver ****************/ -static struct keymap_entry *mouse_keymap[MAX_MOUSE_BUTTONS]; static struct mouse_entry *mousehooks = NULL; static uint32_t mouse_x = -1, mouse_y = -1, mouse_buttons = 0; --- a/src/drivers/cdrom/cd_cdi.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cd_cdi.c Wed Feb 04 08:38:23 2015 +1000 @@ -38,7 +38,7 @@ static const char TRACK_START_MARKER[20] = { 0,0,1,0,0,0,255,255,255,255, 0,0,1,0,0,0,255,255,255,255 }; -static const char EXT_MARKER[9] = {0,255,255,255,255,255,255,255,255 }; +//static const char EXT_MARKER[9] = {0,255,255,255,255,255,255,255,255 }; struct cdi_trailer { uint32_t cdi_version; --- a/src/drivers/cdrom/cd_gdi.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cd_gdi.c Wed Feb 04 08:38:23 2015 +1000 @@ -53,7 +53,6 @@ { int i; uint32_t track_count; - struct stat st; char line[512]; int session = 1; gchar *dirname; --- a/src/drivers/cdrom/cd_mmc.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cd_mmc.c Wed Feb 04 08:38:23 2015 +1000 @@ -35,7 +35,6 @@ int max_track = 0; int max_session = 0; int last_track = -1; - int leadout = -1; int len = (buf[0] << 8) | buf[1]; int session_type = -1; int i; @@ -192,7 +191,6 @@ static cdrom_error_t cdrom_disc_scsi_stop_audio( cdrom_disc_t disc ) { - uint32_t buflen = 0; char cmd[12] = {0x4E,0,0,0, 0,0,0,0, 0,0,0,0}; return SCSI_TRANSPORT(disc)->packet_cmd( disc, cmd ); --- a/src/drivers/cdrom/cd_nrg.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cd_nrg.c Wed Feb 04 08:38:23 2015 +1000 @@ -133,7 +133,7 @@ case 3: return SECTOR_SEMIRAW_MODE2; case 7: return SECTOR_CDDA; case 16: return SECTOR_CDDA_SUBCHANNEL; - default: return -1; + default: return SECTOR_UNKNOWN; } } @@ -233,7 +233,7 @@ for( i=0; itrack[i].offset); sector_mode_t mode = nrg_track_mode( dao->track[i].mode ); - if( mode == -1 ) { + if( mode == SECTOR_UNKNOWN ) { RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", dao->track[i].mode); } if( CDROM_SECTOR_SIZE(mode) != GUINT32_FROM_BE(dao->track[i].sector_size) ) { @@ -259,7 +259,7 @@ for( i=0; itrack[i].offset); sector_mode_t mode = nrg_track_mode( daox->track[i].mode ); - if( mode == -1 ) { + if( mode == SECTOR_UNKNOWN ) { RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", daox->track[i].mode); } if( CDROM_SECTOR_SIZE(mode) != GUINT32_FROM_BE(daox->track[i].sector_size) ) { @@ -287,7 +287,7 @@ for( i=0; i < count; i++, etnf++ ) { uint32_t offset = GUINT32_FROM_BE(etnf->offset); sector_mode_t mode = nrg_track_mode( GUINT32_FROM_BE(etnf->mode) ); - if( mode == -1 ) { + if( mode == SECTOR_UNKNOWN ) { RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", etnf->mode); } cdrom_count_t sector_count = GUINT32_FROM_BE(etnf->length) / @@ -308,7 +308,7 @@ for( i=0; i < count; i++, etn2++ ) { uint32_t offset = (uint32_t)GUINT64_FROM_BE(etn2->offset); sector_mode_t mode = nrg_track_mode( GUINT32_FROM_BE(etn2->mode) ); - if( mode == -1 ) { + if( mode == SECTOR_UNKNOWN ) { RETURN_PARSE_ERROR("Unknown track mode in NRG image file (%d)", etn2->mode); } cdrom_count_t sector_count = (uint32_t)(GUINT64_FROM_BE(etn2->length) / --- a/src/drivers/cdrom/cd_osx.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cd_osx.c Wed Feb 04 08:38:23 2015 +1000 @@ -33,8 +33,6 @@ #define MAXTOCENTRIES 600 /* This is a fairly generous overestimate really */ #define MAXTOCSIZE 4 + (MAXTOCENTRIES*11) -static gboolean cdrom_osx_image_is_valid( FILE *f ); -static cdrom_disc_t cdrom_osx_open_file( FILE *f, const gchar *filename, ERROR *err ); static gboolean cdrom_osx_read_toc( cdrom_disc_t disc, ERROR *err ); static cdrom_error_t cdrom_osx_read_sectors( sector_source_t disc, cdrom_lba_t sector, cdrom_count_t count, cdrom_read_mode_t mode, unsigned char *buf, size_t *length ); @@ -77,8 +75,6 @@ static cdrom_disc_t cdrom_osx_open( cdrom_drive_t drive, ERROR *err ) { - cdrom_disc_t result = NULL; - osx_cdrom_drive_t osx_drive = osx_cdrom_open_drive(drive->name); if( osx_drive == NULL ) { SET_ERROR( err, LX_ERR_FILE_NOOPEN, "Unable to open CDROM drive" ); @@ -106,16 +102,6 @@ osx_register_iokit_notifications(); } -static gboolean cdrom_osx_image_is_valid( FILE *f ) -{ - return FALSE; -} - -static cdrom_disc_t cdrom_osx_open_file( FILE *f, const gchar *filename, ERROR *err ) -{ - return NULL; /* Not supported */ -} - static gboolean cdrom_osx_read_toc( cdrom_disc_t disc, ERROR *err ) { osx_cdrom_drive_t drive = OSX_DRIVE(disc); @@ -152,7 +138,7 @@ { cdrom_disc_t disc = (cdrom_disc_t)source; int sector_size = 2352; - char data[CDROM_MAX_SECTOR_SIZE]; + unsigned char data[CDROM_MAX_SECTOR_SIZE]; osx_cdrom_drive_t drive = OSX_DRIVE(disc); int fh = osx_cdrom_get_media_handle(drive); --- a/src/drivers/cdrom/cdrom.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/cdrom.c Wed Feb 04 08:38:23 2015 +1000 @@ -161,7 +161,7 @@ { int type = CDROM_DISC_NONE, i; for( i=0; itrack_count; i++ ) { - if( (disc->track[i].flags & TRACK_FLAG_DATA == 0) ) { + if( ((disc->track[i].flags & TRACK_FLAG_DATA) == 0) ) { if( type == CDROM_DISC_NONE ) type = CDROM_DISC_AUDIO; } else if( disc->track[i].source != NULL && --- a/src/drivers/cdrom/drive.h Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/drive.h Wed Feb 04 08:38:23 2015 +1000 @@ -90,6 +90,11 @@ */ cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err ); +/** + * Scan the system for physical host CD-ROM devices (Platform-specific implementation) + */ +void cdrom_drive_scan(); + #ifdef __cplusplus } #endif --- a/src/drivers/cdrom/isofs.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/cdrom/isofs.c Wed Feb 04 08:38:23 2015 +1000 @@ -190,9 +190,8 @@ return NULL; } - char buf[2048]; + unsigned char buf[2048]; cdrom_count_t expect = size/2048; - cdrom_count_t count = 0; int fd = file_sector_source_get_fd(source); source->size = expect; lseek( fd, 0, SEEK_SET ); --- a/src/drivers/gl_fbo.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/gl_fbo.c Wed Feb 04 08:38:23 2015 +1000 @@ -298,8 +298,6 @@ static void gl_fbo_destroy_render_buffer( render_buffer_t buffer ) { - int i,j; - gl_fbo_detach_render_buffer( buffer ); if( buffer->buf_id != buffer->tex_id ) { @@ -344,7 +342,7 @@ static void gl_fbo_load_frame_buffer( frame_buffer_t frame, render_buffer_t buffer ) { gl_fbo_detach(); - gl_load_frame_buffer( frame, buffer->buf_id ); + gl_frame_buffer_to_tex( frame, buffer->buf_id ); } static void gl_fbo_display_blank( uint32_t colour ) --- a/src/drivers/gl_vbo.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/gl_vbo.c Wed Feb 04 08:38:23 2015 +1000 @@ -188,6 +188,7 @@ /************************** vertex_buffer_object *****************************/ +#ifdef ENABLE_VBO #ifdef GL_ARRAY_BUFFER_ARB static void *vbo_map( vertex_buffer_t buf, uint32_t size ) @@ -230,6 +231,7 @@ } #endif +#endif /** * Auto-detect the supported vertex buffer types, and select between them. --- a/src/drivers/io_osx.m Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/io_osx.m Wed Feb 04 08:38:23 2015 +1000 @@ -30,8 +30,6 @@ struct io_osx_cbinfo *next; }; -static struct io_osx_cbinfo *cbinfo_list = NULL; - void io_unregister_callback( struct io_osx_cbinfo *cbinfo ) { CFRunLoopRemoveSource( CFRunLoopGetCurrent(), cbinfo->sourceRef, kCFRunLoopCommonModes ); @@ -114,7 +112,7 @@ fdContext.version = 0; fdContext.retain = NULL; fdContext.info = cbinfo; - fdContext.release = io_osx_release; + fdContext.release = ( void (*)(void *) )io_osx_release; fdContext.copyDescription = NULL; CFFileDescriptorRef ref = CFFileDescriptorCreate( kCFAllocatorDefault, fd, FALSE, --- a/src/drivers/video_gl.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/video_gl.c Wed Feb 04 08:38:23 2015 +1000 @@ -433,7 +433,7 @@ return TRUE; } -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id ) +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id ) { int size = frame->width * frame->height; uint32_t tmp[size]; @@ -442,7 +442,6 @@ glBindTexture( GL_TEXTURE_2D, tex_id ); glTexSubImage2D( GL_TEXTURE_2D, 0, 0,0, frame->width, frame->height, GL_RGBA, type, tmp ); gl_check_error("gl_load_frame_buffer:glTexSubImage2DBGRA"); - return TRUE; } #else @@ -466,7 +465,7 @@ return TRUE; } -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id ) +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id ) { GLenum type = colour_formats[frame->colour_format].type; GLenum format = colour_formats[frame->colour_format].format; @@ -478,10 +477,14 @@ glTexSubImage2DBGRA( 0, 0,0, frame->width, frame->height, format, type, frame->data, FALSE ); glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); - return TRUE; } #endif +static void gl_load_frame_buffer( frame_buffer_t frame, render_buffer_t render ) +{ + gl_frame_buffer_to_tex( frame, render->tex_id ); +} + gboolean gl_init_driver( display_driver_t driver, gboolean need_fbo ) { @@ -494,9 +497,9 @@ } /* Use SL shaders if available */ - gboolean have_shaders = glsl_init(driver); + glsl_init(driver); #ifndef HAVE_OPENGL_FIXEDFUNC - if( !have_shaders ) { /* Shaders are required if we don't have fixed-functionality */ + if( !driver->has_sl ) { /* Shaders are required if we don't have fixed-functionality */ gl_fbo_shutdown(); return FALSE; } --- a/src/drivers/video_gl.h Sun Jan 18 20:00:38 2015 +1000 +++ b/src/drivers/video_gl.h Wed Feb 04 08:38:23 2015 +1000 @@ -33,7 +33,7 @@ /** * Generic GL routine to draw the given frame buffer into a texture */ -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id ); +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id ); /** * Reset the GL state to its initial values --- a/src/gdbserver.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/gdbserver.c Wed Feb 04 08:38:23 2015 +1000 @@ -128,7 +128,7 @@ size_t gdb_read_binary_data( struct gdb_server *server, unsigned char *buf, char *data, int datalen ) { unsigned char *q = buf; - for( int i=0, j=0; ie_ident[EI_CLASS] == ELFCLASS32 && head->e_ident[EI_DATA] == ELFDATA2LSB && head->e_ident[EI_VERSION] == 1 && head->e_type == ET_EXEC && - head->e_machine == EM_SH && + head->e_machine == mach && head->e_version == 1 ); } -static gboolean is_arm_elf( Elf32_Ehdr *head ) -{ - return ( head->e_ident[EI_CLASS] == ELFCLASS32 && - head->e_ident[EI_DATA] == ELFDATA2LSB && - head->e_ident[EI_VERSION] == 1 && - head->e_type == ET_EXEC && - head->e_machine == EM_ARM && - head->e_version == 1 ); -} +#define is_sh4_elf(head) is_arch(head, EM_SH) +#define is_arm_elf(head) is_arch(head, EM_ARM) static gboolean file_load_elf( const gchar *filename, int fd, ERROR *err ) { @@ -437,7 +428,7 @@ } /* Load the program into memory */ - char *program = g_malloc0( end-start ); + unsigned char *program = g_malloc0( end-start ); for( i=0; icode = n; snprintf( (err)->msg, sizeof((err)->msg), __VA_ARGS__ ); } #define CLEAR_ERROR(err) do { (err)->code = 0; (err)->msg[0] = 0; } while(0) - +#define IS_ERROR_CODE(err, n) ( (err) != NULL && (err)->code == (n) ) #ifdef HAVE_FASTCALL #define FASTCALL __attribute__((regparm(3))) --- a/src/lxpaths.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/lxpaths.c Wed Feb 04 08:38:23 2015 +1000 @@ -169,7 +169,6 @@ gchar *get_filename_at( const gchar *at, const gchar *filename ) { - char tmp[PATH_MAX]; char *p = strrchr( at, '/' ); if( p == NULL ) { /* No path at all, so just return filename */ --- a/src/maple/controller.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/maple/controller.c Wed Feb 04 08:38:23 2015 +1000 @@ -123,11 +123,6 @@ /* Get the controller_device * from a lxdream_config_group_t */ #define DEV_FROM_CONFIG_GROUP(grp) ((controller_device_t)(((char *)grp) - offsetof( struct controller_device, config ))) -static int config_button_map[] = { - BUTTON_DPAD_LEFT, BUTTON_DPAD_RIGHT, BUTTON_DPAD_UP, BUTTON_DPAD_DOWN, - JOY_LEFT, JOY_RIGHT, JOY_UP, JOY_DOWN, BUTTON_X, BUTTON_Y, BUTTON_A, - BUTTON_B, BUTTON_LEFT_TRIGGER, BUTTON_RIGHT_TRIGGER, BUTTON_START }; - #define CONTROLLER(x) ((controller_device_t)(x)) static maple_device_t controller_new( ) --- a/src/maple/lightgun.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/maple/lightgun.c Wed Feb 04 08:38:23 2015 +1000 @@ -64,9 +64,6 @@ static void lightgun_start_gun( maple_device_t dev ); static void lightgun_stop_gun( maple_device_t dev ); -static gboolean lightgun_set_config_value( lxdream_config_group_t group, unsigned int key, - const gchar *oldvalue, const gchar *value ); - typedef struct lightgun_device { struct maple_device dev; uint32_t condition[2]; --- a/src/maple/vmu.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/maple/vmu.c Wed Feb 04 08:38:23 2015 +1000 @@ -62,6 +62,8 @@ const gchar *oldvalue, const gchar *value ); static int vmu_get_condition( maple_device_t dev, int function, unsigned char *outbuf, unsigned int *outlen ); +static int vmu_set_condition(struct maple_device *dev, int function, + unsigned char *inbuf, unsigned int buflen); static int vmu_get_meminfo( maple_device_t dev, int function, unsigned int pt, unsigned char *outbuf, unsigned int *outlen ); static void vmu_attach(struct maple_device *dev); @@ -89,7 +91,7 @@ VMU_IDENT, VMU_VERSION, vmu_get_config, vmu_attach, vmu_detach, vmu_destroy, - vmu_clone, NULL, NULL, vmu_get_condition, NULL, + vmu_clone, NULL, NULL, vmu_get_condition, vmu_set_condition, vmu_get_meminfo, vmu_read_block, vmu_write_block, NULL, NULL }, NULL, {0}, {"Sega VMU", vmu_set_config_value, NULL, NULL, @@ -160,7 +162,7 @@ static void vmu_destroy( maple_device_t dev ) { vmu_device_t vmu = (vmu_device_t)dev; - free( dev ); + free( vmu ); } static int vmu_get_condition(struct maple_device *dev, int function, --- a/src/pvr2/glrender.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/pvr2/glrender.c Wed Feb 04 08:38:23 2015 +1000 @@ -142,7 +142,7 @@ #endif -#ifdef HAVE_OPENGL_CLEAR_DEPTHF +#ifdef HAVE_GLES2 glClearDepthf(0); #else glClearDepth(0); --- a/src/pvr2/glutil.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/pvr2/glutil.c Wed Feb 04 08:38:23 2015 +1000 @@ -24,8 +24,8 @@ gboolean isOpenGLES2() { - const char *str = glGetString(GL_VERSION); - if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) { + const GLubyte *str = glGetString(GL_VERSION); + if( strncmp((const char *)str, "OpenGL ES 2.", 12) == 0 ) { return TRUE; } return FALSE; @@ -192,7 +192,7 @@ return; gchar *ext_dup = g_strdup(extensions); - gchar **ext_split = g_strsplit(g_strstrip(extensions), " ", 0); + gchar **ext_split = g_strsplit(g_strstrip(ext_dup), " ", 0); for( count = 0; ext_split[count] != NULL; count++ ) { unsigned len = strlen(ext_split[count]); if( len > maxlen ) @@ -264,6 +264,7 @@ return TRUE; } +#if 0 static int bgra_to_rgba_type( int glFormatType ) { switch( glFormatType ) { @@ -278,6 +279,7 @@ return glFormatType; } } +#endif /** * Convert BGRA data in buffer to RGBA format in-place (for systems that don't natively @@ -290,7 +292,6 @@ */ static int bgra_to_rgba( unsigned char *data, unsigned nPixels, int glFormatType ) { - unsigned i; switch( glFormatType ) { case GL_UNSIGNED_SHORT_1_5_5_5_REV: { uint16_t *p = (uint16_t *)data; @@ -333,7 +334,7 @@ if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) { if( preserveData ) { size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2); - char buf[size]; + unsigned char buf[size]; memcpy(buf, data, size); GLint rgbaType = bgra_to_rgba( buf, width*height, type ); glTexImage2D( GL_TEXTURE_2D, level, intFormat, width, height, 0, GL_RGBA, rgbaType, @@ -354,7 +355,7 @@ if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) { if( preserveData ) { size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2); - char buf[size]; + unsigned char buf[size]; memcpy(buf, data, size); GLint rgbaType = bgra_to_rgba( buf, width*height, type ); glTexSubImage2D( GL_TEXTURE_2D, level, xoff, yoff, width, height, GL_RGBA, rgbaType, --- a/src/pvr2/rendsort.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/pvr2/rendsort.c Wed Feb 04 08:38:23 2015 +1000 @@ -171,7 +171,6 @@ { int i; for( i=0; ipoly; gl_render_triangle(triangles[i]->poly, triangles[i]->triangle_num); } } @@ -190,7 +189,6 @@ tri2->bounds[3] <= tri1->bounds[2] ) return 0; /* tri1 and tri2 don't actually overlap at all */ else { - struct vertex_struct *tri1v = &pvr2_scene.vertex_array[tri1->poly->vertex_index + tri1->triangle_num]; struct vertex_struct *tri2v = &pvr2_scene.vertex_array[tri2->poly->vertex_index + tri2->triangle_num]; float v[3]; int i; --- a/src/pvr2/scene.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/pvr2/scene.c Wed Feb 04 08:38:23 2015 +1000 @@ -37,11 +37,6 @@ rgba[3] = ((float)(((bgra&0xFF000000)>>24) + 1)) / 256.0; } -static inline uint32_t bgra_to_rgba(uint32_t bgra) -{ - return (bgra&0xFF00FF00) | ((bgra&0x00FF0000)>>16) | ((bgra&0x000000FF)<<16); -} - /** * Convert a half-float (16-bit) FP number to a regular 32-bit float. * Source is 1-bit sign, 5-bit exponent, 10-bit mantissa. @@ -468,7 +463,7 @@ static void scene_add_cheap_shadow_vertexes( struct vertex_struct *src, struct vertex_struct *dest, int count ) { - unsigned int i, j; + unsigned int i; for( i=0; ix = src->x; --- a/src/pvr2/texcache.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/pvr2/texcache.c Wed Feb 04 08:38:23 2015 +1000 @@ -261,7 +261,7 @@ int bpp = 2; uint32_t *palette = (uint32_t *)mmio_region_PVR2PAL.mem; uint16_t packed_palette[1024]; - char *data = (char *)palette; + unsigned char *data = (unsigned char *)palette; switch( texcache_palette_mode ) { case 0: /* ARGB1555 */ @@ -290,14 +290,14 @@ for( i=0; i<1024; i++ ) { packed_palette[i] = (uint16_t)palette[i]; } - data = (char *)packed_palette; + data = (unsigned char *)packed_palette; } glActiveTexture(GL_TEXTURE1); if( format_changed ) - glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (char *)palette ); + glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (unsigned char *)palette ); else - glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (char *)palette); + glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (unsigned char *)palette); glActiveTexture(GL_TEXTURE0); texcache_palette_valid = TRUE; } @@ -479,16 +479,6 @@ } } -static gboolean is_npot_texture( int width ) -{ - while( width != 0 ) { - if( width & 1 ) - return width != 1; - width >>= 1; - } - return TRUE; -} - /** * Load texture data from the given address and parameters into the currently * bound OpenGL texture. @@ -704,7 +694,6 @@ { uint32_t texture_addr = (texture_word & 0x000FFFFF)<<3; uint32_t texture_page = texture_addr >> 12; - texcache_entry_index next; texcache_entry_index idx = texcache_page_lookup[texture_page]; while( idx != EMPTY_ENTRY ) { texcache_entry_t entry = &texcache_active_list[idx]; @@ -809,6 +798,17 @@ } #if 0 + +static gboolean is_npot_texture( int width ) +{ + while( width != 0 ) { + if( width & 1 ) + return width != 1; + width >>= 1; + } + return TRUE; +} + render_buffer_t texcache_get_render_buffer( uint32_t texture_addr, int mode, int width, int height ) { uint32_t texture_word = ((texture_addr >> 3) & 0x000FFFFF) | PVR2_TEX_UNTWIDDLED; @@ -910,8 +910,8 @@ { unsigned x,y; int src_bytes = (width*width>>1); - char tmp[src_bytes]; - char data[width*width]; + unsigned char tmp[src_bytes]; + unsigned char data[width*width]; pvr2_vram64_read_twiddled_4( tmp, texture_addr, width, width ); decode_pal4_to_pal8( data, tmp, src_bytes ); for( y=0; yptr = (uint32_t *)(pvr2_main_ram + (segptr & 0x007FFFFF)); --- a/src/sh4/mmu.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/sh4/mmu.c Wed Feb 04 08:38:23 2015 +1000 @@ -424,7 +424,7 @@ static void mmu_set_tlb_enabled( int tlb_on ) { - mem_region_fn_t *ptr, *uptr; + mem_region_fn_t *ptr; int i; /* Reset the storequeue area */ @@ -819,11 +819,8 @@ static void mmu_utlb_remove_entry( int entry ) { - int i, j; struct utlb_entry *ent = &mmu_utlb[entry]; sh4addr_t start_addr = ent->vpn&ent->mask; - mem_region_fn_t *ptr = &sh4_address_space[start_addr >> 12]; - mem_region_fn_t *uptr = &sh4_user_address_space[start_addr >> 12]; gboolean unmap_user; int npages = get_tlb_size_pages(ent->flags); --- a/src/sh4/sh4trans.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/sh4/sh4trans.c Wed Feb 04 08:38:23 2015 +1000 @@ -92,7 +92,7 @@ { sh4addr_t pc = start; sh4addr_t lastpc = (pc&0xFFFFF000)+0x1000; - int done, i; + int done; xlat_current_block = xlat_start_block( GET_ICACHE_PHYS(start) ); xlat_output = (uint8_t *)xlat_current_block->code; xlat_recovery_posn = 0; --- a/src/sh4/sh4x86.in Sun Jan 18 20:00:38 2015 +1000 +++ b/src/sh4/sh4x86.in Wed Feb 04 08:38:23 2015 +1000 @@ -116,7 +116,8 @@ static struct sh4_x86_state sh4_x86; static uint8_t sh4_entry_stub[128]; -void FASTCALL (*sh4_translate_enter)(void *code); +typedef FASTCALL void (*entry_point_t)(void *); +entry_point_t sh4_translate_enter; static uint32_t max_int = 0x7FFFFFFF; static uint32_t min_int = 0x80000000; @@ -171,7 +172,7 @@ POP_r32(REG_EBX); POP_r32(REG_EBP); RET(); - sh4_translate_enter = sh4_entry_stub; + sh4_translate_enter = (entry_point_t)sh4_entry_stub; } void sh4_translate_init(void) @@ -3204,13 +3205,11 @@ void *xlat_get_native_pc( void *code, uint32_t code_size ) { - struct _Unwind_Exception exc; struct UnwindInfo info; info.pc = NULL; info.block_start = (uintptr_t)code; info.block_end = info.block_start + code_size; - void *result = NULL; _Unwind_Backtrace( xlat_check_frame, &info ); return info.pc; } --- a/src/sh4/shadow.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/sh4/shadow.c Wed Feb 04 08:38:23 2015 +1000 @@ -89,7 +89,7 @@ } } -static void dump_mem_ops() +void dump_mem_ops() { for( unsigned i=0; i #include "lxpaths.h" -char *lxdream_get_global_config_path_value() { } +char *lxdream_get_global_config_path_value() { return NULL; } void log_message( void *ptr, int level, const gchar *source, const char *msg, ... ) { } struct expanded_path_case_t { --- a/src/tools/gendec.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/tools/gendec.c Wed Feb 04 08:38:23 2015 +1000 @@ -176,7 +176,7 @@ static void fprint_action( struct rule *rule, const struct action *action, int depth, FILE *f ) { int i; - if( action == NULL ) { + if( action == NULL || action->text == NULL ) { fprintf( f, "%*cUNIMP(ir); /* %s */\n", depth*8, ' ', rule->format ); } else { fprintf( f, "%*c{ /* %s */", depth*8, ' ', rule->format ); @@ -292,7 +292,9 @@ if( emit_warnings ) { check_actions( rules, token ); } + fprintf( out, "#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wunused-variable\"\n" ); split_and_generate( rules, token->actions, ruleidx, rules->rule_count, 0, 1, out ); + fprintf( out, "#pragma clang diagnostic pop\n" ); } token = action_file_next(af); } --- a/src/tools/genmach.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/tools/genmach.c Wed Feb 04 08:38:23 2015 +1000 @@ -72,7 +72,7 @@ if( q == NULL ) { return g_strdup_printf("%s%s", p, ext); } else { - return g_strdup_printf("%.*s%s", q-p, p, ext ); + return g_strdup_printf("%.*s%s", (int)(q-p), p, ext ); } } @@ -136,9 +136,9 @@ } } -char *build_page_initializer( regblock_t block ) +unsigned char *build_page_initializer( regblock_t block ) { - char *page = g_malloc(LXDREAM_PAGE_SIZE); + unsigned char *page = g_malloc(LXDREAM_PAGE_SIZE); /* First, background fill if any */ if( block->flags.fillSizeBytes == 0 ) { @@ -240,7 +240,7 @@ fprintf( f, " mmio_region_%s_read_word, mmio_region_%s_write_word,\n", block->name, block->name ); fprintf( f, " mmio_region_%s_read_byte, mmio_region_%s_write_byte,\n", block->name, block->name ); fprintf( f, " mmio_region_%s_read_burst, mmio_region_%s_write_burst,\n", block->name, block->name ); - fprintf( f, " unmapped_prefetch, mmio_region_%s_read_byte },\n", block->name, block->name ); + fprintf( f, " unmapped_prefetch, mmio_region_%s_read_byte },\n", block->name ); fprintf( f, " NULL, NULL, {\n" ); for( unsigned i=0; inumRegs; i++ ) { regdef_t reg = block->regs[i]; @@ -362,7 +362,7 @@ } for( GList *ptr = block_list; ptr != NULL; ptr = ptr->next ) { - char *data = build_page_initializer((regblock_t)ptr->data); + unsigned char *data = build_page_initializer((regblock_t)ptr->data); fwrite_dump( data, LXDREAM_PAGE_SIZE, stdout ); g_free(data); } --- a/src/tools/mdparse.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/tools/mdparse.c Wed Feb 04 08:38:23 2015 +1000 @@ -107,7 +107,7 @@ int yyline; int yycol; union { - long i; + uint64_t i; char *s; } v; int slen; @@ -126,7 +126,7 @@ #define YYPARSE_ERROR( msg, ... ) \ do { \ - fprintf( stderr, "Parse error in %s:%d:%d: " msg "\n", yystate.yyfilename, yytok.yyline, yytok.yycol, __VA_ARGS__ ); \ + fprintf( stderr, "Parse error in %s:%d:%d: " msg "\n", yystate.yyfilename, yytok.yyline, yytok.yycol, ## __VA_ARGS__ ); \ exit(2); \ } while(0) @@ -159,14 +159,14 @@ return strncasecmp(yytok.yytext, cmp, yytok.yylength); } -static int yymatch( const char *arr[], unsigned numOptions ) +static int yymatch( const char *arr[], unsigned numOptions, const char *desc ) { for( unsigned i=0; ii = yytok.v.i; if( *numBytes == 0 ) { - YYPARSE_ERROR( "Expected string initializer but was an integer (0x%x)", yytok.v.i ); + YYPARSE_ERROR( "Expected string initializer but was an integer (0x%llx)", yytok.v.i ); } - } else if( tok = TOK_STRING ) { + } else if( tok == TOK_STRING ) { if( *numBytes == 0 ) { *numBytes = yytok.slen; apv->s = yytok.v.s; @@ -224,10 +224,7 @@ case TOK_ACCESS: READ(TOK_EQUALS); READ(TOK_IDENTIFIER); - flags->access = yymatch(ACCESS_NAMES,elementsof(ACCESS_NAMES)); - if( flags->access == -1 ) { - YYPARSE_ERROR("Unknown access mode '%s'", yystrdup()); - } + flags->access = yymatch(ACCESS_NAMES,elementsof(ACCESS_NAMES), "access mode"); break; case TOK_MASK: if( numBytes ) { @@ -235,32 +232,23 @@ tok = iolex(TOK_INTEGER); ioparse_apval( tok, &flags->maskValue, numBytes ); } else { - YYPARSE_ERROR("mask is not valid on a register block",0); + YYPARSE_ERROR("mask is not valid on a register block"); } break; case TOK_ENDIAN: READ(TOK_EQUALS); READ(TOK_IDENTIFIER); - flags->endian = yymatch(ENDIAN_NAMES,elementsof(ENDIAN_NAMES)); - if( flags->endian == -1 ) { - YYPARSE_ERROR("Unknown endianness '%s'", yystrdup()); - } + flags->endian = yymatch(ENDIAN_NAMES,elementsof(ENDIAN_NAMES), "endianness"); break; case TOK_TRACE: READ(TOK_EQUALS); READ(TOK_IDENTIFIER); - flags->traceFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES)); - if( flags->traceFlag == -1 ) { - YYPARSE_ERROR("Unknown trace flag '%s'", yystrdup()); - } + flags->traceFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES), "trace flags"); break; case TOK_TEST: READ(TOK_EQUALS); READ(TOK_IDENTIFIER); - flags->testFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES)); - if( flags->testFlag == -1 ) { - YYPARSE_ERROR("Unknown test flag '%s'", yystrdup()); - } + flags->testFlag = yymatch(TRACE_NAMES,elementsof(TRACE_NAMES), "test flag"); break; case TOK_COMMA: break; @@ -274,17 +262,17 @@ static void ioparse_regdef( struct regdef *reg ) { - reg->offset = yytok.v.i; + reg->offset = (uint32_t)yytok.v.i; reg->numElements = 1; reg->numBytes = 0; reg->initValue.i = 0; reg->flags.maskValue.i = -1; - unsigned rangeOffset = reg->offset; + uint32_t rangeOffset = reg->offset; int tok = iolex(TOK_COLON); if( tok == TOK_RANGE ) { READ(TOK_INTEGER); - rangeOffset = yytok.v.i; + rangeOffset = (uint32_t)yytok.v.i; if( rangeOffset < reg->offset ) { YYPARSE_ERROR( "Range end (0x%x) must be greater than the range start (0x%x)", rangeOffset, reg->offset ); } @@ -293,10 +281,7 @@ YYPARSE_ERROR( "Expected ':' but was %s\n", TOKEN_NAMES[tok] ); } READ(TOK_IDENTIFIER); - reg->mode = yymatch(MODE_NAMES, elementsof(MODE_NAMES)); - if( reg->mode == -1 ) { - YYPARSE_ERROR( "Unknown register mode '%s'", yystrdup() ); - } + reg->mode = yymatch(MODE_NAMES, elementsof(MODE_NAMES), "register mode"); if( reg->mode == REG_MIRROR ) { /* Mirror regions have a target range only */ READ(TOK_INTEGER); @@ -306,14 +291,14 @@ if( tok == TOK_RANGE ) { READ(TOK_INTEGER); if( yytok.v.i < reg->initValue.i ) { - YYPARSE_ERROR( "Invalid mirror target range 0x%x..0x%x", reg->initValue.i, yytok.v.i ); + YYPARSE_ERROR( "Invalid mirror target range 0x%llx..0x%llx", reg->initValue.i, yytok.v.i ); } - reg->numBytes = yytok.v.i - reg->initValue.i + 1; + reg->numBytes = (uint32_t)(yytok.v.i - reg->initValue.i + 1); tok = iolex(TOK_STRIDE); } if( tok == TOK_STRIDE ) { READ(TOK_INTEGER); - reg->stride = yytok.v.i; + reg->stride = (uint32_t)yytok.v.i; tok = iolex(TOK_ACTION); } else { reg->stride = reg->numBytes; @@ -333,10 +318,7 @@ } else { READ(TOK_IDENTIFIER); - reg->type = yymatch(TYPE_NAMES, elementsof(TYPE_NAMES)); - if( reg->type == -1 ) { - YYPARSE_ERROR( "Unknown register type '%s'", yystrdup() ); - } + reg->type = yymatch(TYPE_NAMES, elementsof(TYPE_NAMES), "register type"); reg->numBytes = TYPE_SIZES[reg->type]; tok = iolex(TOK_IDENTIFIER); if( tok == TOK_IDENTIFIER ) { @@ -361,7 +343,7 @@ } tok = iolex(TOK_ACTION); } else if( reg->type == REG_STRING ) { - YYPARSE_ERROR( "String declarations must have an initializer (ie = 'abcd')",0 ); + YYPARSE_ERROR( "String declarations must have an initializer (ie = 'abcd')" ); } if( tok == TOK_ACTION ) { // reg->action = yystrdup(); @@ -393,7 +375,7 @@ YYPARSE_ERROR("Expected AT but got %s\n", TOKEN_NAMES[tok] ); } READ(TOK_INTEGER); - block->address = yytok.v.i; + block->address = (uint32_t)yytok.v.i; tok = iolex(TOK_LBRACE); if( tok == TOK_LPAREN) { @@ -450,7 +432,7 @@ free(tmp); } else if( tok == TOK_SPACE ) { } else if( tok == TOK_REGISTERS ) { - struct regblock *block = ioparse_regblock(block); + struct regblock *block = ioparse_regblock(); count++; blocks = g_list_insert_sorted(blocks, block, register_block_sort_cb); } else { @@ -638,7 +620,7 @@ while( yystate.yyposn < yystate.yyend && isdigit(*yystate.yyposn) ) yystate.yyposn++; } - yytok.v.i = strtol( yystart, NULL, 0 ); + yytok.v.i = strtoll( yystart, NULL, 0 ); YYRETURN(TOK_INTEGER); } else if( isalpha(ch) || ch == '_' ) { /* IDENTIFIER */ --- a/src/xlat/disasm/i386-dis.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/xlat/disasm/i386-dis.c Wed Feb 04 08:38:23 2015 +1000 @@ -3019,32 +3019,32 @@ if (prefixes & PREFIX_CS) { used_prefixes |= PREFIX_CS; - oappend ("%cs:" + intel_syntax); + oappend ( &"%cs:"[(int)intel_syntax]); } if (prefixes & PREFIX_DS) { used_prefixes |= PREFIX_DS; - oappend ("%ds:" + intel_syntax); + oappend (&"%ds:"[(int)intel_syntax]); } if (prefixes & PREFIX_SS) { used_prefixes |= PREFIX_SS; - oappend ("%ss:" + intel_syntax); + oappend (&"%ss:"[(int)intel_syntax]); } if (prefixes & PREFIX_ES) { used_prefixes |= PREFIX_ES; - oappend ("%es:" + intel_syntax); + oappend (&"%es:"[(int)intel_syntax]); } if (prefixes & PREFIX_FS) { used_prefixes |= PREFIX_FS; - oappend ("%fs:" + intel_syntax); + oappend (&"%fs:"[(int)intel_syntax]); } if (prefixes & PREFIX_GS) { used_prefixes |= PREFIX_GS; - oappend ("%gs:" + intel_syntax); + oappend (&"%gs:"[(int)intel_syntax]); } } @@ -3898,7 +3898,7 @@ oappend ("BYTE PTR "); } - oappend ("%es:" + intel_syntax); + oappend (&"%es:"[(int)intel_syntax]); ptr_reg (code, sizeflag); } --- a/src/xlat/xltcache.c Sun Jan 18 20:00:38 2015 +1000 +++ b/src/xlat/xltcache.c Wed Feb 04 08:38:23 2015 +1000 @@ -678,7 +678,6 @@ unsigned int xlat_get_cache_blocks_by_activity( xlat_block_ref_t outblocks, size_t topN ) { - int i=0; int count = xlat_get_active_block_count(); struct xlat_block_ref blocks[count];