Search
lxdream.org :: lxdream :: r968:6fb1481859a4
lxdream 0.9.1
released Jun 29
Download Now
changeset968:6fb1481859a4
parent967:ef93b08e2166
child969:3f178ca1398c
authornkeynes
dateThu Jan 15 11:23:20 2009 +0000 (15 years ago)
Fix various compile-time warnings
src/aica/armmem.c
src/gettext.h
src/hook.h
src/main.c
src/mem.c
src/sh4/cache.c
src/sh4/ia32abi.h
src/sh4/mmu.c
src/sh4/sh4.c
src/sh4/sh4core.h
src/test/testsh4x86.c
src/tools/genglsl.c
src/x86dasm/i386-dis.c
src/x86dasm/x86dasm.c
src/x86dasm/x86dasm.h
1.1 --- a/src/aica/armmem.c Thu Jan 15 11:18:10 2009 +0000
1.2 +++ b/src/aica/armmem.c Thu Jan 15 11:23:20 2009 +0000
1.3 @@ -20,6 +20,7 @@
1.4 #include "dream.h"
1.5 #include "mem.h"
1.6 #include "aica.h"
1.7 +#include "asic.h"
1.8 #include "armcore.h"
1.9
1.10 unsigned char aica_main_ram[2 MB];
2.1 --- a/src/gettext.h Thu Jan 15 11:18:10 2009 +0000
2.2 +++ b/src/gettext.h Thu Jan 15 11:23:20 2009 +0000
2.3 @@ -28,7 +28,7 @@
2.4 #endif
2.5
2.6 /* NLS can be disabled through the configure --disable-nls option. */
2.7 -#if ENABLE_NLS
2.8 +#ifdef ENABLE_NLS
2.9
2.10 /* Get declarations of GNU message catalog functions. */
2.11 # include <libintl.h>
3.1 --- a/src/hook.h Thu Jan 15 11:18:10 2009 +0000
3.2 +++ b/src/hook.h Thu Jan 15 11:23:20 2009 +0000
3.3 @@ -42,7 +42,7 @@
3.4 */
3.5 #define DECLARE_HOOK( name, fn_type ) \
3.6 void register_##name( fn_type fn, void *user_data ); \
3.7 - void unregister_##name( fn_type fn, void *user_data );
3.8 + void unregister_##name( fn_type fn, void *user_data )
3.9
3.10 #define FOREACH_HOOK( h, name ) struct name##_hook_struct *h; for( h = name##_hook_list; h != NULL; h = h->next )
3.11
4.1 --- a/src/main.c Thu Jan 15 11:18:10 2009 +0000
4.2 +++ b/src/main.c Thu Jan 15 11:23:20 2009 +0000
4.3 @@ -63,12 +63,12 @@
4.4 gboolean show_debugger = FALSE;
4.5 extern uint32_t sh4_cpu_multiplier;
4.6
4.7 -void print_version()
4.8 +static void print_version()
4.9 {
4.10 printf( "lxdream %s\n", lxdream_full_version );
4.11 }
4.12
4.13 -void print_usage()
4.14 +static void print_usage()
4.15 {
4.16 print_version();
4.17 printf( "Usage: lxdream %s [options] [disc-file] [program-file]\n\n", lxdream_full_version );
4.18 @@ -92,7 +92,7 @@
4.19 printf( " -x %s\n", _("Disable the SH4 translator") );
4.20 }
4.21
4.22 -void bind_gettext_domain()
4.23 +static void bind_gettext_domain()
4.24 {
4.25 #ifdef ENABLE_NLS
4.26 bindtextdomain( PACKAGE, get_locale_path() );
5.1 --- a/src/mem.c Thu Jan 15 11:18:10 2009 +0000
5.2 +++ b/src/mem.c Thu Jan 15 11:23:20 2009 +0000
5.3 @@ -44,8 +44,8 @@
5.4
5.5 extern struct mem_region_fn mem_region_unmapped;
5.6
5.7 -int mem_load(FILE *f);
5.8 -void mem_save(FILE *f);
5.9 +static int mem_load(FILE *f);
5.10 +static void mem_save(FILE *f);
5.11 struct dreamcast_module mem_module =
5.12 { "MEM", mem_init, mem_reset, NULL, NULL, NULL, mem_save, mem_load };
5.13
5.14 @@ -107,7 +107,7 @@
5.15 uintptr_t i = (uintptr_t)region;
5.16 uintptr_t mask = ~(PAGE_SIZE-1);
5.17 void *ptr = (void *)(i & mask);
5.18 - size_t len = i & (PAGE_SIZE-1) + size;
5.19 + size_t len = (i & (PAGE_SIZE-1)) + size;
5.20 len = (len + (PAGE_SIZE-1)) & mask;
5.21
5.22 int status = mprotect( ptr, len, PROT_READ|PROT_WRITE|PROT_EXEC );
5.23 @@ -151,7 +151,7 @@
5.24 }
5.25 }
5.26
5.27 -void mem_save( FILE *f )
5.28 +static void mem_save( FILE *f )
5.29 {
5.30 int i, num_ram_regions = 0;
5.31 uint32_t len;
5.32 @@ -186,7 +186,7 @@
5.33 }
5.34 }
5.35
5.36 -int mem_load( FILE *f )
5.37 +static int mem_load( FILE *f )
5.38 {
5.39 char tmp[64];
5.40 uint32_t len;
5.41 @@ -332,7 +332,7 @@
5.42 do {
5.43 for( i=0; i<size>>LXDREAM_PAGE_BITS; i++ ) {
5.44 if( mem != NULL ) {
5.45 - page_map[(base>>LXDREAM_PAGE_BITS)+i] = mem + (i<<LXDREAM_PAGE_BITS);
5.46 + page_map[(base>>LXDREAM_PAGE_BITS)+i] = ((unsigned char *)mem) + (i<<LXDREAM_PAGE_BITS);
5.47 }
5.48 ext_address_space[(base>>LXDREAM_PAGE_BITS)+i] = fn;
5.49 mem_page_remapped( base + (i<<LXDREAM_PAGE_BITS), fn );
5.50 @@ -443,7 +443,7 @@
5.51 ext_address_space[(addr&0x1FFFFFFF)>>12]->write_long(addr, value);
5.52 }
5.53
5.54 -struct mmio_region *mem_get_io_region_by_name( const gchar *name )
5.55 +static struct mmio_region *mem_get_io_region_by_name( const gchar *name )
5.56 {
5.57 int i;
5.58 for( i=0; i<num_io_rgns; i++ ) {
6.1 --- a/src/sh4/cache.c Thu Jan 15 11:18:10 2009 +0000
6.2 +++ b/src/sh4/cache.c Thu Jan 15 11:23:20 2009 +0000
6.3 @@ -167,13 +167,13 @@
6.4
6.5 /************************** Cache direct access ******************************/
6.6
6.7 -static int32_t ccn_icache_addr_read( sh4addr_t addr )
6.8 +static int32_t FASTCALL ccn_icache_addr_read( sh4addr_t addr )
6.9 {
6.10 int entry = (addr & 0x00001FE0);
6.11 return ccn_icache[entry>>5].tag;
6.12 }
6.13
6.14 -static void ccn_icache_addr_write( sh4addr_t addr, uint32_t val )
6.15 +static void FASTCALL ccn_icache_addr_write( sh4addr_t addr, uint32_t val )
6.16 {
6.17 int entry = (addr & 0x00003FE0);
6.18 struct cache_line *line = &ccn_ocache[entry>>5];
6.19 @@ -193,13 +193,13 @@
6.20 unmapped_prefetch };
6.21
6.22
6.23 -static int32_t ccn_icache_data_read( sh4addr_t addr )
6.24 +static int32_t FASTCALL ccn_icache_data_read( sh4addr_t addr )
6.25 {
6.26 int entry = (addr & 0x00001FFC);
6.27 return *(uint32_t *)&ccn_icache_data[entry];
6.28 }
6.29
6.30 -static void ccn_icache_data_write( sh4addr_t addr, uint32_t val )
6.31 +static void FASTCALL ccn_icache_data_write( sh4addr_t addr, uint32_t val )
6.32 {
6.33 int entry = (addr & 0x00001FFC);
6.34 *(uint32_t *)&ccn_icache_data[entry] = val;
6.35 @@ -213,20 +213,20 @@
6.36 unmapped_prefetch };
6.37
6.38
6.39 -static int32_t ccn_ocache_addr_read( sh4addr_t addr )
6.40 +static int32_t FASTCALL ccn_ocache_addr_read( sh4addr_t addr )
6.41 {
6.42 int entry = (addr & 0x00003FE0);
6.43 return ccn_ocache[entry>>5].tag;
6.44 }
6.45
6.46 -static void ccn_ocache_addr_write( sh4addr_t addr, uint32_t val )
6.47 +static void FASTCALL ccn_ocache_addr_write( sh4addr_t addr, uint32_t val )
6.48 {
6.49 int entry = (addr & 0x00003FE0);
6.50 struct cache_line *line = &ccn_ocache[entry>>5];
6.51 if( addr & 0x08 ) { // Associative
6.52 } else {
6.53 if( (line->tag & (CACHE_VALID|CACHE_DIRTY)) == (CACHE_VALID|CACHE_DIRTY) ) {
6.54 - char *cache_data = &ccn_ocache_data[entry&0x00003FE0];
6.55 + unsigned char *cache_data = &ccn_ocache_data[entry&0x00003FE0];
6.56 // Cache line is dirty - writeback.
6.57 ext_address_space[line->tag>>12]->write_burst(line->key, cache_data);
6.58 }
6.59 @@ -243,13 +243,13 @@
6.60 unmapped_prefetch };
6.61
6.62
6.63 -static int32_t ccn_ocache_data_read( sh4addr_t addr )
6.64 +static int32_t FASTCALL ccn_ocache_data_read( sh4addr_t addr )
6.65 {
6.66 int entry = (addr & 0x00003FFC);
6.67 return *(uint32_t *)&ccn_ocache_data[entry];
6.68 }
6.69
6.70 -static void ccn_ocache_data_write( sh4addr_t addr, uint32_t val )
6.71 +static void FASTCALL ccn_ocache_data_write( sh4addr_t addr, uint32_t val )
6.72 {
6.73 int entry = (addr & 0x00003FFC);
6.74 *(uint32_t *)&ccn_ocache_data[entry] = val;
7.1 --- a/src/sh4/ia32abi.h Thu Jan 15 11:18:10 2009 +0000
7.2 +++ b/src/sh4/ia32abi.h Thu Jan 15 11:23:20 2009 +0000
7.3 @@ -24,7 +24,7 @@
7.4
7.5 #define load_ptr( reg, ptr ) load_imm32( reg, (uint32_t)ptr );
7.6
7.7 -static inline decode_address( int addr_reg )
7.8 +static inline void decode_address( int addr_reg )
7.9 {
7.10 uintptr_t base = (sh4r.xlat_sh4_mode&SR_MD) ? (uintptr_t)sh4_address_space : (uintptr_t)sh4_user_address_space;
7.11 MOV_r32_r32( addr_reg, R_ECX );
8.1 --- a/src/sh4/mmu.c Thu Jan 15 11:18:10 2009 +0000
8.2 +++ b/src/sh4/mmu.c Thu Jan 15 11:23:20 2009 +0000
8.3 @@ -1182,7 +1182,7 @@
8.4
8.5 /********************** TLB Direct-Access Regions ***************************/
8.6 #ifdef HAVE_FRAME_ADDRESS
8.7 -#define EXCEPTION_EXIT() do{ *(((void **)__builtin_frame_address(0))+1) = exc; return; } while(0)
8.8 +#define EXCEPTION_EXIT() do{ *(((void **)__builtin_frame_address(0))+1) = exc; } while(0)
8.9 #else
8.10 #define EXCEPTION_EXIT() sh4_core_exit(CORE_EXIT_EXCEPTION)
8.11 #endif
8.12 @@ -1409,12 +1409,14 @@
8.13 {
8.14 RAISE_MEM_ERROR(EXC_TLB_PROT_READ, addr);
8.15 EXCEPTION_EXIT();
8.16 + return 0;
8.17 }
8.18
8.19 static int32_t FASTCALL tlb_protected_read_burst( unsigned char *dest, sh4addr_t addr, void *exc )
8.20 {
8.21 RAISE_MEM_ERROR(EXC_TLB_PROT_READ, addr);
8.22 EXCEPTION_EXIT();
8.23 + return 0;
8.24 }
8.25
8.26 static void FASTCALL tlb_protected_write( sh4addr_t addr, uint32_t val, void *exc )
8.27 @@ -1433,12 +1435,14 @@
8.28 {
8.29 sh4_raise_tlb_multihit(addr);
8.30 EXCEPTION_EXIT();
8.31 + return 0;
8.32 }
8.33
8.34 static int32_t FASTCALL tlb_multi_hit_read_burst( unsigned char *dest, sh4addr_t addr, void *exc )
8.35 {
8.36 sh4_raise_tlb_multihit(addr);
8.37 EXCEPTION_EXIT();
8.38 + return 0;
8.39 }
8.40 static void FASTCALL tlb_multi_hit_write( sh4addr_t addr, uint32_t val, void *exc )
8.41 {
9.1 --- a/src/sh4/sh4.c Thu Jan 15 11:18:10 2009 +0000
9.2 +++ b/src/sh4/sh4.c Thu Jan 15 11:23:20 2009 +0000
9.3 @@ -28,6 +28,7 @@
9.4 #include "eventq.h"
9.5 #include "syscall.h"
9.6 #include "sh4/intc.h"
9.7 +#include "sh4/mmu.h"
9.8 #include "sh4/sh4core.h"
9.9 #include "sh4/sh4mmio.h"
9.10 #include "sh4/sh4stat.h"
10.1 --- a/src/sh4/sh4core.h Thu Jan 15 11:18:10 2009 +0000
10.2 +++ b/src/sh4/sh4core.h Thu Jan 15 11:23:20 2009 +0000
10.3 @@ -149,10 +149,12 @@
10.4 void INTC_reset( void );
10.5 void INTC_save_state( FILE *f );
10.6 int INTC_load_state( FILE *f );
10.7 +void MMU_init( void );
10.8 void MMU_reset( void );
10.9 void MMU_save_state( FILE *f );
10.10 int MMU_load_state( FILE *f );
10.11 void MMU_ldtlb();
10.12 +void CCN_set_cache_control( int reg );
10.13 void CCN_save_state( FILE *f );
10.14 int CCN_load_state( FILE *f );
10.15 void SCIF_reset( void );
11.1 --- a/src/test/testsh4x86.c Thu Jan 15 11:18:10 2009 +0000
11.2 +++ b/src/test/testsh4x86.c Thu Jan 15 11:23:20 2009 +0000
11.3 @@ -83,7 +83,7 @@
11.4 void sh4_core_exit( int exit_code ){}
11.5 void event_execute() {}
11.6 void TMU_run_slice( uint32_t nanos ) {}
11.7 -void CCN_set_cache_control( uint32_t val ) { }
11.8 +void CCN_set_cache_control( int val ) { }
11.9 void PMM_write_control( int ctr, uint32_t val ) { }
11.10 void SCIF_run_slice( uint32_t nanos ) {}
11.11 void FASTCALL sh4_write_fpscr( uint32_t val ) { }
11.12 @@ -185,9 +185,9 @@
11.13 uintptr_t pc;
11.14 uint8_t *buf = sh4_translate_basic_block( start_addr );
11.15 uint32_t buflen = xlat_get_code_size(buf);
11.16 - x86_disasm_init( (uintptr_t)buf, (uintptr_t)buf, buflen );
11.17 + x86_disasm_init( buf, (uintptr_t)buf, buflen );
11.18 x86_set_symtab( local_symbols, sizeof(local_symbols)/sizeof(struct x86_symbol) );
11.19 - for( pc = buf; pc < buf + buflen; ) {
11.20 + for( pc = (uintptr_t)buf; pc < ((uintptr_t)buf) + buflen; ) {
11.21 char buf[256];
11.22 char op[256];
11.23 uintptr_t pc2 = x86_disasm_instruction( pc, buf, sizeof(buf), op );
12.1 --- a/src/tools/genglsl.c Thu Jan 15 11:18:10 2009 +0000
12.2 +++ b/src/tools/genglsl.c Thu Jan 15 11:23:20 2009 +0000
12.3 @@ -23,7 +23,7 @@
12.4 /**
12.5 * Copy input to output, quoting " characters as we go.
12.6 */
12.7 -void writeShader( FILE *out, FILE *in )
12.8 +static void writeShader( FILE *out, FILE *in )
12.9 {
12.10 int ch;
12.11
13.1 --- a/src/x86dasm/i386-dis.c Thu Jan 15 11:18:10 2009 +0000
13.2 +++ b/src/x86dasm/i386-dis.c Thu Jan 15 11:23:20 2009 +0000
13.3 @@ -33,6 +33,7 @@
13.4
13.5 #include "x86dasm/dis-asm.h"
13.6 #include "x86dasm/sysdep.h"
13.7 +#include "x86dasm/x86dasm.h"
13.8 #include "gettext.h"
13.9
13.10 #define MAXLEN 20
14.1 --- a/src/x86dasm/x86dasm.c Thu Jan 15 11:18:10 2009 +0000
14.2 +++ b/src/x86dasm/x86dasm.c Thu Jan 15 11:23:20 2009 +0000
14.3 @@ -56,7 +56,7 @@
14.4 char buf[256];
14.5 char op[256];
14.6 uintptr_t pc2 = x86_disasm_instruction( pc, buf, sizeof(buf), op );
14.7 - fprintf( out, "%08X: %-20s %s\n", pc, op, buf );
14.8 + fprintf( out, "%08X: %-20s %s\n", (unsigned int)pc, op, buf );
14.9 pc = pc2;
14.10 }
14.11 }
15.1 --- a/src/x86dasm/x86dasm.h Thu Jan 15 11:18:10 2009 +0000
15.2 +++ b/src/x86dasm/x86dasm.h Thu Jan 15 11:23:20 2009 +0000
15.3 @@ -31,3 +31,4 @@
15.4 void x86_set_symtab( x86_symbol *symtab, int num_symbols );
15.5 void x86_disasm_init(unsigned char *buf, uintptr_t vma, int buflen);
15.6 uintptr_t x86_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
15.7 +void x86_print_symbolic_operand( char *buf, int hex, unsigned int disp );
.