[5022] Fix some warnings that would be generated by gcc -Wmissing-prototypes
Revision: 5022
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5022 Author: blueswir1 Date: 2008-08-17 20:26:25 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
Fix some warnings that would be generated by gcc -Wmissing-prototypes
Modified Paths:
--------------
trunk/dyngen.c
trunk/exec.c
trunk/hw/twl92230.c
trunk/hw/usb-serial.c
trunk/linux-user/main.c
trunk/linux-user/signal.c
trunk/linux-user/syscall.c
trunk/slirp/slirp.c
trunk/tcg/tcg.c
trunk/tcg/x86_64/tcg-target.c
trunk/vl.cModified: trunk/dyngen.c
===================================================================
dyngen.c +25 -25
@@ -272,7 +272,7 @@return data; } -int strstart (const char *str,const char *val,const char **ptr) +static int strstart (const char *str,const char *val,const char **ptr) {const char *p, *q; p = str;
@@ -288,7 +288,7 @@return 1 ; } -void pstrcpy (char *buf,int buf_size,const char *str) +static void pstrcpy (char *buf,int buf_size,const char *str) {int c;char *q = buf;
@@ -305,32 +305,32 @@ *q ='\0' ; } -void swab16s (uint16_t *p) +static void swab16s (uint16_t *p) { *p =bswap16 (*p); } -void swab32s (uint32_t *p) +static void swab32s (uint32_t *p) { *p =bswap32 (*p); } -void swab32ss (int32_t *p) +static void swab32ss (int32_t *p) { *p =bswap32 (*p); } -void swab64s (uint64_t *p) +static void swab64s (uint64_t *p) { *p =bswap64 (*p); } -void swab64ss (int64_t *p) +static void swab64ss (int64_t *p) { *p =bswap64 (*p); } -uint16_t get16 (uint16_t *p) +static uint16_t get16 (uint16_t *p) {uint16_t val; val = *p;
@@ -339,7 +339,7 @@return val; } -uint32_t get32 (uint32_t *p) +static uint32_t get32 (uint32_t *p) {uint32_t val; val = *p;
@@ -348,14 +348,14 @@return val; } -void put16 (uint16_t *p,uint16_t val) +static void put16 (uint16_t *p,uint16_t val) {if (do_swap) val =bswap16 (val); *p = val; } -void put32 (uint32_t *p,uint32_t val) +static void put32 (uint32_t *p,uint32_t val) {if (do_swap) val =bswap32 (val);
@@ -378,7 +378,7 @@struct elfhdr ehdr;char *strtab; -int elf_must_swap (struct elfhdr *h) +static int elf_must_swap (struct elfhdr *h) {union {uint32_t i;
@@ -390,7 +390,7 @@ (swaptest.b[0 ] ==0 ); } -void elf_swap_ehdr (struct elfhdr *h) +static void elf_swap_ehdr (struct elfhdr *h) {swab16s (&h->e_type);/* Object file type */ swab16s (&h-> e_machine);/* Architecture */
@@ -407,7 +407,7 @@swab16s (&h-> e_shstrndx);/* Section header string table index */ } -void elf_swap_shdr (struct elf_shdr *h) +static void elf_swap_shdr (struct elf_shdr *h) {swab32s (&h-> sh_name);/* Section name (string tbl index) */ swab32s (&h-> sh_type);/* Section type */
@@ -421,7 +421,7 @@swabls (&h-> sh_entsize);/* Entry size if section holds table */ } -void elf_swap_phdr (struct elf_phdr *h) +static void elf_swap_phdr (struct elf_phdr *h) {swab32s (&h->p_type);/* Segment type */ swabls (&h->p_offset);/* Segment file offset */
@@ -433,7 +433,7 @@swabls (&h->p_align);/* Segment alignment */ } -void elf_swap_rel (ELF_RELOC *rel) +static void elf_swap_rel (ELF_RELOC *rel) {swabls (&rel->r_offset);swabls (&rel->r_info);
@@ -442,8 +442,8 @@#endif } -struct elf_shdr *find_elf_section (struct elf_shdr *shdr,int shnum,const char *shstr, -const char *name) +static struct elf_shdr *find_elf_section (struct elf_shdr *shdr,int shnum, +const char *shstr,const char *name) {int i;const char *shname;
@@ -460,7 +460,7 @@return NULL ; } -int find_reloc (int sh_index) +static int find_reloc (int sh_index) {struct elf_shdr *sec;int i;
@@ -489,7 +489,7 @@ }/* load an elf object file */ -int load_object (const char *filename) +static int load_object (const char *filename) {int fd;struct elf_shdr *sec, *symtab_sec, *strtab_sec, *text_sec;
@@ -1227,7 +1227,7 @@#endif /* CONFIG_FORMAT_MACH */ /* return true if the expression is a label reference */ -int get_reloc_expr (char *name,int name_size,const char *sym_name) +static int get_reloc_expr (char *name,int name_size,const char *sym_name) {const char *p;
@@ -1294,8 +1294,8 @@#define MAX_ARGS 3/* generate op code */ -void gen_code (const char *name,host_ulong offset,host_ulong size, -FILE *outfile,int gen_switch) +static void gen_code (const char *name,host_ulong offset,host_ulong size, +FILE *outfile,int gen_switch) {int copy_size =0 ;uint8_t *p_start, *p_end;
@@ -2630,7 +2630,7 @@ } } -int gen_file (FILE *outfile,int out_type) +static int gen_file (FILE *outfile,int out_type) {int i;EXE_SYM *sym;
@@ -2742,7 +2742,7 @@return 0 ; } -void usage (void ) +static void usage (void ) {printf ("dyngen (c) 2003 Fabrice Bellard\n" "usage: dyngen [-o outfile] [-c] objfile\n"
Modified: trunk/exec.c
===================================================================
exec.c +1 -1
@@ -386,7 +386,7 @@static uint8_t static_code_gen_buffer[DEFAULT_CODE_GEN_BUFFER_SIZE ];#endif -void code_gen_alloc (unsigned long tb_size) +static void code_gen_alloc (unsigned long tb_size) {#ifdef USE_STATIC_CODE_GEN_BUFFER code_gen_buffer = static_code_gen_buffer;
Modified: trunk/hw/twl92230.c
===================================================================
hw/twl92230.c +1 -1
@@ -129,7 +129,7 @@menelaus_update (s); } -void menelaus_reset (i2c_slave *i2c) +static void menelaus_reset (i2c_slave *i2c) {struct menelaus_s *s = (struct menelaus_s *) i2c; s->reg =0x00 ;
Modified: trunk/hw/usb-serial.c
===================================================================
hw/usb-serial.c +3 -3
@@ -483,13 +483,13 @@qemu_free (s); } -int usb_serial_can_read (void *opaque) +static int usb_serial_can_read (void *opaque) {USBSerialState *s = opaque;return RECV_BUF - s->recv_used; } -void usb_serial_read (void *opaque,const uint8_t *buf,int size) +static void usb_serial_read (void *opaque,const uint8_t *buf,int size) {USBSerialState *s = opaque;int first_size =RECV_BUF - s->recv_ptr;
@@ -501,7 +501,7 @@ s->recv_used += size; } -void usb_serial_event (void *opaque,int event) +static void usb_serial_event (void *opaque,int event) {USBSerialState *s = opaque;
Modified: trunk/linux-user/main.c
===================================================================
linux-user/main.c +3 -1
@@ -107,10 +107,12 @@return 0 ; } +#if defined(TARGET_I386 )int cpu_get_pic_interrupt (CPUState *env) {return -1 ; } +#endif /* timers for rdtsc */
@@ -2151,7 +2153,7 @@ }#endif /* TARGET_ALPHA */ -void usage (void ) +static void usage (void ) {printf ("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
Modified: trunk/linux-user/signal.c
===================================================================
linux-user/signal.c +3 -2
@@ -154,7 +154,8 @@ d->sig[i] =tswapl (d1.sig[i]); } -void target_to_host_sigset_internal (sigset_t *d,const target_sigset_t *s) +static void target_to_host_sigset_internal (sigset_t *d, +const target_sigset_t *s) {int i;sigemptyset (d);
@@ -324,7 +325,7 @@ }/* abort execution with signal */ -void __attribute((noreturn))force_sig (int sig) +static void __attribute((noreturn))force_sig (int sig) {int host_sig; host_sig =target_to_host_signal (sig);
Modified: trunk/linux-user/syscall.c
===================================================================
linux-user/syscall.c +19 -15
@@ -105,38 +105,38 @@#undef _syscall6#define _syscall0 (type,name) \ -type name (void) \ +static type name (void) \ { \ return syscall(__NR_##name); \ }#define _syscall1 (type,name,type1,arg1) \ -type name (type1 arg1) \ +static type name (type1 arg1) \ { \ return syscall(__NR_##name, arg1); \ }#define _syscall2 (type,name,type1,arg1,type2,arg2) \ -type name (type1 arg1,type2 arg2) \ +static type name (type1 arg1,type2 arg2) \ { \ return syscall(__NR_##name, arg1, arg2); \ }#define _syscall3 (type,name,type1,arg1,type2,arg2,type3,arg3) \ -type name (type1 arg1,type2 arg2,type3 arg3) \ +static type name (type1 arg1,type2 arg2,type3 arg3) \ { \ return syscall(__NR_##name, arg1, arg2, arg3); \ }#define _syscall4 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4); \ }#define _syscall5 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5); \ }
@@ -144,7 +144,8 @@#define _syscall6 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5,type6,arg6) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ + type6 arg6) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \ }
@@ -204,8 +205,10 @@ _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);#endif _syscall2 (int, sys_getpriority, int, which, int, who); +#if !defined (__x86_64__)_syscall5 (int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); +#endif #if defined(TARGET_NR_linkat) && defined(__NR_linkat) _syscall5(int,sys_linkat,int,olddirfd,const char *,oldpath, int,newdirfd,const char *,newpath,int,flags)
@@ -253,11 +256,12 @@ _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, const struct timespec *,tsp,int,flags)#endif +#if defined(USE_NPTL )#if defined(TARGET_NR_futex) && defined(__NR_futex) _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, const struct timespec *,timeout,int *,uaddr2,int,val3) -#endif +#endif extern int personality (int );extern int flock (int ,int );
@@ -2522,8 +2526,8 @@ }/* specific and weird i386 syscalls */ -abi_long do_modify_ldt (CPUX86State *env,int func,abi_ulong ptr, -unsigned long bytecount) +static abi_long do_modify_ldt (CPUX86State *env,int func,abi_ulong ptr, +unsigned long bytecount) {abi_long ret;
@@ -2544,7 +2548,7 @@return ret; } -abi_long do_set_thread_area (CPUX86State *env,abi_ulong ptr) +static abi_long do_set_thread_area (CPUX86State *env,abi_ulong ptr) {uint64_t *gdt_table =g2h (env->gdt.base);struct target_modify_ldt_ldt_s ldt_info;
@@ -2629,7 +2633,7 @@return 0 ; } -abi_long do_get_thread_area (CPUX86State *env,abi_ulong ptr) +static abi_long do_get_thread_area (CPUX86State *env,abi_ulong ptr) {struct target_modify_ldt_ldt_s *target_ldt_info;uint64_t *gdt_table =g2h (env->gdt.base);
@@ -2677,7 +2681,7 @@ }#ifndef TARGET_ABI32 -abi_long do_arch_prctl (CPUX86State *env,int code,abi_ulong addr) +static abi_long do_arch_prctl (CPUX86State *env,int code,abi_ulong addr) {abi_long ret;abi_ulong val;
@@ -3150,8 +3154,8 @@futexes locally would make futexes shared between multiple processes tricky. However they're probably useless because guest atomic operations won't work either. */ -int do_futex (target_ulong uaddr,int op,int val,target_ulong timeout, -target_ulong uaddr2,int val3) +static int do_futex (target_ulong uaddr,int op,int val,target_ulong timeout, +target_ulong uaddr2,int val3) {struct timespec ts, *pts;
Modified: trunk/slirp/slirp.c
===================================================================
slirp/slirp.c +1 -1
@@ -554,7 +554,7 @@unsigned char ar_tip[4 ];/* target IP address */ }; -void arp_input (const uint8_t *pkt,int pkt_len) +static void arp_input (const uint8_t *pkt,int pkt_len) {struct ethhdr *eh = (struct ethhdr *)pkt;struct arphdr *ah = (struct arphdr *)(pkt +ETH_HLEN );
Modified: trunk/tcg/tcg.c
===================================================================
tcg/tcg.c +2 -15
@@ -196,19 +196,6 @@ s->pool_current =NULL ; } -/* free all the pool */ -void tcg_pool_free (TCGContext *s) -{ -TCGPool *p, *p1; - -for (p = s->pool_first; p !=NULL ; p = p1) { - p1 = p->next; -qemu_free (p); - } - s->pool_first =NULL ; - s->pool_cur = s->pool_end =NULL ; -} -void tcg_context_init (TCGContext *s) {int op, total_args, n;
@@ -655,7 +642,7 @@ }#endif -void tcg_reg_alloc_start (TCGContext *s) +static void tcg_reg_alloc_start (TCGContext *s) {int i;TCGTemp *ts;
@@ -1025,7 +1012,7 @@/* Liveness analysis : update the opc_dead_iargs array to tell if a given input arguments is dead. Instructions updating dead temporaries are removed. */ -void tcg_liveness_analysis (TCGContext *s) +static void tcg_liveness_analysis (TCGContext *s) {int i, op_index, op, nb_args, nb_iargs, nb_oargs, arg, nb_ops;TCGArg *args;
Modified: trunk/tcg/x86_64/tcg-target.c
===================================================================
tcg/x86_64/tcg-target.c +2 -2
@@ -108,7 +108,7 @@ }/* parse target specific constraints */ -int target_parse_constraint (TCGArgConstraint *ct,const char **pct_str) +static int target_parse_constraint (TCGArgConstraint *ct,const char **pct_str) {const char *ct_str;
@@ -404,7 +404,7 @@ } } -void tcg_out_addi (TCGContext *s,int reg,tcg_target_long val) +static void tcg_out_addi (TCGContext *s,int reg,tcg_target_long val) {if (val !=0 )tgen_arithi64 (s,ARITH_ADD , reg, val);
Modified: trunk/vl.c
===================================================================
vl.c +1 -1
@@ -2561,7 +2561,7 @@ } } -void pty_chr_timer (void *opaque) +static void pty_chr_timer (void *opaque) {struct CharDriverState *chr = opaque;PtyCharDriver *s = chr->opaque;
Quoted 9 lines · Blue Swirl
Revision: 5022
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5022 Author: blueswir1 Date: 2008-08-17 20:26:25 +0000 (Sun, 17 Aug 2008)Log Message:
-----------
Fix some warnings that would be generated by gcc -Wmissing-prototypes
...
Quoted 124 lines
Modified:
trunk/linux-user/syscall.c
===================================================================linux-user/syscall.c +17
-13@@ -105,38 +105,38 @@#undef _syscall6#define _syscall0 (type,name) \ -type name (void) \ +static type name (void) \ { \ return syscall(__NR_##name); \ }#define _syscall1 (type,name,type1,arg1) \ -type name (type1 arg1) \ +static type name (type1 arg1) \ { \ return syscall(__NR_##name, arg1); \ }#define _syscall2 (type,name,type1,arg1,type2,arg2) \ -type name (type1 arg1,type2 arg2) \ +static type name (type1 arg1,type2 arg2) \ { \ return syscall(__NR_##name, arg1, arg2); \ }#define _syscall3 (type,name,type1,arg1,type2,arg2,type3,arg3) \ -type name (type1 arg1,type2 arg2,type3 arg3) \ +static type name (type1 arg1,type2 arg2,type3 arg3) \ { \ return syscall(__NR_##name, arg1, arg2, arg3); \ }#define _syscall4 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4); \ }#define _syscall5 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5); \ }@@ -144,7 +144,8 @@#define _syscall6 (type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5,type6,arg6) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ +static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ + type6 arg6) \ { \ return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \ }@@ -204,8 +205,10 @@ _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);#endif _syscall2 (int, sys_getpriority, int, which, int, who); +#if !defined (__x86_64__)_syscall5 (int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); +#endif #if defined(TARGET_NR_linkat) && defined(__NR_linkat) _syscall5(int,sys_linkat,int,olddirfd,const char *,oldpath, int,newdirfd,const char *,newpath,int,flags)@@ -253,11 +256,12 @@ _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, const struct timespec *,tsp,int,flags)#endif +#if defined(USE_NPTL )#if defined(TARGET_NR_futex) && defined(__NR_futex) _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, const struct timespec *,timeout,int *,uaddr2,int,val3) -#endif +#endif extern int personality (int );extern int flock (int ,int );@@ -2522,8 +2526,8 @@ }/* specific and weird i386 syscalls */ -abi_long do_modify_ldt (CPUX86State *env,int func,abi_ulong ptr, -unsigned long bytecount) +static abi_long do_modify_ldt (CPUX86State *env,int func,abi_ulong ptr, +unsigned long bytecount) {abi_long ret;@@ -2544,7 +2548,7 @@return ret; } -abi_long do_set_thread_area (CPUX86State *env,abi_ulong ptr) +static abi_long do_set_thread_area (CPUX86State *env,abi_ulong ptr) {uint64_t *gdt_table =g2h (env->gdt.base);struct target_modify_ldt_ldt_s ldt_info;@@ -2629,7 +2633,7 @@return 0 ; } -abi_long do_get_thread_area (CPUX86State *env,abi_ulong ptr) +static abi_long do_get_thread_area (CPUX86State *env,abi_ulong ptr) {struct target_modify_ldt_ldt_s *target_ldt_info;uint64_t *gdt_table =g2h (env->gdt.base);@@ -2677,7 +2681,7 @@ }#ifndef TARGET_ABI32 -abi_long do_arch_prctl (CPUX86State *env,int code,abi_ulong addr) +static abi_long do_arch_prctl (CPUX86State *env,int code,abi_ulong addr) {abi_long ret;abi_ulong val;
linux-user/syscall.c line 3161
Quoted 10 lines
linux-user/syscall.c +2
-2@@ -3150,8 +3154,8 @@futexes locally would make futexes shared between multiple processes tricky. However they're probably useless because guest atomic operations won't work either. */ -int do_futex (target_ulong uaddr,int op,int val,target_ulong timeout, -target_ulong uaddr2,int val3) +static int do_futex (target_ulong uaddr,int op,int val,target_ulong timeout, +target_ulong uaddr2,int val3) {struct timespec ts, *pts;
To make syscall.c for 64 bit truly warning-free, we need some more #ifs.
--- linux-user/syscall.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
linux-user/syscall.c +5 -1
@@ -195,12 +195,14 @@ _syscall4(int,sys_faccessat,int,dirfd,co _syscall4(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode,int,flags)#endif -#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) +#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16 ) _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, uid_t,owner,gid_t,group,int,flags)#endif _syscall2(int,sys_getcwd1,char *,buf,size_t,size) +#if TARGET_ABI_BITS ==32 _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count); +#endif #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64) _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);#endif
@@ -2548,6 +2550,7 @@ static abi_long do_modify_ldt(CPUX86Statreturn ret; } +#if defined(TARGET_I386 ) && defined(TARGET_ABI32 )static abi_long do_set_thread_area (CPUX86State *env,abi_ulong ptr) {uint64_t *gdt_table =g2h (env->gdt.base);
@@ -2679,6 +2682,7 @@ static abi_long do_get_thread_area(CPUX8unlock_user_struct (target_ldt_info, ptr,1 ); return 0; } +#endif /* TARGET_I386 && TARGET_ABI32 */ #ifndef TARGET_ABI32 static abi_long do_arch_prctl (CPUX86State *env,int code,abi_ulong addr)