: fix wrong types
PATCH 1/5 : fix wrong types
gcc4 is more picky about the signedness of a pointer. Some variables were declared with an inappropriate signedness, this patch fixes this.
Signature · 9 lines
Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 277-84917 ----to satisfy European Law for business letters: AMD Saxony Limited Liability Company & Co. KG, Wilschdorfer Landstr. 101, 01109 Dresden, Germany Register Court Dresden: HRA 4896, General Partner authorized to represent: AMD Saxony LLC (Wilmington, Delaware, US) General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
tools/ioemu/audio/alsaaudio.c +4 -3
@@ -85,9 +85,9 @@ static struct { };struct alsa_params_req { -int freq; +unsigned int freq;audfmt_e fmt; -int nchannels; +unsigned int nchannels;unsigned int buffer_size;unsigned int period_size; };
@@ -258,7 +258,8 @@ static int alsa_open (int in, struct als {snd_pcm_t *handle;snd_pcm_hw_params_t *hw_params; -int err, freq, nchannels; +int err; +unsigned int freq, nchannels;const char *pcm_name = in ? conf.pcm_name_in : conf.pcm_name_out;unsigned int period_size, buffer_size;snd_pcm_uframes_t obt_buffer_size;
tools/ioemu/block-vvfat.c +1 -1
@@ -377,7 +377,7 @@ static void init_mbr(BDRVVVFATState* s)/* direntry functions */ /* dest is assumed to hold 258 bytes, and pads with 0xffff up to next multiple of 26 */ -static inline int short2long_name (unsigned char * dest,const char * src) +static inline int short2long_name (char * dest,const char * src) {int i;for (i=0 ;i<129 && src[i];i++) {
tools/ioemu/gdbstub.c +7 -7
@@ -60,7 +60,7 @@ typedef struct GDBState {char line_buf[4096 ];int line_buf_index;int line_csum; -char last_packet[4100 ]; +uint8_t last_packet[4100 ];int last_packet_len;#ifdef CONFIG_USER_ONLY int fd;
@@ -185,7 +185,7 @@ static int put_packet(GDBState *s, charstatic int put_packet (GDBState *s,char *buf) {int len, csum, i; -char *p; +uint8_t *p;#ifdef DEBUG_GDB printf ("reply='%s'\n" , buf);
@@ -982,7 +982,7 @@ static void gdb_read_byte(GDBState *s, i {CPUState *env = s->env;int i, csum; -char reply[1 ]; +uint8_t reply;#ifndef CONFIG_USER_ONLY if (s->last_packet_len) {
@@ -1040,12 +1040,12 @@ static void gdb_read_byte(GDBState *s, i csum += s->line_buf[i]; }if (s->line_csum != (csum &0xff )) { - reply[0 ] ='-' ; -put_buffer (s, reply,1 ); + reply ='-' ; +put_buffer (s, &reply,1 ); s->state =RS_IDLE ; }else { - reply[0 ] ='+' ; -put_buffer (s, reply,1 ); + reply ='+' ; +put_buffer (s, &reply,1 ); s->state =gdb_handle_packet (s, env, s->line_buf); }break ;
tools/ioemu/hw/fdc.c +1 -1
@@ -176,7 +176,7 @@ typedef struct fd_format_t {uint8_t last_sect;uint8_t max_track;uint8_t max_head; -const unsigned char *str; +const char *str; } fd_format_t;static fd_format_t fd_formats[] = {
tools/ioemu/hw/pass-through.c +5 -5
@@ -29,15 +29,15 @@extern FILE *logfile; -static int token_value (char *token) +static int token_value (const char *token) { token =strchr (token,'x' ) +1 ;return strtol (token,NULL ,16 ); } -static int next_bdf (char **str,int *seg,int *bus,int *dev,int *func) -{ -char *token; +static int next_bdf (char const ** str,int *seg,int *bus,int *dev,int *func) +{ +const char *token;if ( !(*str) || !strchr (*str,',' ) )return 0 ;
@@ -408,7 +408,7 @@ struct pt_dev * register_real_device(PCIreturn assigned_device; } -int pt_init (PCIBus *e_bus,char *direct_pci) +int pt_init (PCIBus *e_bus,const char *direct_pci) {int seg, b, d, f;struct pt_dev *pt_dev;
tools/ioemu/hw/pass-through.h +1 -1
@@ -83,7 +83,7 @@ struct pci_config_cf8 { }; }; -int pt_init (PCIBus * e_bus,char * direct_pci); +int pt_init (PCIBus * e_bus,const char * direct_pci);#endif /* __PASSTHROUGH_H__ */
tools/ioemu/hw/rtl8139.c +3 -2
@@ -3119,7 +3166,7 @@ static void rtl8139_save(QEMUFile* f,voistatic void rtl8139_save (QEMUFile * f,void * opaque) {RTL8139State * s=(RTL8139State *)opaque; -int i; +unsigned int i;pci_device_save (s->pci_dev, f);
@@ -3204,7 +3251,8 @@ static int rtl8139_load(QEMUFile* f,voidstatic int rtl8139_load (QEMUFile * f,void * opaque,int version_id) {RTL8139State * s=(RTL8139State *)opaque; -int i, ret; +unsigned int i; +int ret;/* just 2 versions for now */ if (version_id >3 )
tools/ioemu/hw/usb-uhci.c +3 -3
@@ -432,7 +432,7 @@ static void uhci_async_complete_packet(U0 if TD successful 1 if TD unsuccessful or inactive */ -static int uhci_handle_td (UHCIState *s,UHCI_TD *td,int *int_mask) +static int uhci_handle_td (UHCIState *s,UHCI_TD *td,uint32_t *int_mask) {uint8_t pid;int len, max_len, err, ret;
@@ -630,8 +630,8 @@ static void uhci_frame_timer(void *opaqu {UHCIState *s = opaque;int64_t expire_time; -uint32_t frame_addr, link, old_td_ctrl, val; -int int_mask, cnt, ret; +uint32_t frame_addr, link, old_td_ctrl, val, int_mask; +int cnt, ret;UHCI_TD td;UHCI_QH qh;uint32_t old_async_qh;
tools/ioemu/monitor.c +2 -2
@@ -61,7 +61,7 @@ static term_cmd_t term_cmds[];static term_cmd_t term_cmds[];static term_cmd_t info_cmds[]; -static char term_outbuf[1024 ]; +static uint8_t term_outbuf[1024 ];static int term_outbuf_index;static void monitor_start_input (void );
@@ -85,7 +85,7 @@ void term_flush(void)/* flush at every end of line or if the buffer is full */ void term_puts (const char *str) { -int c; +char c;for (;;) { c = *str++;if (c =='\0' )
tools/ioemu/vl.c +2 -2
@@ -2469,7 +2469,7 @@ typedef struct { typedef struct { int fd; struct sockaddr_in daddr; - char buf[1024]; + uint8_t buf[1024]; int bufcnt; int bufptr; int max_size;
@@ -2627,7 +2627,7 @@ static int tcp_chr_read_poll(void *opaqu#define IAC_BREAK 243static void tcp_chr_process_IAC_bytes (CharDriverState *chr,TCPCharDriver *s, -char *buf,int *size) +uint8_t *buf,int *size) {/* Handle any telnet client's basic IAC options to satisfy char by * char mode with no echo. All IAC options will be removed from
tools/ioemu/vnc.c +9 -9
@@ -989,7 +989,7 @@ ssize_t vnc_tls_pull(gnutls_transport_pt }#endif /* CONFIG_VNC_TLS */ -static void client_cut_text (VncState *vs,size_t len,char *text) +static void client_cut_text (VncState *vs,size_t len,uint8_t *text) { }
@@ -1542,11 +1542,11 @@ static void make_challenge(VncState *vs) vs->challenge[i] = (int ) (256.0 *rand ()/(RAND_MAX +1.0 )); } -static int protocol_client_auth_vnc (VncState *vs,char *data,size_t len) -{ -char response[VNC_AUTH_CHALLENGE_SIZE ]; +static int protocol_client_auth_vnc (VncState *vs,uint8_t *data,size_t len) +{ +unsigned char response[VNC_AUTH_CHALLENGE_SIZE ];int i, j, pwlen; -char key[8 ]; +unsigned char key[8 ];if (!vs->password || !vs->password[0 ]) {VNC_DEBUG ("No password configured on server" );
@@ -1953,7 +1953,7 @@ static int vnc_start_tls(struct VncStatereturn vnc_continue_handshake (vs); } -static int protocol_client_vencrypt_auth (VncState *vs,char *data,size_t len) +static int protocol_client_vencrypt_auth (VncState *vs,uint8_t *data,size_t len) {int auth =read_u32 (data,0 );
@@ -1983,7 +1983,7 @@ static int protocol_client_vencrypt_authreturn 0 ; } -static int protocol_client_vencrypt_init (VncState *vs,char *data,size_t len) +static int protocol_client_vencrypt_init (VncState *vs,uint8_t *data,size_t len) {if (data[0 ] !=0 || data[1 ] !=2 ) {
@@ -2013,7 +2013,7 @@ static int start_auth_vencrypt(VncState }#endif /* CONFIG_VNC_TLS */ -static int protocol_client_auth (VncState *vs,char *data,size_t len) +static int protocol_client_auth (VncState *vs,uint8_t *data,size_t len) {/* We only advertise 1 auth scheme at a time, so client * must pick the one we sent. Verify this */
@@ -2062,7 +2062,7 @@ static int protocol_client_auth(VncStatereturn 0 ; } -static int protocol_version (VncState *vs,char *version,size_t len) +static int protocol_version (VncState *vs,uint8_t *version,size_t len) {char local[13 ];
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel