fix gcc4 compile warnings
PATCH 1/1 fix gcc4 compile warnings
Hi,
attached a patch that fixes some warnings issued by gcc4 when compiling
Qemu. I know that Qemu does not work with gcc4, but Xen (and KVM) uses significant parts of Qemu and this works with gcc4. When compiling Xen I see a lot of those warnings and miss the serious ones
;-( , the patch fixes some of them (mostly signedness pointer warnings).
Please apply so that the other projects can pull the changes (Xensource will not accept pure Qemu patches on xen-devel).
The habit of using typecasts to fix those warnings is debatable, but this is the least intrusive approach.
BTW: What was the outcome of this socklen_t issue? I saw both "int" and "socklen_t" in the past, is there a policy regarding this?
Comments welcome.
Best regards,
Andre.
P.S. I haven't found something about the patch submitting policy on qemu-devel (inline or attachment, cvs diff or {git|hg} diff). Hope that my approach is OK.
Signature · 11 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 Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
Index: aes.c
===================================================================
RCS file: /sources/qemu/qemu/aes.c,v
retrieving revision 1.4
aes.c +3 -0
@@ -30,7 +30,10 @@#include "qemu-common.h" #include "aes.h" +#ifndef NDEBUG #define NDEBUG +#endif +#include <assert.h> typedef uint32_t u32 ;
Index: block-vpc.c
===================================================================
RCS file: /sources/qemu/qemu/block-vpc.c,v
retrieving revision 1.7
block-vpc.c +1 -1
@@ -81,7 +81,7 @@ typedef struct BDRVVPCState {static int vpc_probe (const uint8_t *buf,int buf_size,const char *filename) { -if (buf_size >=8 && !strncmp (buf,"conectix" ,8 )) +if (buf_size >=8 && !strncmp ((const char *)buf,"conectix" ,8 ))return 100 ;return 0 ; }
Index: block-vvfat.c
===================================================================
RCS file: /sources/qemu/qemu/block-vvfat.c,v
retrieving revision 1.13
block-vvfat.c +11 -11
@@ -412,7 +412,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++) {
@@ -565,7 +565,7 @@ static inline uint32_t fat_get(BDRVVVFATuint16_t * entry=array_get (&(s->fat),cluster);return le16_to_cpu (*entry); }else { -const uint8_t * x=s->fat.pointer+cluster*3 /2 ; +const uint8_t * x=(const uint8_t *)(s->fat.pointer)+cluster*3 /2 ;return ((x[0 ]|(x[1 ]<<8 ))>>(cluster&1 ?4 :0 ))&0x0fff ; } }
@@ -626,7 +626,7 @@ static inline direntry_t* create_short_a entry=array_get_next (&(s->directory));memset (entry->name,0x20 ,11 ); -strncpy (entry->name,filename,i); +strncpy ((char *)entry->name,filename,i);if (j >0 )for (i =0 ; i <3 && filename[j+1 +i]; i++)
@@ -868,7 +868,7 @@ static int init_directories(BDRVVVFATSta {direntry_t * entry=array_get_next (&(s->directory)); entry->attributes=0x28 ;/* archive | volume label */ -snprintf (entry->name,11 ,"QEMU VVFAT" ); +snprintf ((char *)entry->name,11 ,"QEMU VVFAT" ); }/* Now build FAT, and write back information into directory */
@@ -1187,7 +1187,7 @@ static inline int read_cluster(BDRVVVFAT s->current_mapping = mapping; read_cluster_directory: offset = s->cluster_size*(cluster_num-s->current_mapping->begin); - s->cluster = s->directory.pointer+offset + s->cluster = (unsigned char *)s->directory.pointer+offset +0x20 *s->current_mapping->info.dir.first_dir_index;assert (((s->cluster-(unsigned char *)s->directory.pointer)%s->cluster_size)==0 );assert ((char *)s->cluster+s->cluster_size <= s->directory.pointer+s->directory.next*s->directory.item_size);
@@ -1457,7 +1457,7 @@ static int parse_long_name(long_file_nam }if (pointer[0 ] &0x40 ) - lfn->len = offset +strlen (lfn->name + offset); + lfn->len = offset +strlen ((char *)lfn->name + offset);return 0 ; }
@@ -1496,7 +1496,7 @@ static int parse_short_name(BDRVVVFATSta }else lfn->name[i + j +1 ] ='\0' ; - lfn->len =strlen (lfn->name); + lfn->len =strlen ((char *)lfn->name);return 0 ; }
@@ -1792,8 +1792,8 @@ DLOG(fprintf(stderr, "check direntry %d:fprintf (stderr,"Error in short name (%d)\n" , subret); goto fail; } -if (subret >0 || !strcmp (lfn.name,"." ) - || !strcmp (lfn.name,".." )) +if (subret >0 || !strcmp ((char *)lfn.name,"." ) + || !strcmp ((char *)lfn.name,".." ))continue ; } lfn.checksum =0x100 ;/* cannot use long name twice */
@@ -1802,7 +1802,7 @@ DLOG(fprintf(stderr, "check direntry %d:fprintf (stderr,"Name too long: %s/%s\n" , path, lfn.name); goto fail; } -strcpy (path2 + path_len +1 , lfn.name); +strcpy (path2 + path_len +1 , (char *)lfn.name);if (is_directory (direntries + i)) {if (begin_of_direntry (direntries + i) ==0 ) {
@@ -2234,7 +2234,7 @@ static int commit_one_file(BDRVVVFATStatassert (size >=0 ); ret =vvfat_read (s->bs,cluster2sector (s, c), - cluster, (rest_size +0x1ff ) /0x200 ); + (uint8_t *)cluster, (rest_size +0x1ff ) /0x200 );if (ret <0 )return ret;
Index: gdbstub.c
===================================================================
RCS file: /sources/qemu/qemu/gdbstub.c,v
retrieving revision 1.71
gdbstub.c +4 -4
@@ -209,7 +209,7 @@ static int put_packet(GDBState *s, char *(p++) =tohex ((csum) &0xf ); s->last_packet_len = p - s->last_packet; -put_buffer (s, s->last_packet, s->last_packet_len); +put_buffer (s, (uint8_t *)s->last_packet, s->last_packet_len);#ifdef CONFIG_USER_ONLY i =get_char (s);
@@ -1189,7 +1189,7 @@ static void gdb_read_byte(GDBState *s, i#ifdef DEBUG_GDB printf ("Got NACK, retransmitting\n" );#endif -put_buffer (s, s->last_packet, s->last_packet_len); +put_buffer (s, (uint8_t *)s->last_packet, s->last_packet_len); }#ifdef DEBUG_GDB else if (ch == '+')
@@ -1238,11 +1238,11 @@ static void gdb_read_byte(GDBState *s, i }if (s->line_csum != (csum &0xff )) { reply[0 ] ='-' ; -put_buffer (s, reply,1 ); +put_buffer (s, (uint8_t *)reply,1 ); s->state =RS_IDLE ; }else { reply[0 ] ='+' ; -put_buffer (s, reply,1 ); +put_buffer (s, (uint8_t *)reply,1 ); s->state =gdb_handle_packet (s, env, s->line_buf); }break ;
Index: monitor.c
===================================================================
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.87
monitor.c +13 -13
@@ -85,7 +85,7 @@ void term_flush(void)if (term_outbuf_index >0 ) {for (i =0 ; i <MAX_MON ; i++)if (monitor_hd[i] && monitor_hd[i]->focus ==0 ) -qemu_chr_write (monitor_hd[i], term_outbuf, term_outbuf_index); +qemu_chr_write (monitor_hd[i], (uint8_t *)term_outbuf, term_outbuf_index); term_outbuf_index =0 ; } }
@@ -1818,7 +1818,7 @@ static int64_t expr_unary(void)case '$' : {char buf[128 ], *q; -target_long reg; +target_long reg=0 ; pch++; q = buf;
@@ -2035,7 +2035,7 @@ static void monitor_handle_command(constchar cmdname[256 ];char buf[1024 ];void *str_allocated[MAX_ARGS ]; -void *args[MAX_ARGS ]; +intptr_t args[MAX_ARGS ];#ifdef DEBUG term_printf ("command='%s'\n" , cmdline);
@@ -2119,7 +2119,7 @@ static void monitor_handle_command(constterm_printf ("%s: too many arguments\n" , cmdname); goto fail; } - args[nb_args++] = str; + args[nb_args++] = (intptr_t )str; }break ;case '/' :
@@ -2197,9 +2197,9 @@ static void monitor_handle_command(const }if (nb_args +3 >MAX_ARGS ) goto error_args; - args[nb_args++] = (void *)(long )count; - args[nb_args++] = (void *)(long )format; - args[nb_args++] = (void *)(long )size; + args[nb_args++] = count; + args[nb_args++] = format; + args[nb_args++] = size; }break ;case 'i' :
@@ -2228,7 +2228,7 @@ static void monitor_handle_command(const typestr++;if (nb_args >=MAX_ARGS ) goto error_args; - args[nb_args++] = (void *)(long )has_arg; + args[nb_args++] = has_arg;if (!has_arg) {if (nb_args >=MAX_ARGS ) goto error_args;
@@ -2242,16 +2242,16 @@ static void monitor_handle_command(constif (c =='i' ) {if (nb_args >=MAX_ARGS ) goto error_args; - args[nb_args++] = (void *)(long )val; + args[nb_args++] = val; }else {if ((nb_args +1 ) >=MAX_ARGS ) goto error_args;#if TARGET_PHYS_ADDR_BITS >32 - args[nb_args++] = (void *)(long )((val >>32 ) &0xffffffff ); + args[nb_args++] = ((val >>32 ) &0xffffffff );#else - args[nb_args++] = (void *)0 ; + args[nb_args++] =0 ;#endif - args[nb_args++] = (void *)(long )(val &0xffffffff ); + args[nb_args++] = (val &0xffffffff ); } }break ;
@@ -2278,7 +2278,7 @@ static void monitor_handle_command(const }if (nb_args >=MAX_ARGS ) goto error_args; - args[nb_args++] = (void *)(long )has_option; + args[nb_args++] = has_option; }break ;default :
Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.373
vl.c +20 -19
@@ -1115,9 +1115,9 @@ static void timer_save(QEMUFile *f, voidif (cpu_ticks_enabled) {hw_error ("cannot save state if virtual timers are running" ); } -qemu_put_be64s (f, &cpu_ticks_offset); -qemu_put_be64s (f, &ticks_per_sec); -qemu_put_be64s (f, &cpu_clock_offset); +qemu_put_be64s (f, (uint64_t *)&cpu_ticks_offset); +qemu_put_be64s (f, (uint64_t *)&ticks_per_sec); +qemu_put_be64s (f, (uint64_t *)&cpu_clock_offset); }static int timer_load (QEMUFile *f,void *opaque,int version_id)
@@ -1127,10 +1127,10 @@ static int timer_load(QEMUFile *f, voidif (cpu_ticks_enabled) {return -EINVAL ; } -qemu_get_be64s (f, &cpu_ticks_offset); -qemu_get_be64s (f, &ticks_per_sec); +qemu_get_be64s (f, (uint64_t *)&cpu_ticks_offset); +qemu_get_be64s (f, (uint64_t *)&ticks_per_sec);if (version_id ==2 ) { -qemu_get_be64s (f, &cpu_clock_offset); +qemu_get_be64s (f, (uint64_t *)&cpu_clock_offset); }return 0 ; }
@@ -1606,7 +1606,7 @@ void qemu_chr_printf(CharDriverState *s,va_list ap;va_start (ap, fmt);vsnprintf (buf,sizeof (buf), fmt, ap); -qemu_chr_write (s, buf,strlen (buf)); +qemu_chr_write (s, (uint8_t *)buf,strlen (buf));va_end (ap); }
@@ -1695,7 +1695,7 @@ static int mux_chr_write(CharDriverState (secs /60 ) %60 , secs %60 , (int)((ti / 1000000) % 1000)); - d->drv->chr_write (d->drv, buf1,strlen (buf1)); + d->drv->chr_write (d->drv, (uint8_t *)buf1,strlen (buf1)); } } }
@@ -1726,13 +1726,13 @@ static void mux_print_help(CharDriverSta }else {sprintf (cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r" , term_escape_char); } - chr->chr_write (chr, cbuf,strlen (cbuf)); + chr->chr_write (chr, (uint8_t *)cbuf,strlen (cbuf));for (i =0 ; mux_help[i] !=NULL ; i++) {for (j=0 ; mux_help[i][j] !='\0' ; j++) {if (mux_help[i][j] =='%' ) - chr->chr_write (chr, ebuf,strlen (ebuf)); + chr->chr_write (chr, (uint8_t *)ebuf,strlen (ebuf));else - chr->chr_write (chr, &mux_help[i][j],1 ); + chr->chr_write (chr, (uint8_t *)&mux_help[i][j],1 ); } } }
@@ -1751,7 +1751,7 @@ static int mux_proc_byte(CharDriverStatecase 'x' : {char *term ="QEMU: Terminated\n\r" ; - chr->chr_write (chr,term,strlen (term)); + chr->chr_write (chr,(uint8_t *)term,strlen (term));exit (0 );break ; }
@@ -2900,7 +2900,7 @@ static int udp_chr_read_poll(void *opaqu* first */ while (s->max_size >0 && s->bufptr < s->bufcnt) { -qemu_chr_read (chr, &s->buf[s->bufptr],1 ); +qemu_chr_read (chr, (uint8_t *)&s->buf[s->bufptr],1 ); s->bufptr++; s->max_size =qemu_chr_can_read (chr); }
@@ -2921,7 +2921,7 @@ static void udp_chr_read(void *opaque) s->bufptr =0 ;while (s->max_size >0 && s->bufptr < s->bufcnt) { -qemu_chr_read (chr, &s->buf[s->bufptr],1 ); +qemu_chr_read (chr, (uint8_t *)&s->buf[s->bufptr],1 ); s->bufptr++; s->max_size =qemu_chr_can_read (chr); }
@@ -3033,7 +3033,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
@@ -4396,7 +4396,8 @@ static NetSocketState *net_socket_fd_ini {int so_type=-1 , optlen=sizeof (so_type); -if (getsockopt (fd,SOL_SOCKET ,SO_TYPE , (char *)&so_type, &optlen)<0 ) { +if (getsockopt (fd,SOL_SOCKET ,SO_TYPE , (char *)&so_type, + (socklen_t *)&optlen)<0 ) {fprintf (stderr,"qemu: error: getsockopt(SO_TYPE) for fd=%d failed\n" , fd);return NULL ; }
@@ -5413,7 +5414,7 @@ static int qemu_savevm_state(QEMUFile *f/* ID string */ len =strlen (se->idstr);qemu_put_byte (f, len); -qemu_put_buffer (f, se->idstr, len); +qemu_put_buffer (f, (uint8_t *)se->idstr, len);qemu_put_be32 (f, se->instance_id);qemu_put_be32 (f, se->version_id);
@@ -5474,7 +5475,7 @@ static int qemu_loadvm_state(QEMUFile *fif (qemu_ftell (f) >= end_pos)break ; len =qemu_get_byte (f); -qemu_get_buffer (f, idstr, len); +qemu_get_buffer (f, (uint8_t *)idstr, len); idstr[len] ='\0' ; instance_id =qemu_get_be32 (f); version_id =qemu_get_be32 (f);
@@ -7901,7 +7902,7 @@ int main(int argc, char **argv)/* We just do some generic consistency checks */ {/* Could easily be extended to 64 devices if needed */ -const unsigned char *p; +const char *p; boot_devices_bitmap =0 ;for (p = boot_devices; *p !='\0' ; p++) {
Index: vnc.c
===================================================================
RCS file: /sources/qemu/qemu/vnc.c,v
retrieving revision 1.29
vnc.c +27 -23
129 lines not on this page · raw message
Index: vnchextile.h
===================================================================
RCS file: /sources/qemu/qemu/vnchextile.h,v
retrieving revision 1.4
vnchextile.h +1 -1
@@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, Nuint32_t *last_fg32, int *has_bg, int *has_fg) { - char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); + uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth);pixel_t *irow = (pixel_t *)row;int j, i;pixel_t *last_bg = (pixel_t *)last_bg32;
Index: audio/alsaaudio.c
===================================================================
RCS file: /sources/qemu/qemu/audio/alsaaudio.c,v
retrieving revision 1.11
alsaaudio.c +3 -2
@@ -331,7 +331,8 @@ static int alsa_open (int in, struct als goto err; } - err =snd_pcm_hw_params_set_rate_near (handle, hw_params, &freq,0 ); + err =snd_pcm_hw_params_set_rate_near (handle, hw_params, + (unsigned int *)&freq,0 );if (err <0 ) {alsa_logerr2 (err, typ,"Failed to set frequency %d\n" , req->freq); goto err;
@@ -340,7 +341,7 @@ static int alsa_open (int in, struct als err =snd_pcm_hw_params_set_channels_near ( handle, hw_params, - &nchannels + (unsigned int *)&nchannels );if (err <0 ) { alsa_logerr2 (err, typ, "Failed to set number of channels %d\n",
Index: hw/acpi.c
===================================================================
RCS file: /sources/qemu/qemu/hw/acpi.c,v
retrieving revision 1.17
acpi.c +2 -2
@@ -439,7 +439,7 @@ static void pm_save(QEMUFile* f,void *opqemu_put_8s (f, &s->apmc);qemu_put_8s (f, &s->apms);qemu_put_timer (f, s->tmr_timer); -qemu_put_be64s (f, &s->tmr_overflow_time); +qemu_put_be64s (f, (uint64_t *)&s->tmr_overflow_time); }static int pm_load (QEMUFile * f,void * opaque,int version_id)
@@ -460,7 +460,7 @@ static int pm_load(QEMUFile* f,void* opaqemu_get_8s (f, &s->apmc);qemu_get_8s (f, &s->apms);qemu_get_timer (f, s->tmr_timer); -qemu_get_be64s (f, &s->tmr_overflow_time); +qemu_get_be64s (f, (uint64_t *)&s->tmr_overflow_time);pm_io_space_update (s);
Index: hw/apic.c
===================================================================
RCS file: /sources/qemu/qemu/hw/apic.c,v
retrieving revision 1.18
apic.c +6 -6
@@ -761,10 +761,10 @@ static void apic_save(QEMUFile *f, voidqemu_put_be32s (f, &s->icr[0 ]);qemu_put_be32s (f, &s->icr[1 ]);qemu_put_be32s (f, &s->divide_conf); -qemu_put_be32s (f, &s->count_shift); +qemu_put_be32s (f, (uint32_t *)&s->count_shift);qemu_put_be32s (f, &s->initial_count); -qemu_put_be64s (f, &s->initial_count_load_time); -qemu_put_be64s (f, &s->next_time); +qemu_put_be64s (f, (uint64_t *)&s->initial_count_load_time); +qemu_put_be64s (f, (uint64_t *)&s->next_time);qemu_put_timer (f, s->timer); }
@@ -797,10 +797,10 @@ static int apic_load(QEMUFile *f, void *qemu_get_be32s (f, &s->icr[0 ]);qemu_get_be32s (f, &s->icr[1 ]);qemu_get_be32s (f, &s->divide_conf); -qemu_get_be32s (f, &s->count_shift); +qemu_get_be32s (f, (uint32_t *)&s->count_shift);qemu_get_be32s (f, &s->initial_count); -qemu_get_be64s (f, &s->initial_count_load_time); -qemu_get_be64s (f, &s->next_time); +qemu_get_be64s (f, (uint64_t *)&s->initial_count_load_time); +qemu_get_be64s (f, (uint64_t *)&s->next_time);if (version_id >=2 )qemu_get_timer (f, s->timer);
Index: hw/cirrus_vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/cirrus_vga.c,v
retrieving revision 1.29
cirrus_vga.c +4 -4
@@ -2985,7 +2985,7 @@ static void cirrus_vga_save(QEMUFile *f,qemu_put_buffer (f, s->gr +2 ,254 );qemu_put_8s (f, &s->ar_index);qemu_put_buffer (f, s->ar,21 ); -qemu_put_be32s (f, &s->ar_flip_flop); +qemu_put_be32s (f, (uint32_t *)&s->ar_flip_flop);qemu_put_8s (f, &s->cr_index);qemu_put_buffer (f, s->cr,256 );qemu_put_8s (f, &s->msr);
@@ -3000,7 +3000,7 @@ static void cirrus_vga_save(QEMUFile *f,qemu_put_buffer (f, s->dac_cache,3 );qemu_put_buffer (f, s->palette,768 ); -qemu_put_be32s (f, &s->bank_offset); +qemu_put_be32s (f, (uint32_t *)&s->bank_offset);qemu_put_8s (f, &s->cirrus_hidden_dac_lockindex);qemu_put_8s (f, &s->cirrus_hidden_dac_data);
@@ -3036,7 +3036,7 @@ static int cirrus_vga_load(QEMUFile *f,qemu_get_buffer (f, s->gr +2 ,254 );qemu_get_8s (f, &s->ar_index);qemu_get_buffer (f, s->ar,21 ); -qemu_get_be32s (f, &s->ar_flip_flop); +qemu_get_be32s (f, (uint32_t *)&s->ar_flip_flop);qemu_get_8s (f, &s->cr_index);qemu_get_buffer (f, s->cr,256 );qemu_get_8s (f, &s->msr);
@@ -3051,7 +3051,7 @@ static int cirrus_vga_load(QEMUFile *f,qemu_get_buffer (f, s->dac_cache,3 );qemu_get_buffer (f, s->palette,768 ); -qemu_get_be32s (f, &s->bank_offset); +qemu_get_be32s (f, (uint32_t *)&s->bank_offset);qemu_get_8s (f, &s->cirrus_hidden_dac_lockindex);qemu_get_8s (f, &s->cirrus_hidden_dac_data);
Index: hw/dma.c
===================================================================
RCS file: /sources/qemu/qemu/hw/dma.c,v
retrieving revision 1.16
dma.c +6 -6
@@ -482,12 +482,12 @@ static void dma_save (QEMUFile *f, voidqemu_put_8s (f, &d->command);qemu_put_8s (f, &d->mask);qemu_put_8s (f, &d->flip_flop); -qemu_put_be32s (f, &d->dshift); +qemu_put_be32s (f, (uint32_t *)&d->dshift);for (i =0 ; i <4 ; ++i) {struct dma_regs *r = &d->regs[i]; -qemu_put_be32s (f, &r->now[0 ]); -qemu_put_be32s (f, &r->now[1 ]); +qemu_put_be32s (f, (uint32_t *)&r->now[0 ]); +qemu_put_be32s (f, (uint32_t *)&r->now[1 ]);qemu_put_be16s (f, &r->base[0 ]);qemu_put_be16s (f, &r->base[1 ]);qemu_put_8s (f, &r->mode);
@@ -510,12 +510,12 @@ static int dma_load (QEMUFile *f, void *qemu_get_8s (f, &d->command);qemu_get_8s (f, &d->mask);qemu_get_8s (f, &d->flip_flop); -qemu_get_be32s (f, &d->dshift); +qemu_get_be32s (f, (uint32_t *)&d->dshift);for (i =0 ; i <4 ; ++i) {struct dma_regs *r = &d->regs[i]; -qemu_get_be32s (f, &r->now[0 ]); -qemu_get_be32s (f, &r->now[1 ]); +qemu_get_be32s (f, (uint32_t *)&r->now[0 ]); +qemu_get_be32s (f, (uint32_t *)&r->now[1 ]);qemu_get_be16s (f, &r->base[0 ]);qemu_get_be16s (f, &r->base[1 ]);qemu_get_8s (f, &r->mode);
Index: hw/fdc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/fdc.c,v
retrieving revision 1.33
fdc.c +1 -1
@@ -180,7 +180,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 const fd_format_t fd_formats[] = {
Index: hw/i8254.c
===================================================================
RCS file: /sources/qemu/qemu/hw/i8254.c,v
retrieving revision 1.12
i8254.c +6 -6
@@ -397,7 +397,7 @@ static void pit_save(QEMUFile *f, void *for (i =0 ; i <3 ; i++) { s = &pit->channels[i]; -qemu_put_be32s (f, &s->count); +qemu_put_be32s (f, (uint32_t *)&s->count);qemu_put_be16s (f, &s->latched_count);qemu_put_8s (f, &s->count_latched);qemu_put_8s (f, &s->status_latched);
@@ -409,9 +409,9 @@ static void pit_save(QEMUFile *f, void *qemu_put_8s (f, &s->mode);qemu_put_8s (f, &s->bcd);qemu_put_8s (f, &s->gate); -qemu_put_be64s (f, &s->count_load_time); +qemu_put_be64s (f, (uint64_t *)&s->count_load_time);if (s->irq_timer) { -qemu_put_be64s (f, &s->next_transition_time); +qemu_put_be64s (f, (uint64_t *)&s->next_transition_time);qemu_put_timer (f, s->irq_timer); } }
@@ -428,7 +428,7 @@ static int pit_load(QEMUFile *f, void *ofor (i =0 ; i <3 ; i++) { s = &pit->channels[i]; -qemu_get_be32s (f, &s->count); +qemu_get_be32s (f, (uint32_t *)&s->count);qemu_get_be16s (f, &s->latched_count);qemu_get_8s (f, &s->count_latched);qemu_get_8s (f, &s->status_latched);
@@ -440,9 +440,9 @@ static int pit_load(QEMUFile *f, void *oqemu_get_8s (f, &s->mode);qemu_get_8s (f, &s->bcd);qemu_get_8s (f, &s->gate); -qemu_get_be64s (f, &s->count_load_time); +qemu_get_be64s (f, (uint64_t *)&s->count_load_time);if (s->irq_timer) { -qemu_get_be64s (f, &s->next_transition_time); +qemu_get_be64s (f, (uint64_t *)&s->next_transition_time);qemu_get_timer (f, s->irq_timer); } }
Index: hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.72
ide.c +13 -13
@@ -471,12 +471,12 @@ static void ide_identify(IDEState *s)put_le16 (p +5 ,512 );/* XXX: retired, remove ? */ put_le16 (p +6 , s->sectors);snprintf (buf,sizeof (buf),"QM%05d" , s->drive_serial); -padstr ((uint8_t *)(p +10 ), buf,20 );/* serial number */ +padstr ((char *)(p +10 ), buf,20 );/* serial number */ put_le16 (p +20 ,3 );/* XXX: retired, remove ? */ put_le16 (p +21 ,512 );/* cache size in sectors */ put_le16 (p +22 ,4 );/* ecc bytes */ -padstr ((uint8_t *)(p +23 ),QEMU_VERSION ,8 );/* firmware version */ -padstr ((uint8_t *)(p +27 ),"QEMU HARDDISK" ,40 );/* model */ +padstr ((char *)(p +23 ),QEMU_VERSION ,8 );/* firmware version */ +padstr ((char *)(p +27 ),"QEMU HARDDISK" ,40 );/* model */ #if MAX_MULT_SECTORS >1 put_le16 (p +47 ,0x8000 |MAX_MULT_SECTORS );#endif
@@ -536,12 +536,12 @@ static void ide_atapi_identify(IDEState/* Removable CDROM, 50us response, 12 byte packets */ put_le16 (p +0 , (2 <<14 ) | (5 <<8 ) | (1 <<7 ) | (2 <<5 ) | (0 <<0 ));snprintf (buf,sizeof (buf),"QM%05d" , s->drive_serial); -padstr ((uint8_t *)(p +10 ), buf,20 );/* serial number */ +padstr ((char *)(p +10 ), buf,20 );/* serial number */ put_le16 (p +20 ,3 );/* buffer type */ put_le16 (p +21 ,512 );/* cache size in sectors */ put_le16 (p +22 ,4 );/* ecc bytes */ -padstr ((uint8_t *)(p +23 ),QEMU_VERSION ,8 );/* firmware version */ -padstr ((uint8_t *)(p +27 ),"QEMU CD-ROM" ,40 );/* model */ +padstr ((char *)(p +23 ),QEMU_VERSION ,8 );/* firmware version */ +padstr ((char *)(p +27 ),"QEMU CD-ROM" ,40 );/* model */ put_le16 (p +48 ,1 );/* dword I/O (XXX: should not be set on CDROM) */ #ifdef USE_DMA_CDROM put_le16 (p +49 ,1 <<9 |1 <<8 );/* DMA and LBA supported */
@@ -591,10 +591,10 @@ static void ide_cfata_identify(IDEStateput_le16 (p +7 , s->nb_sectors >>16 );/* Sectors per card */ put_le16 (p +8 , s->nb_sectors);/* Sectors per card */ snprintf (buf,sizeof (buf),"QM%05d" , s->drive_serial); -padstr ((uint8_t *)(p +10 ), buf,20 );/* Serial number in ASCII */ +padstr ((char *)(p +10 ), buf,20 );/* Serial number in ASCII */ put_le16 (p +22 ,0x0004 );/* ECC bytes */ -padstr ((uint8_t *) (p +23 ),QEMU_VERSION ,8 );/* Firmware Revision */ -padstr ((uint8_t *) (p +27 ),"QEMU MICRODRIVE" ,40 );/* Model number */ +padstr ((char *) (p +23 ),QEMU_VERSION ,8 );/* Firmware Revision */ +padstr ((char *) (p +27 ),"QEMU MICRODRIVE" ,40 );/* Model number */ #if MAX_MULT_SECTORS >1 put_le16 (p +47 ,0x8000 |MAX_MULT_SECTORS );#else
@@ -2508,8 +2508,8 @@ static void ide_init_ioport(IDEState *id/* save per IDE drive data */ static void ide_save (QEMUFile * f,IDEState *s) { -qemu_put_be32s (f, &s->mult_sectors); -qemu_put_be32s (f, &s->identify_set); +qemu_put_be32s (f, (uint32_t *)&s->mult_sectors); +qemu_put_be32s (f, (uint32_t *)&s->identify_set);if (s->identify_set) {qemu_put_buffer (f, (const uint8_t *)s->identify_data,512 ); }
@@ -2536,8 +2536,8 @@ static void ide_save(QEMUFile* f, IDESta/* load per IDE drive data */ static void ide_load (QEMUFile * f,IDEState *s) { -qemu_get_be32s (f, &s->mult_sectors); -qemu_get_be32s (f, &s->identify_set); +qemu_get_be32s (f, (uint32_t *)&s->mult_sectors); +qemu_get_be32s (f, (uint32_t *)&s->identify_set);if (s->identify_set) {qemu_get_buffer (f, (uint8_t *)s->identify_data,512 ); }
Index: hw/mc146818rtc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/mc146818rtc.c,v
retrieving revision 1.15
mc146818rtc.c +18 -18
@@ -421,18 +421,18 @@ static void rtc_save(QEMUFile *f, void *qemu_put_buffer (f, s->cmos_data,128 );qemu_put_8s (f, &s->cmos_index); -qemu_put_be32s (f, &s->current_tm.tm_sec); -qemu_put_be32s (f, &s->current_tm.tm_min); -qemu_put_be32s (f, &s->current_tm.tm_hour); -qemu_put_be32s (f, &s->current_tm.tm_wday); -qemu_put_be32s (f, &s->current_tm.tm_mday); -qemu_put_be32s (f, &s->current_tm.tm_mon); -qemu_put_be32s (f, &s->current_tm.tm_year); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_sec); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_min); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_hour); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_wday); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_mday); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_mon); +qemu_put_be32s (f, (uint32_t *)&s->current_tm.tm_year);qemu_put_timer (f, s->periodic_timer); -qemu_put_be64s (f, &s->next_periodic_time); +qemu_put_be64s (f, (uint64_t *)&s->next_periodic_time); -qemu_put_be64s (f, &s->next_second_time); +qemu_put_be64s (f, (uint64_t *)&s->next_second_time);qemu_put_timer (f, s->second_timer);qemu_put_timer (f, s->second_timer2); }
@@ -447,18 +447,18 @@ static int rtc_load(QEMUFile *f, void *oqemu_get_buffer (f, s->cmos_data,128 );qemu_get_8s (f, &s->cmos_index); -qemu_get_be32s (f, &s->current_tm.tm_sec); -qemu_get_be32s (f, &s->current_tm.tm_min); -qemu_get_be32s (f, &s->current_tm.tm_hour); -qemu_get_be32s (f, &s->current_tm.tm_wday); -qemu_get_be32s (f, &s->current_tm.tm_mday); -qemu_get_be32s (f, &s->current_tm.tm_mon); -qemu_get_be32s (f, &s->current_tm.tm_year); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_sec); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_min); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_hour); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_wday); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_mday); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_mon); +qemu_get_be32s (f, (uint32_t *)&s->current_tm.tm_year);qemu_get_timer (f, s->periodic_timer); -qemu_get_be64s (f, &s->next_periodic_time); +qemu_get_be64s (f, (uint64_t *)&s->next_periodic_time); -qemu_get_be64s (f, &s->next_second_time); +qemu_get_be64s (f, (uint64_t *)&s->next_second_time);qemu_get_timer (f, s->second_timer);qemu_get_timer (f, s->second_timer2);return 0 ;
Index: hw/ne2000.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ne2000.c,v
retrieving revision 1.31
ne2000.c +21 -22
71 lines not on this page · raw message
Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.95
pc.c +1 -1
@@ -548,7 +548,7 @@ static void load_linux(const char *kerne initrd_max = ram_size-ACPI_DATA_SIZE -1 ;/* kernel command line */ -pstrcpy (cmdline_addr,4096 , kernel_cmdline); +pstrcpy ((char *)cmdline_addr,4096 , kernel_cmdline);if (protocol >=0x202 ) {stl_p (header+0x228 , cmdline_addr-phys_ram_base);
Index: hw/pcnet.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pcnet.c,v
retrieving revision 1.20
pcnet.c +16 -16
@@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetS }else { s->phys_mem_read (s->dma_opaque, addr, (void *)tmd,sizeof (*tmd),0 );le32_to_cpus (&tmd->tbadr); -le16_to_cpus (&tmd->length); -le16_to_cpus (&tmd->status); +le16_to_cpus ((uint16_t *)&tmd->length); +le16_to_cpus ((uint16_t *)&tmd->status);le32_to_cpus (&tmd->misc);le32_to_cpus (&tmd->res);if (BCR_SWSTYLE (s) ==3 ) {
@@ -416,8 +416,8 @@ static inline void pcnet_rmd_load(PCNetS }else { s->phys_mem_read (s->dma_opaque, addr, (void *)rmd,sizeof (*rmd),0 );le32_to_cpus (&rmd->rbadr); -le16_to_cpus (&rmd->buf_length); -le16_to_cpus (&rmd->status); +le16_to_cpus ((uint16_t *)&rmd->buf_length); +le16_to_cpus ((uint16_t *)&rmd->status);le32_to_cpus (&rmd->msg_length);le32_to_cpus (&rmd->res);if (BCR_SWSTYLE (s) ==3 ) {
@@ -1843,9 +1843,9 @@ static void pcnet_save(QEMUFile *f, voidif (s->pci_dev)pci_device_save (s->pci_dev, f); -qemu_put_be32s (f, &s->rap); -qemu_put_be32s (f, &s->isr); -qemu_put_be32s (f, &s->lnkst); +qemu_put_be32s (f, (uint32_t *)&s->rap); +qemu_put_be32s (f, (uint32_t *)&s->isr); +qemu_put_be32s (f, (uint32_t *)&s->lnkst);qemu_put_be32s (f, &s->rdra);qemu_put_be32s (f, &s->tdra);qemu_put_buffer (f, s->prom,16 );
@@ -1854,10 +1854,10 @@ static void pcnet_save(QEMUFile *f, voidfor (i =0 ; i <32 ; i++)qemu_put_be16s (f, &s->bcr[i]);qemu_put_be64s (f, &s->timer); -qemu_put_be32s (f, &s->xmit_pos); -qemu_put_be32s (f, &s->recv_pos); +qemu_put_be32s (f, (uint32_t *)&s->xmit_pos); +qemu_put_be32s (f, (uint32_t *)&s->recv_pos);qemu_put_buffer (f, s->buffer,4096 ); -qemu_put_be32s (f, &s->tx_busy); +qemu_put_be32s (f, (uint32_t *)&s->tx_busy);qemu_put_timer (f, s->poll_timer); }
@@ -1875,9 +1875,9 @@ static int pcnet_load(QEMUFile *f, voidreturn ret; } -qemu_get_be32s (f, &s->rap); -qemu_get_be32s (f, &s->isr); -qemu_get_be32s (f, &s->lnkst); +qemu_get_be32s (f, (uint32_t *)&s->rap); +qemu_get_be32s (f, (uint32_t *)&s->isr); +qemu_get_be32s (f, (uint32_t *)&s->lnkst);qemu_get_be32s (f, &s->rdra);qemu_get_be32s (f, &s->tdra);qemu_get_buffer (f, s->prom,16 );
@@ -1886,10 +1886,10 @@ static int pcnet_load(QEMUFile *f, voidfor (i =0 ; i <32 ; i++)qemu_get_be16s (f, &s->bcr[i]);qemu_get_be64s (f, &s->timer); -qemu_get_be32s (f, &s->xmit_pos); -qemu_get_be32s (f, &s->recv_pos); +qemu_get_be32s (f, (uint32_t *)&s->xmit_pos); +qemu_get_be32s (f, (uint32_t *)&s->recv_pos);qemu_get_buffer (f, s->buffer,4096 ); -qemu_get_be32s (f, &s->tx_busy); +qemu_get_be32s (f, (uint32_t *)&s->tx_busy);qemu_get_timer (f, s->poll_timer);return 0 ;
Index: hw/ps2.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ps2.c,v
retrieving revision 1.9
ps2.c +18 -18
@@ -470,19 +470,19 @@ static void ps2_reset(void *opaque)static void ps2_common_save (QEMUFile *f,PS2State *s) { -qemu_put_be32s (f, &s->write_cmd); -qemu_put_be32s (f, &s->queue.rptr); -qemu_put_be32s (f, &s->queue.wptr); -qemu_put_be32s (f, &s->queue.count); +qemu_put_be32s (f, (uint32_t *)&s->write_cmd); +qemu_put_be32s (f, (uint32_t *)&s->queue.rptr); +qemu_put_be32s (f, (uint32_t *)&s->queue.wptr); +qemu_put_be32s (f, (uint32_t *)&s->queue.count);qemu_put_buffer (f, s->queue.data,sizeof (s->queue.data)); }static void ps2_common_load (QEMUFile *f,PS2State *s) { -qemu_get_be32s (f, &s->write_cmd); -qemu_get_be32s (f, &s->queue.rptr); -qemu_get_be32s (f, &s->queue.wptr); -qemu_get_be32s (f, &s->queue.count); +qemu_get_be32s (f, (uint32_t *)&s->write_cmd); +qemu_get_be32s (f, (uint32_t *)&s->queue.rptr); +qemu_get_be32s (f, (uint32_t *)&s->queue.wptr); +qemu_get_be32s (f, (uint32_t *)&s->queue.count);qemu_get_buffer (f, s->queue.data,sizeof (s->queue.data)); }
@@ -491,8 +491,8 @@ static void ps2_kbd_save(QEMUFile* f, voPS2KbdState *s = (PS2KbdState *)opaque;ps2_common_save (f, &s->common); -qemu_put_be32s (f, &s->scan_enabled); -qemu_put_be32s (f, &s->translate); +qemu_put_be32s (f, (uint32_t *)&s->scan_enabled); +qemu_put_be32s (f, (uint32_t *)&s->translate); }static void ps2_mouse_save (QEMUFile * f,void * opaque)
@@ -506,9 +506,9 @@ static void ps2_mouse_save(QEMUFile* f,qemu_put_8s (f, &s->mouse_wrap);qemu_put_8s (f, &s->mouse_type);qemu_put_8s (f, &s->mouse_detect_state); -qemu_put_be32s (f, &s->mouse_dx); -qemu_put_be32s (f, &s->mouse_dy); -qemu_put_be32s (f, &s->mouse_dz); +qemu_put_be32s (f, (uint32_t *)&s->mouse_dx); +qemu_put_be32s (f, (uint32_t *)&s->mouse_dy); +qemu_put_be32s (f, (uint32_t *)&s->mouse_dz);qemu_put_8s (f, &s->mouse_buttons); }
@@ -520,8 +520,8 @@ static int ps2_kbd_load(QEMUFile* f, voireturn -EINVAL ;ps2_common_load (f, &s->common); -qemu_get_be32s (f, &s->scan_enabled); -qemu_get_be32s (f, &s->translate); +qemu_get_be32s (f, (uint32_t *)&s->scan_enabled); +qemu_get_be32s (f, (uint32_t *)&s->translate);return 0 ; }
@@ -539,9 +539,9 @@ static int ps2_mouse_load(QEMUFile* f, vqemu_get_8s (f, &s->mouse_wrap);qemu_get_8s (f, &s->mouse_type);qemu_get_8s (f, &s->mouse_detect_state); -qemu_get_be32s (f, &s->mouse_dx); -qemu_get_be32s (f, &s->mouse_dy); -qemu_get_be32s (f, &s->mouse_dz); +qemu_get_be32s (f, (uint32_t *)&s->mouse_dx); +qemu_get_be32s (f, (uint32_t *)&s->mouse_dy); +qemu_get_be32s (f, (uint32_t *)&s->mouse_dz);qemu_get_8s (f, &s->mouse_buttons);return 0 ; }
Index: hw/rtl8139.c
===================================================================
RCS file: /sources/qemu/qemu/hw/rtl8139.c,v
retrieving revision 1.16
rtl8139.c +9 -8
@@ -3119,7 +3119,7 @@ static uint32_t rtl8139_mmio_readl(voidstatic void rtl8139_save (QEMUFile * f,void * opaque) {RTL8139State * s=(RTL8139State *)opaque; -int i; +unsigned int i;pci_device_save (s->pci_dev, f);
@@ -3172,7 +3172,7 @@ static void rtl8139_save(QEMUFile* f,voi i =0 ;qemu_put_be32s (f, &i);/* unused. */ qemu_put_buffer (f, s->macaddr,6 ); -qemu_put_be32s (f, &s->rtl8139_mmio_io_addr); +qemu_put_be32s (f, (uint32_t *)&s->rtl8139_mmio_io_addr);qemu_put_be32s (f, &s->currTxDesc);qemu_put_be32s (f, &s->currCPlusRxDesc);
@@ -3184,7 +3184,7 @@ static void rtl8139_save(QEMUFile* f,voi {qemu_put_be16s (f, &s->eeprom.contents[i]); } -qemu_put_be32s (f, &s->eeprom.mode); +qemu_put_be32s (f, (uint32_t *)&s->eeprom.mode);qemu_put_be32s (f, &s->eeprom.tick);qemu_put_8s (f, &s->eeprom.address);qemu_put_be16s (f, &s->eeprom.input);
@@ -3197,7 +3197,7 @@ static void rtl8139_save(QEMUFile* f,voiqemu_put_be32s (f, &s->TCTR);qemu_put_be32s (f, &s->TimerInt); -qemu_put_be64s (f, &s->TCTR_base); +qemu_put_be64s (f, (uint64_t *)&s->TCTR_base);RTL8139TallyCounters_save (f, &s->tally_counters); }
@@ -3205,7 +3205,8 @@ static void rtl8139_save(QEMUFile* f,voistatic 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 )
@@ -3266,7 +3267,7 @@ static int rtl8139_load(QEMUFile* f,voidqemu_get_be32s (f, &i);/* unused. */ qemu_get_buffer (f, s->macaddr,6 ); -qemu_get_be32s (f, &s->rtl8139_mmio_io_addr); +qemu_get_be32s (f, (uint32_t *)&s->rtl8139_mmio_io_addr);qemu_get_be32s (f, &s->currTxDesc);qemu_get_be32s (f, &s->currCPlusRxDesc);
@@ -3278,7 +3279,7 @@ static int rtl8139_load(QEMUFile* f,void {qemu_get_be16s (f, &s->eeprom.contents[i]); } -qemu_get_be32s (f, &s->eeprom.mode); +qemu_get_be32s (f, (uint32_t *)&s->eeprom.mode);qemu_get_be32s (f, &s->eeprom.tick);qemu_get_8s (f, &s->eeprom.address);qemu_get_be16s (f, &s->eeprom.input);
@@ -3294,7 +3295,7 @@ static int rtl8139_load(QEMUFile* f,void {qemu_get_be32s (f, &s->TCTR);qemu_get_be32s (f, &s->TimerInt); -qemu_get_be64s (f, &s->TCTR_base); +qemu_get_be64s (f, (uint64_t *)&s->TCTR_base);RTL8139TallyCounters_load (f, &s->tally_counters); }
Index: hw/sb16.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sb16.c,v
retrieving revision 1.24
sb16.c +60 -60
160 lines not on this page · raw message
Index: hw/sd.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sd.c,v
retrieving revision 1.10
sd.c +1 -1
@@ -353,7 +353,7 @@ static void sd_reset(SDState *sd, BlockDuint32_t size;uint64_t sect; -bdrv_get_geometry (bdrv, §); +bdrv_get_geometry (bdrv, (int64_t *)§); sect <<=9 ;if (sect >0x40000000 )
Index: hw/usb-uhci.c
===================================================================
RCS file: /sources/qemu/qemu/hw/usb-uhci.c,v
retrieving revision 1.22
usb-uhci.c +3 -3
@@ -508,7 +508,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,int completion) {uint8_t pid;
@@ -733,8 +733,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;
Index: hw/vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vga.c,v
retrieving revision 1.58
vga.c +5 -5
@@ -1687,12 +1687,12 @@ static void vga_save(QEMUFile *f, void *qemu_put_buffer (f, s->gr,16 );qemu_put_8s (f, &s->ar_index);qemu_put_buffer (f, s->ar,21 ); -qemu_put_be32s (f, &s->ar_flip_flop); +qemu_put_be32s (f, (uint32_t *)&s->ar_flip_flop);qemu_put_8s (f, &s->cr_index);qemu_put_buffer (f, s->cr,256 );qemu_put_8s (f, &s->msr);qemu_put_8s (f, &s->fcr); -qemu_put_8s (f, &s->st00); +qemu_put_8s (f, (uint8_t *)&s->st00);qemu_put_8s (f, &s->st01);qemu_put_8s (f, &s->dac_state);
@@ -1702,7 +1702,7 @@ static void vga_save(QEMUFile *f, void *qemu_put_buffer (f, s->dac_cache,3 );qemu_put_buffer (f, s->palette,768 ); -qemu_put_be32s (f, &s->bank_offset); +qemu_put_be32s (f, (uint32_t *)&s->bank_offset);#ifdef CONFIG_BOCHS_VBE qemu_put_byte (f,1 );qemu_put_be16s (f, &s->vbe_index);
@@ -1737,7 +1737,7 @@ static int vga_load(QEMUFile *f, void *oqemu_get_buffer (f, s->gr,16 );qemu_get_8s (f, &s->ar_index);qemu_get_buffer (f, s->ar,21 ); -qemu_get_be32s (f, &s->ar_flip_flop); +qemu_get_be32s (f, (uint32_t *)&s->ar_flip_flop);qemu_get_8s (f, &s->cr_index);qemu_get_buffer (f, s->cr,256 );qemu_get_8s (f, &s->msr);
@@ -1752,7 +1752,7 @@ static int vga_load(QEMUFile *f, void *oqemu_get_buffer (f, s->dac_cache,3 );qemu_get_buffer (f, s->palette,768 ); -qemu_get_be32s (f, &s->bank_offset); +qemu_get_be32s (f, (uint32_t *)&s->bank_offset); is_vbe =qemu_get_byte (f);#ifdef CONFIG_BOCHS_VBE if (!is_vbe)
Index: hw/vmware_vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vmware_vga.c,v
retrieving revision 1.4
vmware_vga.c +24 -24
65 lines not on this page · raw message
Hi,
Quoted 1,611 lines · André Przywara
attached a patch that fixes some warnings issued by gcc4 when compiling Qemu. I know that Qemu does not work with gcc4, but Xen (and KVM) uses significant parts of Qemu and this works with gcc4. When compiling Xen I see a lot of those warnings and miss the serious ones ;-( , the patch fixes some of them (mostly signedness pointer warnings). Please apply so that the other projects can pull the changes (Xensource will not accept pure Qemu patches on xen-devel).
The habit of using typecasts to fix those warnings is debatable, but this is the least intrusive approach.
BTW: What was the outcome of this
socklen_tissue? I saw both "int" and "socklen_t" in the past, is there a policy regarding this?Comments welcome.
Best regards,
Andre.
P.S. I haven't found something about the patch submitting policy on qemu-devel (inline or attachment, cvs diff or {git|hg} diff). Hope that my approach is OK.--
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
Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoyIndex:
aes.c
===================================================================
RCS file: /sources/qemu/qemu/aes.c,v
retrieving revision 1.4
diff -u -p -r1.4aes.caes.c 29 Nov 2007 23:50:00 -0000 renamed from aes.c 11 Nov 2007 02:51:15 -0000 1.4 +3
-0@@ -30,7 +30,10 @@ #include "qemu-common.h" #include "aes.h" +#ifndef NDEBUG #define NDEBUG +#endif + #include <assert.h> typedef uint32_t u32;Index:
block-vpc.c
===================================================================
RCS file: /sources/qemu/qemu/block-vpc.c,v
retrieving revision 1.7
diff -u -p -r1.7block-vpc.cblock-vpc.c 29 Nov 2007 23:50:00 -0000 renamed from block-vpc.c 11 Nov 2007 02:51:16 -0000 1.7 +1
-1@@ -81,7 +81,7 @@ typedef struct BDRVVPCState { static int vpc_probe(const uint8_t *buf, int buf_size, const char *filename) { - if (buf_size >= 8 && !strncmp(buf, "conectix", 8)) + if (buf_size >= 8 && !strncmp((const char *)buf, "conectix", 8)) return 100; return 0; }Index:
block-vvfat.c
===================================================================
RCS file: /sources/qemu/qemu/block-vvfat.c,v
retrieving revision 1.13
diff -u -p -r1.13block-vvfat.cblock-vvfat.c 29 Nov 2007 23:50:00 -0000 renamed from block-vvfat.c 18 Nov 2007 01:44:35 -0000 1.13 +11
-11@@ -412,7 +412,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++) {@@ -565,7 +565,7 @@ static inline uint32_t fat_get(BDRVVVFAT uint16_t* entry=array_get(&(s->fat),cluster); return le16_to_cpu(*entry); } else { - const uint8_t* x=s->fat.pointer+cluster*3/2; + const uint8_t* x=(const uint8_t*)(s->fat.pointer)+cluster*3/2; return ((x[0]|(x[1]<<8))>>(cluster&1?4:0))&0x0fff; } }@@ -626,7 +626,7 @@ static inline direntry_t* create_short_a entry=array_get_next(&(s->directory)); memset(entry->name,0x20,11); - strncpy(entry->name,filename,i); + strncpy((char*)entry->name,filename,i); if(j > 0) for (i = 0; i < 3 && filename[j+1+i]; i++)@@ -868,7 +868,7 @@ static int init_directories(BDRVVVFATSta { direntry_t* entry=array_get_next(&(s->directory)); entry->attributes=0x28; /* archive | volume label */ - snprintf(entry->name,11,"QEMU VVFAT"); + snprintf((char*)entry->name,11,"QEMU VVFAT"); } /* Now build FAT, and write back information into directory */@@ -1187,7 +1187,7 @@ static inline int read_cluster(BDRVVVFAT s->current_mapping = mapping; read_cluster_directory: offset = s->cluster_size*(cluster_num-s->current_mapping->begin); - s->cluster = s->directory.pointer+offset + s->cluster = (unsigned char*)s->directory.pointer+offset + 0x20*s->current_mapping->info.dir.first_dir_index; assert(((s->cluster-(unsigned char*)s->directory.pointer)%s->cluster_size)==0); assert((char*)s->cluster+s->cluster_size <= s->directory.pointer+s->directory.next*s->directory.item_size);@@ -1457,7 +1457,7 @@ static int parse_long_name(long_file_nam } if (pointer[0] & 0x40) - lfn->len = offset + strlen(lfn->name + offset); + lfn->len = offset + strlen((char*)lfn->name + offset); return 0; }@@ -1496,7 +1496,7 @@ static int parse_short_name(BDRVVVFATSta } else lfn->name[i + j + 1] = '\0'; - lfn->len = strlen(lfn->name); + lfn->len = strlen((char*)lfn->name); return 0; }@@ -1792,8 +1792,8 @@ DLOG(fprintf(stderr, "check direntry %d: fprintf(stderr, "Error in short name (%d)\n", subret); goto fail; } - if (subret > 0 || !strcmp(lfn.name, ".") - || !strcmp(lfn.name, "..")) + if (subret > 0 || !strcmp((char*)lfn.name, ".") + || !strcmp((char*)lfn.name, "..")) continue; } lfn.checksum = 0x100; /* cannot use long name twice */@@ -1802,7 +1802,7 @@ DLOG(fprintf(stderr, "check direntry %d: fprintf(stderr, "Name too long: %s/%s\n", path, lfn.name); goto fail; } - strcpy(path2 + path_len + 1, lfn.name); + strcpy(path2 + path_len + 1, (char*)lfn.name); if (is_directory(direntries + i)) { if (begin_of_direntry(direntries + i) == 0) {@@ -2234,7 +2234,7 @@ static int commit_one_file(BDRVVVFATStat assert(size >= 0); ret = vvfat_read(s->bs, cluster2sector(s, c), - cluster, (rest_size + 0x1ff) / 0x200); + (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); if (ret < 0) return ret;Index:
gdbstub.c
===================================================================
RCS file: /sources/qemu/qemu/gdbstub.c,v
retrieving revision 1.71
diff -u -p -r1.71gdbstub.cgdbstub.c 29 Nov 2007 23:50:00 -0000 renamed from gdbstub.c 17 Nov 2007 17:14:37 -0000 1.71 +4
-4@@ -209,7 +209,7 @@ static int put_packet(GDBState *s, char *(p++) = tohex((csum) & 0xf); s->last_packet_len = p - s->last_packet; - put_buffer(s, s->last_packet, s->last_packet_len); + put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); #ifdef CONFIG_USER_ONLY i = get_char(s);@@ -1189,7 +1189,7 @@ static void gdb_read_byte(GDBState *s, i #ifdef DEBUG_GDB printf("Got NACK, retransmitting\n"); #endif - put_buffer(s, s->last_packet, s->last_packet_len); + put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); } #ifdef DEBUG_GDB else if (ch == '+')@@ -1238,11 +1238,11 @@ static void gdb_read_byte(GDBState *s, i } if (s->line_csum != (csum & 0xff)) { reply[0] = '-'; - put_buffer(s, reply, 1); + put_buffer(s, (uint8_t *)reply, 1); s->state = RS_IDLE; } else { reply[0] = '+'; - put_buffer(s, reply, 1); + put_buffer(s, (uint8_t *)reply, 1); s->state = gdb_handle_packet(s, env, s->line_buf); } break;Index:
monitor.c
===================================================================
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.87
diff -u -p -r1.87monitor.cmonitor.c 29 Nov 2007 23:50:00 -0000 renamed from monitor.c 18 Nov 2007 01:44:35 -0000 1.87 +13
-13@@ -85,7 +85,7 @@ void term_flush(void) if (term_outbuf_index > 0) { for (i = 0; i < MAX_MON; i++) if (monitor_hd[i] && monitor_hd[i]->focus == 0) - qemu_chr_write(monitor_hd[i], term_outbuf, term_outbuf_index); + qemu_chr_write(monitor_hd[i], (uint8_t*)term_outbuf, term_outbuf_index); term_outbuf_index = 0; } }@@ -1818,7 +1818,7 @@ static int64_t expr_unary(void) case '$': { char buf[128], *q; - target_long reg; + target_long reg=0; pch++; q = buf;@@ -2035,7 +2035,7 @@ static void monitor_handle_command(const char cmdname[256]; char buf[1024]; void *str_allocated[MAX_ARGS]; - void *args[MAX_ARGS]; + intptr_t args[MAX_ARGS]; #ifdef DEBUG term_printf("command='%s'\n", cmdline);@@ -2119,7 +2119,7 @@ static void monitor_handle_command(const term_printf("%s: too many arguments\n", cmdname); goto fail; } - args[nb_args++] = str; + args[nb_args++] = (intptr_t)str; } break; case '/':@@ -2197,9 +2197,9 @@ static void monitor_handle_command(const } if (nb_args + 3 > MAX_ARGS) goto error_args; - args[nb_args++] = (void*)(long)count; - args[nb_args++] = (void*)(long)format; - args[nb_args++] = (void*)(long)size; + args[nb_args++] = count; + args[nb_args++] = format; + args[nb_args++] = size; } break; case 'i':@@ -2228,7 +2228,7 @@ static void monitor_handle_command(const typestr++; if (nb_args >= MAX_ARGS) goto error_args; - args[nb_args++] = (void *)(long)has_arg; + args[nb_args++] = has_arg; if (!has_arg) { if (nb_args >= MAX_ARGS) goto error_args;@@ -2242,16 +2242,16 @@ static void monitor_handle_command(const if (c == 'i') { if (nb_args >= MAX_ARGS) goto error_args; - args[nb_args++] = (void *)(long)val; + args[nb_args++] = val; } else { if ((nb_args + 1) >= MAX_ARGS) goto error_args; #if TARGET_PHYS_ADDR_BITS > 32 - args[nb_args++] = (void *)(long)((val >> 32) & 0xffffffff); + args[nb_args++] = ((val >> 32) & 0xffffffff); #else - args[nb_args++] = (void *)0; + args[nb_args++] = 0; #endif - args[nb_args++] = (void *)(long)(val & 0xffffffff); + args[nb_args++] = (val & 0xffffffff); } } break;@@ -2278,7 +2278,7 @@ static void monitor_handle_command(const } if (nb_args >= MAX_ARGS) goto error_args; - args[nb_args++] = (void *)(long)has_option; + args[nb_args++] = has_option; } break; default:Index:
vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.373
diff -u -p -r1.373vl.cvl.c 29 Nov 2007 23:50:01 -0000 renamed from vl.c 25 Nov 2007 01:57:38 -0000 1.373 +20
-19@@ -1115,9 +1115,9 @@ static void timer_save(QEMUFile *f, void if (cpu_ticks_enabled) { hw_error("cannot save state if virtual timers are running"); } - qemu_put_be64s(f, &cpu_ticks_offset); - qemu_put_be64s(f, &ticks_per_sec); - qemu_put_be64s(f, &cpu_clock_offset); + qemu_put_be64s(f, (uint64_t *)&cpu_ticks_offset); + qemu_put_be64s(f, (uint64_t *)&ticks_per_sec); + qemu_put_be64s(f, (uint64_t *)&cpu_clock_offset); } static int timer_load(QEMUFile *f, void *opaque, int version_id)@@ -1127,10 +1127,10 @@ static int timer_load(QEMUFile *f, void if (cpu_ticks_enabled) { return -EINVAL; } - qemu_get_be64s(f, &cpu_ticks_offset); - qemu_get_be64s(f, &ticks_per_sec); + qemu_get_be64s(f, (uint64_t *)&cpu_ticks_offset); + qemu_get_be64s(f, (uint64_t *)&ticks_per_sec); if (version_id == 2) { - qemu_get_be64s(f, &cpu_clock_offset); + qemu_get_be64s(f, (uint64_t *)&cpu_clock_offset); } return 0; }@@ -1606,7 +1606,7 @@ void qemu_chr_printf(CharDriverState *s, va_list ap; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); - qemu_chr_write(s, buf, strlen(buf)); + qemu_chr_write(s, (uint8_t *)buf, strlen(buf)); va_end(ap); }@@ -1695,7 +1695,7 @@ static int mux_chr_write(CharDriverState (secs / 60) % 60, secs % 60, (int)((ti / 1000000) % 1000)); - d->drv->chr_write(d->drv, buf1, strlen(buf1)); + d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1)); } } }@@ -1726,13 +1726,13 @@ static void mux_print_help(CharDriverSta } else { sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", term_escape_char); } - chr->chr_write(chr, cbuf, strlen(cbuf)); + chr->chr_write(chr, (uint8_t *)cbuf, strlen(cbuf)); for (i = 0; mux_help[i] != NULL; i++) { for (j=0; mux_help[i][j] != '\0'; j++) { if (mux_help[i][j] == '%') - chr->chr_write(chr, ebuf, strlen(ebuf)); + chr->chr_write(chr, (uint8_t *)ebuf, strlen(ebuf)); else - chr->chr_write(chr, &mux_help[i][j], 1); + chr->chr_write(chr, (uint8_t *)&mux_help[i][j], 1); } } }@@ -1751,7 +1751,7 @@ static int mux_proc_byte(CharDriverState case 'x': { char *term = "QEMU: Terminated\n\r"; - chr->chr_write(chr,term,strlen(term)); + chr->chr_write(chr,(uint8_t *)term,strlen(term)); exit(0); break; }@@ -2900,7 +2900,7 @@ static int udp_chr_read_poll(void *opaqu * first */ while (s->max_size > 0 && s->bufptr < s->bufcnt) { - qemu_chr_read(chr, &s->buf[s->bufptr], 1); + qemu_chr_read(chr, (uint8_t *)&s->buf[s->bufptr], 1); s->bufptr++; s->max_size = qemu_chr_can_read(chr); }@@ -2921,7 +2921,7 @@ static void udp_chr_read(void *opaque) s->bufptr = 0; while (s->max_size > 0 && s->bufptr < s->bufcnt) { - qemu_chr_read(chr, &s->buf[s->bufptr], 1); + qemu_chr_read(chr, (uint8_t *)&s->buf[s->bufptr], 1); s->bufptr++; s->max_size = qemu_chr_can_read(chr); }@@ -3033,7 +3033,7 @@ static int tcp_chr_read_poll(void *opaqu #define IAC_BREAK 243 static 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@@ -4396,7 +4396,8 @@ static NetSocketState *net_socket_fd_ini { int so_type=-1, optlen=sizeof(so_type); - if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type, &optlen)< 0) { + if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type, + (socklen_t *)&optlen)< 0) { fprintf(stderr, "qemu: error: getsockopt(SO_TYPE) for fd=%d failed\n", fd); return NULL; }@@ -5413,7 +5414,7 @@ static int qemu_savevm_state(QEMUFile *f /* ID string */ len = strlen(se->idstr); qemu_put_byte(f, len); - qemu_put_buffer(f, se->idstr, len); + qemu_put_buffer(f, (uint8_t *)se->idstr, len); qemu_put_be32(f, se->instance_id); qemu_put_be32(f, se->version_id);@@ -5474,7 +5475,7 @@ static int qemu_loadvm_state(QEMUFile *f if (qemu_ftell(f) >= end_pos) break; len = qemu_get_byte(f); - qemu_get_buffer(f, idstr, len); + qemu_get_buffer(f, (uint8_t *)idstr, len); idstr[len] = '\0'; instance_id = qemu_get_be32(f); version_id = qemu_get_be32(f);@@ -7901,7 +7902,7 @@ int main(int argc, char **argv) /* We just do some generic consistency checks */ { /* Could easily be extended to 64 devices if needed */ - const unsigned char *p; + const char *p; boot_devices_bitmap = 0; for (p = boot_devices; *p != '\0'; p++) {Index:
vnc.c
===================================================================
RCS file: /sources/qemu/qemu/vnc.c,v
retrieving revision 1.29
diff -u -p -r1.29vnc.cvnc.c 29 Nov 2007 23:50:01 -0000 renamed from vnc.c 18 Nov 2007 01:44:36 -0000 1.29 +27
-23@@ -369,7 +369,7 @@ static void vnc_write_pixels_generic(Vnc static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h) { int i; - char *row; + uint8_t *row; vnc_framebuffer_update(vs, x, y, w, h, 0);@@ -433,8 +433,8 @@ static void send_framebuffer_update(VncS static void vnc_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h) { int src, dst; - char *src_row; - char *dst_row; + uint8_t *src_row; + uint8_t *dst_row; char *old_row; int y = 0; int pitch = ds->linesize;@@ -492,7 +492,7 @@ static void vnc_update_client(void *opaq if (vs->need_update && vs->csock != -1) { int y; - char *row; + uint8_t *row; char *old_row; uint32_t width_mask[VNC_DIRTY_WORDS]; int n_rectangles;@@ -509,10 +509,11 @@ static void vnc_update_client(void *opaq for (y = 0; y < vs->height; y++) { if (vnc_and_bits(vs->dirty_row[y], width_mask, VNC_DIRTY_WORDS)) { int x; - char *ptr, *old_ptr; + uint8_t *ptr; + char *old_ptr; ptr = row; - old_ptr = old_row; + old_ptr = (char*)old_row; for (x = 0; x < vs->ds->width; x += 16) { if (memcmp(old_ptr, ptr, 16 * vs->depth) == 0) {@@ -1184,22 +1185,23 @@ static int protocol_client_msg(VncState if (len == 1) return 20; - set_pixel_format(vs, read_u8(data, 4), read_u8(data, 5), - read_u8(data, 6), read_u8(data, 7), - read_u16(data, 8), read_u16(data, 10), - read_u16(data, 12), read_u8(data, 14), - read_u8(data, 15), read_u8(data, 16)); + set_pixel_format(vs, read_u8((uint8_t *)data, 4), + read_u8((uint8_t *)data, 5), read_u8((uint8_t *)data, 6), + read_u8((uint8_t *)data, 7), read_u16((uint8_t *)data, 8), + read_u16((uint8_t *)data, 10), read_u16((uint8_t *)data, 12), + read_u8((uint8_t *)data, 14), read_u8((uint8_t *)data, 15), + read_u8((uint8_t *)data, 16)); break; case 2: if (len == 1) return 4; if (len == 4) - return 4 + (read_u16(data, 2) * 4); + return 4 + (read_u16((uint8_t *)data, 2) * 4); - limit = read_u16(data, 2); + limit = read_u16((uint8_t *)data, 2); for (i = 0; i < limit; i++) { - int32_t val = read_s32(data, 4 + (i * 4)); + int32_t val = read_s32((uint8_t *)data, 4 + (i * 4)); memcpy(data + 4 + (i * 4), &val, sizeof(val)); }@@ -1210,32 +1212,34 @@ static int protocol_client_msg(VncState return 10; framebuffer_update_request(vs, - read_u8(data, 1), read_u16(data, 2), read_u16(data, 4), - read_u16(data, 6), read_u16(data, 8)); + read_u8((uint8_t *)data, 1), read_u16((uint8_t *)data, 2), + read_u16((uint8_t *)data, 4), read_u16((uint8_t *)data, 6), + read_u16((uint8_t *)data, 8)); break; case 4: if (len == 1) return 8; - key_event(vs, read_u8(data, 1), read_u32(data, 4)); + key_event(vs, read_u8((uint8_t *)data, 1), read_u32((uint8_t *)data, 4)); break; case 5: if (len == 1) return 6; - pointer_event(vs, read_u8(data, 1), read_u16(data, 2), read_u16(data, 4)); + pointer_event(vs, read_u8((uint8_t *)data, 1), read_u16((uint8_t *)data, 2), + read_u16((uint8_t *)data, 4)); break; case 6: if (len == 1) return 8; if (len == 8) { - uint32_t dlen = read_u32(data, 4); + uint32_t dlen = read_u32((uint8_t *)data, 4); if (dlen > 0) return 8 + dlen; } - client_cut_text(vs, read_u32(data, 4), data + 8); + client_cut_text(vs, read_u32((uint8_t *)data, 4), data + 8); break; default: printf("Msg: %d\n", data[0]);@@ -1322,9 +1326,9 @@ static void make_challenge(VncState *vs) static int protocol_client_auth_vnc(VncState *vs, char *data, size_t len) { - char response[VNC_AUTH_CHALLENGE_SIZE]; + 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");@@ -1733,7 +1737,7 @@ static int vnc_start_tls(struct VncState static int protocol_client_vencrypt_auth(VncState *vs, char *data, size_t len) { - int auth = read_u32(data, 0); + int auth = read_u32((uint8_t *)data, 0); if (auth != vs->subauth) { VNC_DEBUG("Rejecting auth %d\n", auth);Index:
vnchextile.h
===================================================================
RCS file: /sources/qemu/qemu/vnchextile.h,v
retrieving revision 1.4
diff -u -p -r1.4vnchextile.hvnchextile.h 29 Nov 2007 23:50:01 -0000 renamed from vnchextile.h 16 Sep 2007 21:07:51 -0000 1.4 +1
-1@@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, N uint32_t *last_fg32, int *has_bg, int *has_fg) { - char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); + uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); pixel_t *irow = (pixel_t *)row; int j, i; pixel_t *last_bg = (pixel_t *)last_bg32;Index:
audio/alsaaudio.c
===================================================================
RCS file: /sources/qemu/qemu/audio/alsaaudio.c,v
retrieving revision 1.11
diff -u -p -r1.11alsaaudio.calsaaudio.c 29 Nov 2007 23:50:01 -0000 renamed from alsaaudio.c 17 Nov 2007 17:35:54 -0000 1.11 +3
-2@@ -331,7 +331,8 @@ static int alsa_open (int in, struct als goto err; } - err = snd_pcm_hw_params_set_rate_near (handle, hw_params, &freq, 0); + err = snd_pcm_hw_params_set_rate_near (handle, hw_params, + (unsigned int *)&freq, 0); if (err < 0) { alsa_logerr2 (err, typ, "Failed to set frequency %d\n", req->freq); goto err;@@ -340,7 +341,7 @@ static int alsa_open (int in, struct als err = snd_pcm_hw_params_set_channels_near ( handle, hw_params, - &nchannels + (unsigned int *)&nchannels ); if (err < 0) { alsa_logerr2 (err, typ, "Failed to set number of channels %d\n",Index:
hw/acpi.c
===================================================================
RCS file: /sources/qemu/qemu/hw/acpi.c,v
retrieving revision 1.17
diff -u -p -r1.17acpi.cacpi.c 29 Nov 2007 23:50:01 -0000 renamed from acpi.c 17 Nov 2007 17:14:39 -0000 1.17 +2
-2@@ -439,7 +439,7 @@ static void pm_save(QEMUFile* f,void *op qemu_put_8s(f, &s->apmc); qemu_put_8s(f, &s->apms); qemu_put_timer(f, s->tmr_timer); - qemu_put_be64s(f, &s->tmr_overflow_time); + qemu_put_be64s(f, (uint64_t *)&s->tmr_overflow_time); } static int pm_load(QEMUFile* f,void* opaque,int version_id)@@ -460,7 +460,7 @@ static int pm_load(QEMUFile* f,void* opa qemu_get_8s(f, &s->apmc); qemu_get_8s(f, &s->apms); qemu_get_timer(f, s->tmr_timer); - qemu_get_be64s(f, &s->tmr_overflow_time); + qemu_get_be64s(f, (uint64_t *)&s->tmr_overflow_time); pm_io_space_update(s);Index:
hw/apic.c
===================================================================
RCS file: /sources/qemu/qemu/hw/apic.c,v
retrieving revision 1.18
diff -u -p -r1.18apic.capic.c 29 Nov 2007 23:50:01 -0000 renamed from apic.c 17 Nov 2007 17:14:40 -0000 1.18 +6
-6@@ -761,10 +761,10 @@ static void apic_save(QEMUFile *f, void qemu_put_be32s(f, &s->icr[0]); qemu_put_be32s(f, &s->icr[1]); qemu_put_be32s(f, &s->divide_conf); - qemu_put_be32s(f, &s->count_shift); + qemu_put_be32s(f, (uint32_t *)&s->count_shift); qemu_put_be32s(f, &s->initial_count); - qemu_put_be64s(f, &s->initial_count_load_time); - qemu_put_be64s(f, &s->next_time); + qemu_put_be64s(f, (uint64_t *)&s->initial_count_load_time); + qemu_put_be64s(f, (uint64_t *)&s->next_time); qemu_put_timer(f, s->timer); }@@ -797,10 +797,10 @@ static int apic_load(QEMUFile *f, void * qemu_get_be32s(f, &s->icr[0]); qemu_get_be32s(f, &s->icr[1]); qemu_get_be32s(f, &s->divide_conf); - qemu_get_be32s(f, &s->count_shift); + qemu_get_be32s(f, (uint32_t *)&s->count_shift); qemu_get_be32s(f, &s->initial_count); - qemu_get_be64s(f, &s->initial_count_load_time); - qemu_get_be64s(f, &s->next_time); + qemu_get_be64s(f, (uint64_t *)&s->initial_count_load_time); + qemu_get_be64s(f, (uint64_t *)&s->next_time); if (version_id >= 2) qemu_get_timer(f, s->timer);Index:
hw/cirrus_vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/cirrus_vga.c,v
retrieving revision 1.29
diff -u -p -r1.29cirrus_vga.ccirrus_vga.c 29 Nov 2007 23:50:01 -0000 renamed from cirrus_vga.c 17 Nov 2007 17:14:40 -0000 1.29 +4
-4@@ -2985,7 +2985,7 @@ static void cirrus_vga_save(QEMUFile *f, qemu_put_buffer(f, s->gr + 2, 254); qemu_put_8s(f, &s->ar_index); qemu_put_buffer(f, s->ar, 21); - qemu_put_be32s(f, &s->ar_flip_flop); + qemu_put_be32s(f, (uint32_t *)&s->ar_flip_flop); qemu_put_8s(f, &s->cr_index); qemu_put_buffer(f, s->cr, 256); qemu_put_8s(f, &s->msr);@@ -3000,7 +3000,7 @@ static void cirrus_vga_save(QEMUFile *f, qemu_put_buffer(f, s->dac_cache, 3); qemu_put_buffer(f, s->palette, 768); - qemu_put_be32s(f, &s->bank_offset); + qemu_put_be32s(f, (uint32_t *)&s->bank_offset); qemu_put_8s(f, &s->cirrus_hidden_dac_lockindex); qemu_put_8s(f, &s->cirrus_hidden_dac_data);@@ -3036,7 +3036,7 @@ static int cirrus_vga_load(QEMUFile *f, qemu_get_buffer(f, s->gr + 2, 254); qemu_get_8s(f, &s->ar_index); qemu_get_buffer(f, s->ar, 21); - qemu_get_be32s(f, &s->ar_flip_flop); + qemu_get_be32s(f, (uint32_t *)&s->ar_flip_flop); qemu_get_8s(f, &s->cr_index); qemu_get_buffer(f, s->cr, 256); qemu_get_8s(f, &s->msr);@@ -3051,7 +3051,7 @@ static int cirrus_vga_load(QEMUFile *f, qemu_get_buffer(f, s->dac_cache, 3); qemu_get_buffer(f, s->palette, 768); - qemu_get_be32s(f, &s->bank_offset); + qemu_get_be32s(f, (uint32_t *)&s->bank_offset); qemu_get_8s(f, &s->cirrus_hidden_dac_lockindex); qemu_get_8s(f, &s->cirrus_hidden_dac_data);Index:
hw/dma.c
===================================================================
RCS file: /sources/qemu/qemu/hw/dma.c,v
retrieving revision 1.16
diff -u -p -r1.16dma.cdma.c 29 Nov 2007 23:50:01 -0000 renamed from dma.c 17 Nov 2007 17:14:41 -0000 1.16 +6
-6@@ -482,12 +482,12 @@ static void dma_save (QEMUFile *f, void qemu_put_8s (f, &d->command); qemu_put_8s (f, &d->mask); qemu_put_8s (f, &d->flip_flop); - qemu_put_be32s (f, &d->dshift); + qemu_put_be32s (f, (uint32_t *)&d->dshift); for (i = 0; i < 4; ++i) { struct dma_regs *r = &d->regs[i]; - qemu_put_be32s (f, &r->now[0]); - qemu_put_be32s (f, &r->now[1]); + qemu_put_be32s (f, (uint32_t *)&r->now[0]); + qemu_put_be32s (f, (uint32_t *)&r->now[1]); qemu_put_be16s (f, &r->base[0]); qemu_put_be16s (f, &r->base[1]); qemu_put_8s (f, &r->mode);@@ -510,12 +510,12 @@ static int dma_load (QEMUFile *f, void * qemu_get_8s (f, &d->command); qemu_get_8s (f, &d->mask); qemu_get_8s (f, &d->flip_flop); - qemu_get_be32s (f, &d->dshift); + qemu_get_be32s (f, (uint32_t *)&d->dshift); for (i = 0; i < 4; ++i) { struct dma_regs *r = &d->regs[i]; - qemu_get_be32s (f, &r->now[0]); - qemu_get_be32s (f, &r->now[1]); + qemu_get_be32s (f, (uint32_t *)&r->now[0]); + qemu_get_be32s (f, (uint32_t *)&r->now[1]); qemu_get_be16s (f, &r->base[0]); qemu_get_be16s (f, &r->base[1]); qemu_get_8s (f, &r->mode);Index:
hw/fdc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/fdc.c,v
retrieving revision 1.33
diff -u -p -r1.33fdc.cfdc.c 29 Nov 2007 23:50:01 -0000 renamed from fdc.c 17 Nov 2007 17:14:41 -0000 1.33 +1
-1@@ -180,7 +180,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 const fd_format_t fd_formats[] = {Index:
hw/i8254.c
===================================================================
RCS file: /sources/qemu/qemu/hw/i8254.c,v
retrieving revision 1.12
diff -u -p -r1.12i8254.ci8254.c 29 Nov 2007 23:50:01 -0000 renamed from i8254.c 17 Nov 2007 17:14:42 -0000 1.12 +6
-6@@ -397,7 +397,7 @@ static void pit_save(QEMUFile *f, void * for(i = 0; i < 3; i++) { s = &pit->channels[i]; - qemu_put_be32s(f, &s->count); + qemu_put_be32s(f, (uint32_t *)&s->count); qemu_put_be16s(f, &s->latched_count); qemu_put_8s(f, &s->count_latched); qemu_put_8s(f, &s->status_latched);@@ -409,9 +409,9 @@ static void pit_save(QEMUFile *f, void * qemu_put_8s(f, &s->mode); qemu_put_8s(f, &s->bcd); qemu_put_8s(f, &s->gate); - qemu_put_be64s(f, &s->count_load_time); + qemu_put_be64s(f, (uint64_t *)&s->count_load_time); if (s->irq_timer) { - qemu_put_be64s(f, &s->next_transition_time); + qemu_put_be64s(f, (uint64_t *)&s->next_transition_time); qemu_put_timer(f, s->irq_timer); } }@@ -428,7 +428,7 @@ static int pit_load(QEMUFile *f, void *o for(i = 0; i < 3; i++) { s = &pit->channels[i]; - qemu_get_be32s(f, &s->count); + qemu_get_be32s(f, (uint32_t *)&s->count); qemu_get_be16s(f, &s->latched_count); qemu_get_8s(f, &s->count_latched); qemu_get_8s(f, &s->status_latched);@@ -440,9 +440,9 @@ static int pit_load(QEMUFile *f, void *o qemu_get_8s(f, &s->mode); qemu_get_8s(f, &s->bcd); qemu_get_8s(f, &s->gate); - qemu_get_be64s(f, &s->count_load_time); + qemu_get_be64s(f, (uint64_t *)&s->count_load_time); if (s->irq_timer) { - qemu_get_be64s(f, &s->next_transition_time); + qemu_get_be64s(f, (uint64_t *)&s->next_transition_time); qemu_get_timer(f, s->irq_timer); } }Index:
hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.72
diff -u -p -r1.72ide.cide.c 29 Nov 2007 23:50:01 -0000 renamed from ide.c 18 Nov 2007 01:44:37 -0000 1.72 +13
-13@@ -471,12 +471,12 @@ static void ide_identify(IDEState *s) put_le16(p + 5, 512); /* XXX: retired, remove ? */ put_le16(p + 6, s->sectors); snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); - padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ + padstr((char *)(p + 10), buf, 20); /* serial number */ put_le16(p + 20, 3); /* XXX: retired, remove ? */ put_le16(p + 21, 512); /* cache size in sectors */ put_le16(p + 22, 4); /* ecc bytes */ - padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ - padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); /* model */ + padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */ + padstr((char *)(p + 27), "QEMU HARDDISK", 40); /* model */ #if MAX_MULT_SECTORS > 1 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); #endif@@ -536,12 +536,12 @@ static void ide_atapi_identify(IDEState /* Removable CDROM, 50us response, 12 byte packets */ put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); - padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ + padstr((char *)(p + 10), buf, 20); /* serial number */ put_le16(p + 20, 3); /* buffer type */ put_le16(p + 21, 512); /* cache size in sectors */ put_le16(p + 22, 4); /* ecc bytes */ - padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ - padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */ + padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */ + padstr((char *)(p + 27), "QEMU CD-ROM", 40); /* model */ put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */ #ifdef USE_DMA_CDROM put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */@@ -591,10 +591,10 @@ static void ide_cfata_identify(IDEState put_le16(p + 7, s->nb_sectors >> 16); /* Sectors per card */ put_le16(p + 8, s->nb_sectors); /* Sectors per card */ snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); - padstr((uint8_t *)(p + 10), buf, 20); /* Serial number in ASCII */ + padstr((char *)(p + 10), buf, 20); /* Serial number in ASCII */ put_le16(p + 22, 0x0004); /* ECC bytes */ - padstr((uint8_t *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */ - padstr((uint8_t *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */ + padstr((char *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */ + padstr((char *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */ #if MAX_MULT_SECTORS > 1 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); #else@@ -2508,8 +2508,8 @@ static void ide_init_ioport(IDEState *id /* save per IDE drive data */ static void ide_save(QEMUFile* f, IDEState *s) { - qemu_put_be32s(f, &s->mult_sectors); - qemu_put_be32s(f, &s->identify_set); + qemu_put_be32s(f, (uint32_t *)&s->mult_sectors); + qemu_put_be32s(f, (uint32_t *)&s->identify_set); if (s->identify_set) { qemu_put_buffer(f, (const uint8_t *)s->identify_data, 512); }@@ -2536,8 +2536,8 @@ static void ide_save(QEMUFile* f, IDESta /* load per IDE drive data */ static void ide_load(QEMUFile* f, IDEState *s) { - qemu_get_be32s(f, &s->mult_sectors); - qemu_get_be32s(f, &s->identify_set); + qemu_get_be32s(f, (uint32_t *)&s->mult_sectors); + qemu_get_be32s(f, (uint32_t *)&s->identify_set); if (s->identify_set) { qemu_get_buffer(f, (uint8_t *)s->identify_data, 512); }Index:
hw/mc146818rtc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/mc146818rtc.c,v
retrieving revision 1.15
diff -u -p -r1.15mc146818rtc.cmc146818rtc.c 29 Nov 2007 23:50:01 -0000 renamed from mc146818rtc.c 18 Nov 2007 01:44:37 -0000 1.15 +18
-18@@ -421,18 +421,18 @@ static void rtc_save(QEMUFile *f, void * qemu_put_buffer(f, s->cmos_data, 128); qemu_put_8s(f, &s->cmos_index); - qemu_put_be32s(f, &s->current_tm.tm_sec); - qemu_put_be32s(f, &s->current_tm.tm_min); - qemu_put_be32s(f, &s->current_tm.tm_hour); - qemu_put_be32s(f, &s->current_tm.tm_wday); - qemu_put_be32s(f, &s->current_tm.tm_mday); - qemu_put_be32s(f, &s->current_tm.tm_mon); - qemu_put_be32s(f, &s->current_tm.tm_year); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_sec); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_min); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_hour); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_wday); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_mday); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_mon); + qemu_put_be32s(f, (uint32_t *)&s->current_tm.tm_year); qemu_put_timer(f, s->periodic_timer); - qemu_put_be64s(f, &s->next_periodic_time); + qemu_put_be64s(f, (uint64_t *)&s->next_periodic_time); - qemu_put_be64s(f, &s->next_second_time); + qemu_put_be64s(f, (uint64_t *)&s->next_second_time); qemu_put_timer(f, s->second_timer); qemu_put_timer(f, s->second_timer2); }@@ -447,18 +447,18 @@ static int rtc_load(QEMUFile *f, void *o qemu_get_buffer(f, s->cmos_data, 128); qemu_get_8s(f, &s->cmos_index); - qemu_get_be32s(f, &s->current_tm.tm_sec); - qemu_get_be32s(f, &s->current_tm.tm_min); - qemu_get_be32s(f, &s->current_tm.tm_hour); - qemu_get_be32s(f, &s->current_tm.tm_wday); - qemu_get_be32s(f, &s->current_tm.tm_mday); - qemu_get_be32s(f, &s->current_tm.tm_mon); - qemu_get_be32s(f, &s->current_tm.tm_year); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_sec); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_min); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_hour); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_wday); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_mday); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_mon); + qemu_get_be32s(f, (uint32_t *)&s->current_tm.tm_year); qemu_get_timer(f, s->periodic_timer); - qemu_get_be64s(f, &s->next_periodic_time); + qemu_get_be64s(f, (uint64_t *)&s->next_periodic_time); - qemu_get_be64s(f, &s->next_second_time); + qemu_get_be64s(f, (uint64_t *)&s->next_second_time); qemu_get_timer(f, s->second_timer); qemu_get_timer(f, s->second_timer2); return 0;Index:
hw/ne2000.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ne2000.c,v
retrieving revision 1.31
diff -u -p -r1.31ne2000.cne2000.c 29 Nov 2007 23:50:01 -0000 renamed from ne2000.c 18 Nov 2007 01:44:37 -0000 1.31 +21
-22@@ -647,12 +647,12 @@ static uint32_t ne2000_reset_ioport_read static void ne2000_save(QEMUFile* f,void* opaque) { NE2000State* s=(NE2000State*)opaque; - int tmp; + unsigned int tmp=0; - if (s->pci_dev) - pci_device_save(s->pci_dev, f); + if (s->pci_dev) + pci_device_save(s->pci_dev, f); - qemu_put_8s(f, &s->rxcr); + qemu_put_8s(f, &s->rxcr); qemu_put_8s(f, &s->cmd); qemu_put_be32s(f, &s->start);@@ -670,31 +670,30 @@ static void ne2000_save(QEMUFile* f,void qemu_put_buffer(f, s->phys, 6); qemu_put_8s(f, &s->curpag); qemu_put_buffer(f, s->mult, 8); - tmp = 0; qemu_put_be32s(f, &tmp); /* ignored, was irq */ - qemu_put_buffer(f, s->mem, NE2000_MEM_SIZE); + qemu_put_buffer(f, (uint8_t *)s->mem, NE2000_MEM_SIZE); } static int ne2000_load(QEMUFile* f,void* opaque,int version_id) { NE2000State* s=(NE2000State*)opaque; - int ret; - int tmp; + int ret; + unsigned int tmp; - if (version_id > 3) - return -EINVAL; + if (version_id > 3) + return -EINVAL; - if (s->pci_dev && version_id >= 3) { - ret = pci_device_load(s->pci_dev, f); - if (ret < 0) - return ret; - } - - if (version_id >= 2) { - qemu_get_8s(f, &s->rxcr); - } else { - s->rxcr = 0x0c; - } + if (s->pci_dev && version_id >= 3) { + ret = pci_device_load(s->pci_dev, f); + if (ret < 0) + return ret; + } + + if (version_id >= 2) { + qemu_get_8s(f, &s->rxcr); + } else { + s->rxcr = 0x0c; + } qemu_get_8s(f, &s->cmd); qemu_get_be32s(f, &s->start);@@ -713,7 +712,7 @@ static int ne2000_load(QEMUFile* f,void* qemu_get_8s(f, &s->curpag); qemu_get_buffer(f, s->mult, 8); qemu_get_be32s(f, &tmp); /* ignored */ - qemu_get_buffer(f, s->mem, NE2000_MEM_SIZE); + qemu_get_buffer(f, (uint8_t *)s->mem, NE2000_MEM_SIZE); return 0; }Index:
hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.95
diff -u -p -r1.95pc.cpc.c 29 Nov 2007 23:50:01 -0000 renamed from pc.c 18 Nov 2007 08:46:58 -0000 1.95 +1
-1@@ -548,7 +548,7 @@ static void load_linux(const char *kerne initrd_max = ram_size-ACPI_DATA_SIZE-1; /* kernel command line */ - pstrcpy(cmdline_addr, 4096, kernel_cmdline); + pstrcpy((char *)cmdline_addr, 4096, kernel_cmdline); if (protocol >= 0x202) { stl_p(header+0x228, cmdline_addr-phys_ram_base);Index:
hw/pcnet.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pcnet.c,v
retrieving revision 1.20
diff -u -p -r1.20pcnet.cpcnet.c 29 Nov 2007 23:50:01 -0000 renamed from pcnet.c 17 Nov 2007 17:14:45 -0000 1.20 +16
-16@@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetS } else { s->phys_mem_read(s->dma_opaque, addr, (void *)tmd, sizeof(*tmd), 0); le32_to_cpus(&tmd->tbadr); - le16_to_cpus(&tmd->length); - le16_to_cpus(&tmd->status); + le16_to_cpus((uint16_t *)&tmd->length); + le16_to_cpus((uint16_t *)&tmd->status); le32_to_cpus(&tmd->misc); le32_to_cpus(&tmd->res); if (BCR_SWSTYLE(s) == 3) {@@ -416,8 +416,8 @@ static inline void pcnet_rmd_load(PCNetS } else { s->phys_mem_read(s->dma_opaque, addr, (void *)rmd, sizeof(*rmd), 0); le32_to_cpus(&rmd->rbadr); - le16_to_cpus(&rmd->buf_length); - le16_to_cpus(&rmd->status); + le16_to_cpus((uint16_t *)&rmd->buf_length); + le16_to_cpus((uint16_t *)&rmd->status); le32_to_cpus(&rmd->msg_length); le32_to_cpus(&rmd->res); if (BCR_SWSTYLE(s) == 3) {@@ -1843,9 +1843,9 @@ static void pcnet_save(QEMUFile *f, void if (s->pci_dev) pci_device_save(s->pci_dev, f); - qemu_put_be32s(f, &s->rap); - qemu_put_be32s(f, &s->isr); - qemu_put_be32s(f, &s->lnkst); + qemu_put_be32s(f, (uint32_t*)&s->rap); + qemu_put_be32s(f, (uint32_t*)&s->isr); + qemu_put_be32s(f, (uint32_t*)&s->lnkst); qemu_put_be32s(f, &s->rdra); qemu_put_be32s(f, &s->tdra); qemu_put_buffer(f, s->prom, 16);@@ -1854,10 +1854,10 @@ static void pcnet_save(QEMUFile *f, void for (i = 0; i < 32; i++) qemu_put_be16s(f, &s->bcr[i]); qemu_put_be64s(f, &s->timer); - qemu_put_be32s(f, &s->xmit_pos); - qemu_put_be32s(f, &s->recv_pos); + qemu_put_be32s(f, (uint32_t*)&s->xmit_pos); + qemu_put_be32s(f, (uint32_t*)&s->recv_pos); qemu_put_buffer(f, s->buffer, 4096); - qemu_put_be32s(f, &s->tx_busy); + qemu_put_be32s(f, (uint32_t*)&s->tx_busy); qemu_put_timer(f, s->poll_timer); }@@ -1875,9 +1875,9 @@ static int pcnet_load(QEMUFile *f, void return ret; } - qemu_get_be32s(f, &s->rap); - qemu_get_be32s(f, &s->isr); - qemu_get_be32s(f, &s->lnkst); + qemu_get_be32s(f, (uint32_t*)&s->rap); + qemu_get_be32s(f, (uint32_t*)&s->isr); + qemu_get_be32s(f, (uint32_t*)&s->lnkst); qemu_get_be32s(f, &s->rdra); qemu_get_be32s(f, &s->tdra); qemu_get_buffer(f, s->prom, 16);@@ -1886,10 +1886,10 @@ static int pcnet_load(QEMUFile *f, void for (i = 0; i < 32; i++) qemu_get_be16s(f, &s->bcr[i]); qemu_get_be64s(f, &s->timer); - qemu_get_be32s(f, &s->xmit_pos); - qemu_get_be32s(f, &s->recv_pos); + qemu_get_be32s(f, (uint32_t*)&s->xmit_pos); + qemu_get_be32s(f, (uint32_t*)&s->recv_pos); qemu_get_buffer(f, s->buffer, 4096); - qemu_get_be32s(f, &s->tx_busy); + qemu_get_be32s(f, (uint32_t*)&s->tx_busy); qemu_get_timer(f, s->poll_timer); return 0;Index:
hw/ps2.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ps2.c,v
retrieving revision 1.9
diff -u -p -r1.9ps2.cps2.c 29 Nov 2007 23:50:01 -0000 renamed from ps2.c 17 Nov 2007 17:14:46 -0000 1.9 +18
-18@@ -470,19 +470,19 @@ static void ps2_reset(void *opaque) static void ps2_common_save (QEMUFile *f, PS2State *s) { - qemu_put_be32s (f, &s->write_cmd); - qemu_put_be32s (f, &s->queue.rptr); - qemu_put_be32s (f, &s->queue.wptr); - qemu_put_be32s (f, &s->queue.count); + qemu_put_be32s (f, (uint32_t *)&s->write_cmd); + qemu_put_be32s (f, (uint32_t *)&s->queue.rptr); + qemu_put_be32s (f, (uint32_t *)&s->queue.wptr); + qemu_put_be32s (f, (uint32_t *)&s->queue.count); qemu_put_buffer (f, s->queue.data, sizeof (s->queue.data)); } static void ps2_common_load (QEMUFile *f, PS2State *s) { - qemu_get_be32s (f, &s->write_cmd); - qemu_get_be32s (f, &s->queue.rptr); - qemu_get_be32s (f, &s->queue.wptr); - qemu_get_be32s (f, &s->queue.count); + qemu_get_be32s (f, (uint32_t *)&s->write_cmd); + qemu_get_be32s (f, (uint32_t *)&s->queue.rptr); + qemu_get_be32s (f, (uint32_t *)&s->queue.wptr); + qemu_get_be32s (f, (uint32_t *)&s->queue.count); qemu_get_buffer (f, s->queue.data, sizeof (s->queue.data)); }@@ -491,8 +491,8 @@ static void ps2_kbd_save(QEMUFile* f, vo PS2KbdState *s = (PS2KbdState*)opaque; ps2_common_save (f, &s->common); - qemu_put_be32s(f, &s->scan_enabled); - qemu_put_be32s(f, &s->translate); + qemu_put_be32s(f, (uint32_t *)&s->scan_enabled); + qemu_put_be32s(f, (uint32_t *)&s->translate); } static void ps2_mouse_save(QEMUFile* f, void* opaque)@@ -506,9 +506,9 @@ static void ps2_mouse_save(QEMUFile* f, qemu_put_8s(f, &s->mouse_wrap); qemu_put_8s(f, &s->mouse_type); qemu_put_8s(f, &s->mouse_detect_state); - qemu_put_be32s(f, &s->mouse_dx); - qemu_put_be32s(f, &s->mouse_dy); - qemu_put_be32s(f, &s->mouse_dz); + qemu_put_be32s(f, (uint32_t *)&s->mouse_dx); + qemu_put_be32s(f, (uint32_t *)&s->mouse_dy); + qemu_put_be32s(f, (uint32_t *)&s->mouse_dz); qemu_put_8s(f, &s->mouse_buttons); }@@ -520,8 +520,8 @@ static int ps2_kbd_load(QEMUFile* f, voi return -EINVAL; ps2_common_load (f, &s->common); - qemu_get_be32s(f, &s->scan_enabled); - qemu_get_be32s(f, &s->translate); + qemu_get_be32s(f, (uint32_t *)&s->scan_enabled); + qemu_get_be32s(f, (uint32_t *)&s->translate); return 0; }@@ -539,9 +539,9 @@ static int ps2_mouse_load(QEMUFile* f, v qemu_get_8s(f, &s->mouse_wrap); qemu_get_8s(f, &s->mouse_type); qemu_get_8s(f, &s->mouse_detect_state); - qemu_get_be32s(f, &s->mouse_dx); - qemu_get_be32s(f, &s->mouse_dy); - qemu_get_be32s(f, &s->mouse_dz); + qemu_get_be32s(f, (uint32_t *)&s->mouse_dx); + qemu_get_be32s(f, (uint32_t *)&s->mouse_dy); + qemu_get_be32s(f, (uint32_t *)&s->mouse_dz); qemu_get_8s(f, &s->mouse_buttons); return 0; }Index:
hw/rtl8139.c
===================================================================
RCS file: /sources/qemu/qemu/hw/rtl8139.c,v
retrieving revision 1.16
diff -u -p -r1.16rtl8139.crtl8139.c 29 Nov 2007 23:50:01 -0000 renamed from rtl8139.c 18 Nov 2007 01:44:38 -0000 1.16 +9
-8@@ -3119,7 +3119,7 @@ static uint32_t rtl8139_mmio_readl(void static void rtl8139_save(QEMUFile* f,void* opaque) { RTL8139State* s=(RTL8139State*)opaque; - int i; + unsigned int i; pci_device_save(s->pci_dev, f);@@ -3172,7 +3172,7 @@ static void rtl8139_save(QEMUFile* f,voi i = 0; qemu_put_be32s(f, &i); /* unused. */ qemu_put_buffer(f, s->macaddr, 6); - qemu_put_be32s(f, &s->rtl8139_mmio_io_addr); + qemu_put_be32s(f, (uint32_t *)&s->rtl8139_mmio_io_addr); qemu_put_be32s(f, &s->currTxDesc); qemu_put_be32s(f, &s->currCPlusRxDesc);@@ -3184,7 +3184,7 @@ static void rtl8139_save(QEMUFile* f,voi { qemu_put_be16s(f, &s->eeprom.contents[i]); } - qemu_put_be32s(f, &s->eeprom.mode); + qemu_put_be32s(f, (uint32_t *)&s->eeprom.mode); qemu_put_be32s(f, &s->eeprom.tick); qemu_put_8s(f, &s->eeprom.address); qemu_put_be16s(f, &s->eeprom.input);@@ -3197,7 +3197,7 @@ static void rtl8139_save(QEMUFile* f,voi qemu_put_be32s(f, &s->TCTR); qemu_put_be32s(f, &s->TimerInt); - qemu_put_be64s(f, &s->TCTR_base); + qemu_put_be64s(f, (uint64_t*)&s->TCTR_base); RTL8139TallyCounters_save(f, &s->tally_counters); }@@ -3205,7 +3205,8 @@ static void rtl8139_save(QEMUFile* f,voi static 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)@@ -3266,7 +3267,7 @@ static int rtl8139_load(QEMUFile* f,void qemu_get_be32s(f, &i); /* unused. */ qemu_get_buffer(f, s->macaddr, 6); - qemu_get_be32s(f, &s->rtl8139_mmio_io_addr); + qemu_get_be32s(f, (uint32_t *)&s->rtl8139_mmio_io_addr); qemu_get_be32s(f, &s->currTxDesc); qemu_get_be32s(f, &s->currCPlusRxDesc);@@ -3278,7 +3279,7 @@ static int rtl8139_load(QEMUFile* f,void { qemu_get_be16s(f, &s->eeprom.contents[i]); } - qemu_get_be32s(f, &s->eeprom.mode); + qemu_get_be32s(f, (uint32_t *)&s->eeprom.mode); qemu_get_be32s(f, &s->eeprom.tick); qemu_get_8s(f, &s->eeprom.address); qemu_get_be16s(f, &s->eeprom.input);@@ -3294,7 +3295,7 @@ static int rtl8139_load(QEMUFile* f,void { qemu_get_be32s(f, &s->TCTR); qemu_get_be32s(f, &s->TimerInt); - qemu_get_be64s(f, &s->TCTR_base); + qemu_get_be64s(f, (uint64_t*)&s->TCTR_base); RTL8139TallyCounters_load(f, &s->tally_counters); }Index:
hw/sb16.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sb16.c,v
retrieving revision 1.24
diff -u -p -r1.24sb16.csb16.c 29 Nov 2007 23:50:01 -0000 renamed from sb16.c 17 Nov 2007 17:14:47 -0000 1.24 +60
-60@@ -1257,29 +1257,29 @@ static void SB_save (QEMUFile *f, void * { SB16State *s = opaque; - qemu_put_be32s (f, &s->irq); - qemu_put_be32s (f, &s->dma); - qemu_put_be32s (f, &s->hdma); - qemu_put_be32s (f, &s->port); - qemu_put_be32s (f, &s->ver); - qemu_put_be32s (f, &s->in_index); - qemu_put_be32s (f, &s->out_data_len); - qemu_put_be32s (f, &s->fmt_stereo); - qemu_put_be32s (f, &s->fmt_signed); - qemu_put_be32s (f, &s->fmt_bits); + qemu_put_be32s (f, (uint32_t *)&s->irq); + qemu_put_be32s (f, (uint32_t *)&s->dma); + qemu_put_be32s (f, (uint32_t *)&s->hdma); + qemu_put_be32s (f, (uint32_t *)&s->port); + qemu_put_be32s (f, (uint32_t *)&s->ver); + qemu_put_be32s (f, (uint32_t *)&s->in_index); + qemu_put_be32s (f, (uint32_t *)&s->out_data_len); + qemu_put_be32s (f, (uint32_t *)&s->fmt_stereo); + qemu_put_be32s (f, (uint32_t *)&s->fmt_signed); + qemu_put_be32s (f, (uint32_t *)&s->fmt_bits); qemu_put_be32s (f, &s->fmt); - qemu_put_be32s (f, &s->dma_auto); - qemu_put_be32s (f, &s->block_size); - qemu_put_be32s (f, &s->fifo); - qemu_put_be32s (f, &s->freq); - qemu_put_be32s (f, &s->time_const); - qemu_put_be32s (f, &s->speaker); - qemu_put_be32s (f, &s->needed_bytes); - qemu_put_be32s (f, &s->cmd); - qemu_put_be32s (f, &s->use_hdma); - qemu_put_be32s (f, &s->highspeed); - qemu_put_be32s (f, &s->can_write); - qemu_put_be32s (f, &s->v2x6); + qemu_put_be32s (f, (uint32_t *)&s->dma_auto); + qemu_put_be32s (f, (uint32_t *)&s->block_size); + qemu_put_be32s (f, (uint32_t *)&s->fifo); + qemu_put_be32s (f, (uint32_t *)&s->freq); + qemu_put_be32s (f, (uint32_t *)&s->time_const); + qemu_put_be32s (f, (uint32_t *)&s->speaker); + qemu_put_be32s (f, (uint32_t *)&s->needed_bytes); + qemu_put_be32s (f, (uint32_t *)&s->cmd); + qemu_put_be32s (f, (uint32_t *)&s->use_hdma); + qemu_put_be32s (f, (uint32_t *)&s->highspeed); + qemu_put_be32s (f, (uint32_t *)&s->can_write); + qemu_put_be32s (f, (uint32_t *)&s->v2x6); qemu_put_8s (f, &s->csp_param); qemu_put_8s (f, &s->csp_value);@@ -1288,21 +1288,21 @@ static void SB_save (QEMUFile *f, void * qemu_put_buffer (f, s->csp_regs, 256); qemu_put_8s (f, &s->csp_index); qemu_put_buffer (f, s->csp_reg83, 4); - qemu_put_be32s (f, &s->csp_reg83r); - qemu_put_be32s (f, &s->csp_reg83w); + qemu_put_be32s (f, (uint32_t *)&s->csp_reg83r); + qemu_put_be32s (f, (uint32_t *)&s->csp_reg83w); qemu_put_buffer (f, s->in2_data, sizeof (s->in2_data)); qemu_put_buffer (f, s->out_data, sizeof (s->out_data)); qemu_put_8s (f, &s->test_reg); qemu_put_8s (f, &s->last_read_byte); - qemu_put_be32s (f, &s->nzero); - qemu_put_be32s (f, &s->left_till_irq); - qemu_put_be32s (f, &s->dma_running); - qemu_put_be32s (f, &s->bytes_per_second); - qemu_put_be32s (f, &s->align); + qemu_put_be32s (f, (uint32_t *)&s->nzero); + qemu_put_be32s (f, (uint32_t *)&s->left_till_irq); + qemu_put_be32s (f, (uint32_t *)&s->dma_running); + qemu_put_be32s (f, (uint32_t *)&s->bytes_per_second); + qemu_put_be32s (f, (uint32_t *)&s->align); - qemu_put_be32s (f, &s->mixer_nreg); + qemu_put_be32s (f, (uint32_t *)&s->mixer_nreg); qemu_put_buffer (f, s->mixer_regs, 256); }@@ -1314,29 +1314,29 @@ static int SB_load (QEMUFile *f, void *o return -EINVAL; } - qemu_get_be32s (f, &s->irq); - qemu_get_be32s (f, &s->dma); - qemu_get_be32s (f, &s->hdma); - qemu_get_be32s (f, &s->port); - qemu_get_be32s (f, &s->ver); - qemu_get_be32s (f, &s->in_index); - qemu_get_be32s (f, &s->out_data_len); - qemu_get_be32s (f, &s->fmt_stereo); - qemu_get_be32s (f, &s->fmt_signed); - qemu_get_be32s (f, &s->fmt_bits); + qemu_get_be32s (f, (uint32_t *)&s->irq); + qemu_get_be32s (f, (uint32_t *)&s->dma); + qemu_get_be32s (f, (uint32_t *)&s->hdma); + qemu_get_be32s (f, (uint32_t *)&s->port); + qemu_get_be32s (f, (uint32_t *)&s->ver); + qemu_get_be32s (f, (uint32_t *)&s->in_index); + qemu_get_be32s (f, (uint32_t *)&s->out_data_len); + qemu_get_be32s (f, (uint32_t *)&s->fmt_stereo); + qemu_get_be32s (f, (uint32_t *)&s->fmt_signed); + qemu_get_be32s (f, (uint32_t *)&s->fmt_bits); qemu_get_be32s (f, &s->fmt); - qemu_get_be32s (f, &s->dma_auto); - qemu_get_be32s (f, &s->block_size); - qemu_get_be32s (f, &s->fifo); - qemu_get_be32s (f, &s->freq); - qemu_get_be32s (f, &s->time_const); - qemu_get_be32s (f, &s->speaker); - qemu_get_be32s (f, &s->needed_bytes); - qemu_get_be32s (f, &s->cmd); - qemu_get_be32s (f, &s->use_hdma); - qemu_get_be32s (f, &s->highspeed); - qemu_get_be32s (f, &s->can_write); - qemu_get_be32s (f, &s->v2x6); + qemu_get_be32s (f, (uint32_t *)&s->dma_auto); + qemu_get_be32s (f, (uint32_t *)&s->block_size); + qemu_get_be32s (f, (uint32_t *)&s->fifo); + qemu_get_be32s (f, (uint32_t *)&s->freq); + qemu_get_be32s (f, (uint32_t *)&s->time_const); + qemu_get_be32s (f, (uint32_t *)&s->speaker); + qemu_get_be32s (f, (uint32_t *)&s->needed_bytes); + qemu_get_be32s (f, (uint32_t *)&s->cmd); + qemu_get_be32s (f, (uint32_t *)&s->use_hdma); + qemu_get_be32s (f, (uint32_t *)&s->highspeed); + qemu_get_be32s (f, (uint32_t *)&s->can_write); + qemu_get_be32s (f, (uint32_t *)&s->v2x6); qemu_get_8s (f, &s->csp_param); qemu_get_8s (f, &s->csp_value);@@ -1345,21 +1345,21 @@ static int SB_load (QEMUFile *f, void *o qemu_get_buffer (f, s->csp_regs, 256); qemu_get_8s (f, &s->csp_index); qemu_get_buffer (f, s->csp_reg83, 4); - qemu_get_be32s (f, &s->csp_reg83r); - qemu_get_be32s (f, &s->csp_reg83w); + qemu_get_be32s (f, (uint32_t *)&s->csp_reg83r); + qemu_get_be32s (f, (uint32_t *)&s->csp_reg83w); qemu_get_buffer (f, s->in2_data, sizeof (s->in2_data)); qemu_get_buffer (f, s->out_data, sizeof (s->out_data)); qemu_get_8s (f, &s->test_reg); qemu_get_8s (f, &s->last_read_byte); - qemu_get_be32s (f, &s->nzero); - qemu_get_be32s (f, &s->left_till_irq); - qemu_get_be32s (f, &s->dma_running); - qemu_get_be32s (f, &s->bytes_per_second); - qemu_get_be32s (f, &s->align); + qemu_get_be32s (f, (uint32_t *)&s->nzero); + qemu_get_be32s (f, (uint32_t *)&s->left_till_irq); + qemu_get_be32s (f, (uint32_t *)&s->dma_running); + qemu_get_be32s (f, (uint32_t *)&s->bytes_per_second); + qemu_get_be32s (f, (uint32_t *)&s->align); - qemu_get_be32s (f, &s->mixer_nreg); + qemu_get_be32s (f, (uint32_t *)&s->mixer_nreg); qemu_get_buffer (f, s->mixer_regs, 256); if (s->voice) {Index:
hw/sd.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sd.c,v
retrieving revision 1.10
diff -u -p -r1.10sd.csd.c 29 Nov 2007 23:50:01 -0000 renamed from sd.c 25 Nov 2007 18:46:17 -0000 1.10 +1
-1@@ -353,7 +353,7 @@ static void sd_reset(SDState *sd, BlockD uint32_t size; uint64_t sect; - bdrv_get_geometry(bdrv, §); + bdrv_get_geometry(bdrv, (int64_t *)§); sect <<= 9; if (sect > 0x40000000)Index:
hw/usb-uhci.c
===================================================================
RCS file: /sources/qemu/qemu/hw/usb-uhci.c,v
retrieving revision 1.22
diff -u -p -r1.22usb-uhci.cusb-uhci.c 29 Nov 2007 23:50:01 -0000 renamed from usb-uhci.c 17 Nov 2007 17:14:50 -0000 1.22 +3
-3@@ -508,7 +508,7 @@ static void uhci_async_complete_packet(U 0 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, int completion) { uint8_t pid;@@ -733,8 +733,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;Index:
hw/vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vga.c,v
retrieving revision 1.58
diff -u -p -r1.58vga.cvga.c 29 Nov 2007 23:50:01 -0000 renamed from vga.c 17 Nov 2007 17:14:50 -0000 1.58 +5
-5@@ -1687,12 +1687,12 @@ static void vga_save(QEMUFile *f, void * qemu_put_buffer(f, s->gr, 16); qemu_put_8s(f, &s->ar_index); qemu_put_buffer(f, s->ar, 21); - qemu_put_be32s(f, &s->ar_flip_flop); + qemu_put_be32s(f, (uint32_t*)&s->ar_flip_flop); qemu_put_8s(f, &s->cr_index); qemu_put_buffer(f, s->cr, 256); qemu_put_8s(f, &s->msr); qemu_put_8s(f, &s->fcr); - qemu_put_8s(f, &s->st00); + qemu_put_8s(f, (uint8_t *)&s->st00); qemu_put_8s(f, &s->st01); qemu_put_8s(f, &s->dac_state);@@ -1702,7 +1702,7 @@ static void vga_save(QEMUFile *f, void * qemu_put_buffer(f, s->dac_cache, 3); qemu_put_buffer(f, s->palette, 768); - qemu_put_be32s(f, &s->bank_offset); + qemu_put_be32s(f, (uint32_t *)&s->bank_offset); #ifdef CONFIG_BOCHS_VBE qemu_put_byte(f, 1); qemu_put_be16s(f, &s->vbe_index);@@ -1737,7 +1737,7 @@ static int vga_load(QEMUFile *f, void *o qemu_get_buffer(f, s->gr, 16); qemu_get_8s(f, &s->ar_index); qemu_get_buffer(f, s->ar, 21); - qemu_get_be32s(f, &s->ar_flip_flop); + qemu_get_be32s(f, (uint32_t*)&s->ar_flip_flop); qemu_get_8s(f, &s->cr_index); qemu_get_buffer(f, s->cr, 256); qemu_get_8s(f, &s->msr);@@ -1752,7 +1752,7 @@ static int vga_load(QEMUFile *f, void *o qemu_get_buffer(f, s->dac_cache, 3); qemu_get_buffer(f, s->palette, 768); - qemu_get_be32s(f, &s->bank_offset); + qemu_get_be32s(f, (uint32_t *)&s->bank_offset); is_vbe = qemu_get_byte(f); #ifdef CONFIG_BOCHS_VBE if (!is_vbe)Index:
hw/vmware_vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vmware_vga.c,v
retrieving revision 1.4
diff -u -p -r1.4vmware_vga.cvmware_vga.c 29 Nov 2007 23:50:01 -0000 renamed from vmware_vga.c 17 Nov 2007 17:14:50 -0000 1.4 +8
-8@@ -1028,41 +1028,41 @@ static CPUWriteMemoryFunc *vmsvga_vram_w static void vmsvga_save(struct vmsvga_state_s *s, QEMUFile *f) { - qemu_put_be32s(f, &s->depth); - qemu_put_be32s(f, &s->enable); - qemu_put_be32s(f, &s->config); - qemu_put_be32s(f, &s->cursor.id); - qemu_put_be32s(f, &s->cursor.x); - qemu_put_be32s(f, &s->cursor.y); - qemu_put_be32s(f, &s->cursor.on); - qemu_put_be32s(f, &s->index); + qemu_put_be32s(f, (uint32_t *)&s->depth); + qemu_put_be32s(f, (uint32_t *)&s->enable); + qemu_put_be32s(f, (uint32_t *)&s->config); + qemu_put_be32s(f, (uint32_t *)&s->cursor.id); + qemu_put_be32s(f, (uint32_t *)&s->cursor.x); + qemu_put_be32s(f, (uint32_t *)&s->cursor.y); + qemu_put_be32s(f, (uint32_t *)&s->cursor.on); + qemu_put_be32s(f, (uint32_t *)&s->index); qemu_put_buffer(f, (uint8_t *) s->scratch, s->scratch_size * 4);
vmware_vga.c 29 Nov 2007 23:50:01 -0000 static CPUWriteMemoryFunc *vmsvga_vram_w · line 1045
Quoted 10 lines
vmware_vga.c 29 Nov 2007 23:50:01 -0000 renamed from vmware_vga.c 17 Nov 2007 17:14:50 -0000 1.4 +4
-4- qemu_put_be32s(f, &s->new_width); - qemu_put_be32s(f, &s->new_height); + qemu_put_be32s(f, (uint32_t *)&s->new_width); + qemu_put_be32s(f, (uint32_t *)&s->new_height); qemu_put_be32s(f, &s->guest); qemu_put_be32s(f, &s->svgaid); - qemu_put_be32s(f, &s->syncing); - qemu_put_be32s(f, &s->fb_size); + qemu_put_be32s(f, (uint32_t *)&s->syncing); + qemu_put_be32s(f, (uint32_t *)&s->fb_size);
These casts are not the right way to get rid of the warnings, as are some of the casts in other files in qemu_put_* and qemu_get_* arguments. In this case the warnings are true positives and the bugs causing the warnings have to be addressed instead of just the warnings. I will try to do this and apply other parts of your patch when I find a bit of time.
Cheers
Andrzej,
Quoted 5 lines
These casts are not the right way to get rid of the warnings, as are some of the casts in other files in qemu_put_* and qemu_get_* arguments. In this case the warnings are true positives and the bugs causing the warnings have to be addressed instead of just the warnings.
Are you sure of that? Most of the fixes are like this:
Quoted 2 lines
apic.c static void apic_save(QEMUFile *f, void · line 764
Quoted 2 lines
apic.c +1
-1-qemu_put_be32s (f, &s->count_shift); +qemu_put_be32s (f, (uint32_t *)&s->count_shift);
qemu_put_be32s is (QEMUFile *f, const uint32_t *pv), but after all the 2nd argument is only a _pointer_ to an unsigned variable, the size is the same (thanks to the C99 explicit types). Qemu will dump this value straight into a file, in this case signedness does not matter as long as put and get use the same. The more cleaner solution would be to introduce an explicitly signed prototype for qemu_put_* and qemu_get_* and use this where applicable, if you want I will prepare a patch for this. If you want some real fix, I can dig deeper and make more changes (especially the uint8_t vs. char problem), but I wanted to start slowly and don't change much code in the first effort.
What solution do you prefer for the opaque types? I have used the simple:
Quoted 2 lines
monitor.c static void monitor_handle_command(const · line 2038
Quoted 2 lines
monitor.c +1
-1-void *args[MAX_ARGS ]; +intptr_t args[MAX_ARGS ];
A more portable and clean solution would be this:
- void *args[MAX_ARGS];
+ union
+ {+ void* ptr;
+ int i;
+ } args[MAX_ARGS];
If you prefer this, I can change the patch accordingly.
Quoted 2 lines
I will try to do this and apply other parts of your patch when I find a bit of time.
Thanks for that, if I can help you with some boring work, tell me ;-)
Regards,
Andre.
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
Review
Quoted 7 lines · Andre Przywara, le Fri 30 Nov 2007 15:10:07 +0100, a écrit :
A more portable and clean solution would be this:
(quoted diff) +5
-1- void *args[MAX_ARGS]; + union + { + void* ptr; + int i; + } args[MAX_ARGS];
It's not more portable: C99 doesn't asserts that if you write ptr and read i you will get the result of a cast (only gcc does). void * should be fine.
Samuel
Quoted 6 lines · Andre Przywara
Quoted 5 lines
These casts are not the right way to get rid of the warnings, as are some of the casts in other files in qemu_put_* and qemu_get_* arguments. In this case the warnings are true positives and the bugs causing the warnings have to be addressed instead of just the warnings.
Quoted 6 lines
Are you sure of that? Most of the fixes are like this:
Quoted 2 lines
apic.c static void apic_save(QEMUFile *f, void · line 764
Quoted 2 lines
apic.c +1
-1-qemu_put_be32s (f, &s->count_shift); +qemu_put_be32s (f, (uint32_t *)&s->count_shift);
qemu_put_be32sis (QEMUFile *f, constuint32_t*pv), but after all the 2nd argument is only a _pointer_ to an unsigned variable, the size is the same (thanks to the C99 explicit types).
count_shift is an int so it is the machine word size, not necesarily 32-bit AFAIK. Otherwise I guess gcc wouldn't warn. You can possibly use:
qemu_put_be32(f, s->count_shift);
Or point qemu_put_be32_s() to a int32_t/uint32_t variable.
Quoted 11 lines
What solution do you prefer for the opaque types? I have used the simple:
Quoted 2 lines
monitor.c static void monitor_handle_command(const · line 2038
Quoted 2 lines
monitor.c +1
-1-void *args[MAX_ARGS ]; +intptr_t args[MAX_ARGS ];A more portable and clean solution would be this:
(quoted diff) +5
-1- void *args[MAX_ARGS]; + union + { + void* ptr; + int i; + } args[MAX_ARGS];
Quoted 1 line
If you prefer this, I can change the patch accordingly.
I'm not sure why you get a warning here and I'm unable to run a build at the moment. A void * should be able to store some (unknown size) integer regardless of the platform.
Regards
Quoted 3 lines · andrzej zaborowski, le Fri 30 Nov 2007 15:30:40 +0100, a écrit :
I'm not sure why you get a warning here and I'm unable to run a build at the moment. A void * should be able to store some (unknown size) integer regardless of the platform.
No exactly. On 32bit platforms, void * are 32bits and long longs are 64bits. The maximum integer storage is intmax_t.
Samuel
Quoted 13 lines
Quoted 11 lines
What solution do you prefer for the opaque types? I have used the simple:
Quoted 2 lines
monitor.c static void monitor_handle_command(const · line 2038
Quoted 2 lines
monitor.c +1
-1-void *args[MAX_ARGS ]; +intptr_t args[MAX_ARGS ];A more portable and clean solution would be this:
(quoted diff) +5
-1- void *args[MAX_ARGS]; + union + { + void* ptr; + int i; + } args[MAX_ARGS];Quoted 1 line
If you prefer this, I can change the patch accordingly.
Quoted 3 lines
I'm not sure why you get a warning here and I'm unable to run a build at the moment. A void * should be able to store some (unknown size) integer regardless of the platform.
Unfortunately there is no portable and reliable solution, other than avoiding storing arbitrary integers in pointer variables.
The details have been discussed on this list previously. The short version is that C89 guaranteed that "long" was at least as big as "void *". C99 removed this guarantee, and introduced intptr_t instead. To further complicate matters the only target (win64) that breaks the C89 guarantee doesn't support C99.
Paul
Quoted 14 lines · andrzej zaborowski
Quoted 6 lines · Andre Przywara
Quoted 5 lines
These casts are not the right way to get rid of the warnings, as are some of the casts in other files in qemu_put_* and qemu_get_* arguments. In this case the warnings are true positives and the bugs causing the warnings have to be addressed instead of just the warnings.
Quoted 6 lines
Are you sure of that? Most of the fixes are like this:
Quoted 2 lines
apic.c static void apic_save(QEMUFile *f, void · line 764
Quoted 2 lines
apic.c +1
-1-qemu_put_be32s (f, &s->count_shift); +qemu_put_be32s (f, (uint32_t *)&s->count_shift);
qemu_put_be32sis (QEMUFile *f, constuint32_t*pv), but after all the 2nd argument is only a _pointer_ to an unsigned variable, the size is the same (thanks to the C99 explicit types).
Quoted 7 lines
count_shiftis an int so it is the machine word size, not necesarily 32-bit AFAIK. Otherwise I guess gcc wouldn't warn. You can possibly use:
qemu_put_be32(f, s->count_shift);Or point
qemu_put_be32_s()to a int32_t/uint32_t variable.
Oh, you are right, I missed that. Will rework the patch.
Quoted 12 lines
Quoted 11 lines
What solution do you prefer for the opaque types? I have used the simple:
Quoted 2 lines
monitor.c static void monitor_handle_command(const · line 2038
Quoted 2 lines
monitor.c +1
-1-void *args[MAX_ARGS ]; +intptr_t args[MAX_ARGS ];A more portable and clean solution would be this:
(quoted diff) +5
-1- void *args[MAX_ARGS]; + union + { + void* ptr; + int i; + } args[MAX_ARGS];If you prefer this, I can change the patch accordingly.
Quoted 3 lines
I'm not sure why you get a warning here and I'm unable to run a build at the moment. A void * should be able to store some (unknown size) integer regardless of the platform.
sizeof(void*) is 8, whereas sizeof(int) is 4 on a 64bit platform. If I assign a 32bit value to a 64bit (pointer) variable, GCC4 says:
warning: cast to pointer from integer of different size
You are right that a pointer _should_ be able to hold an integer, but AFAIK this is not guaranteed (aka written in the standard). To avoid those problems intptr_t was introduced.
But I think opaque types in C are broken anyway, so the union version makes it at least more readable, since you explicitly say integer or pointer at the assignment and usage. But I have no problem with using intptr_t, the union was just a suggestion.
What about fixing monitor.c#monitor_handle_command in general and avoid the opaque types at all?
But wouldn't the union version work well even on win64?
Regards,
Andre.
Signature · 3 lines
Andre Przywara AMD-OSRC (Dresden) Tel: x84917
vmware_vga.c static CPUWriteMemoryFunc *vmsvga_vram_w · line 1051
Quoted 2 lines · André Przywara
vmware_vga.c +1
-1-qemu_get_be32s (f, &depth); +qemu_get_be32s (f, (uint32_t *)&depth);
This is almost certainly the wrong way to fix this.
Paul