Commit 60fe76f38605e0e2eedb436d0945af283029c4e0

Authored by ths
1 parent 223d4670

Fix wrong signedness, by Andre Przywara.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
audio/alsaaudio.c
@@ -86,9 +86,9 @@ static struct { @@ -86,9 +86,9 @@ static struct {
86 }; 86 };
87 87
88 struct alsa_params_req { 88 struct alsa_params_req {
89 - int freq; 89 + unsigned int freq;
90 audfmt_e fmt; 90 audfmt_e fmt;
91 - int nchannels; 91 + unsigned int nchannels;
92 unsigned int buffer_size; 92 unsigned int buffer_size;
93 unsigned int period_size; 93 unsigned int period_size;
94 }; 94 };
@@ -285,7 +285,8 @@ static int alsa_open (int in, struct alsa_params_req *req, @@ -285,7 +285,8 @@ static int alsa_open (int in, struct alsa_params_req *req,
285 { 285 {
286 snd_pcm_t *handle; 286 snd_pcm_t *handle;
287 snd_pcm_hw_params_t *hw_params; 287 snd_pcm_hw_params_t *hw_params;
288 - int err, freq, nchannels; 288 + int err;
  289 + unsigned int freq, nchannels;
289 const char *pcm_name = in ? conf.pcm_name_in : conf.pcm_name_out; 290 const char *pcm_name = in ? conf.pcm_name_in : conf.pcm_name_out;
290 unsigned int period_size, buffer_size; 291 unsigned int period_size, buffer_size;
291 snd_pcm_uframes_t obt_buffer_size; 292 snd_pcm_uframes_t obt_buffer_size;
block-vvfat.c
@@ -412,7 +412,7 @@ static void init_mbr(BDRVVVFATState* s) @@ -412,7 +412,7 @@ static void init_mbr(BDRVVVFATState* s)
412 /* direntry functions */ 412 /* direntry functions */
413 413
414 /* dest is assumed to hold 258 bytes, and pads with 0xffff up to next multiple of 26 */ 414 /* dest is assumed to hold 258 bytes, and pads with 0xffff up to next multiple of 26 */
415 -static inline int short2long_name(unsigned char* dest,const char* src) 415 +static inline int short2long_name(char* dest,const char* src)
416 { 416 {
417 int i; 417 int i;
418 for(i=0;i<129 && src[i];i++) { 418 for(i=0;i<129 && src[i];i++) {
gdbstub.c
@@ -63,7 +63,7 @@ typedef struct GDBState { @@ -63,7 +63,7 @@ typedef struct GDBState {
63 char line_buf[4096]; 63 char line_buf[4096];
64 int line_buf_index; 64 int line_buf_index;
65 int line_csum; 65 int line_csum;
66 - char last_packet[4100]; 66 + uint8_t last_packet[4100];
67 int last_packet_len; 67 int last_packet_len;
68 #ifdef CONFIG_USER_ONLY 68 #ifdef CONFIG_USER_ONLY
69 int fd; 69 int fd;
@@ -188,7 +188,7 @@ static void hextomem(uint8_t *mem, const char *buf, int len) @@ -188,7 +188,7 @@ static void hextomem(uint8_t *mem, const char *buf, int len)
188 static int put_packet(GDBState *s, char *buf) 188 static int put_packet(GDBState *s, char *buf)
189 { 189 {
190 int len, csum, i; 190 int len, csum, i;
191 - char *p; 191 + uint8_t *p;
192 192
193 #ifdef DEBUG_GDB 193 #ifdef DEBUG_GDB
194 printf("reply='%s'\n", buf); 194 printf("reply='%s'\n", buf);
@@ -1179,7 +1179,7 @@ static void gdb_read_byte(GDBState *s, int ch) @@ -1179,7 +1179,7 @@ static void gdb_read_byte(GDBState *s, int ch)
1179 { 1179 {
1180 CPUState *env = s->env; 1180 CPUState *env = s->env;
1181 int i, csum; 1181 int i, csum;
1182 - char reply[1]; 1182 + uint8_t reply;
1183 1183
1184 #ifndef CONFIG_USER_ONLY 1184 #ifndef CONFIG_USER_ONLY
1185 if (s->last_packet_len) { 1185 if (s->last_packet_len) {
@@ -1237,12 +1237,12 @@ static void gdb_read_byte(GDBState *s, int ch) @@ -1237,12 +1237,12 @@ static void gdb_read_byte(GDBState *s, int ch)
1237 csum += s->line_buf[i]; 1237 csum += s->line_buf[i];
1238 } 1238 }
1239 if (s->line_csum != (csum & 0xff)) { 1239 if (s->line_csum != (csum & 0xff)) {
1240 - reply[0] = '-';  
1241 - put_buffer(s, reply, 1); 1240 + reply = '-';
  1241 + put_buffer(s, &reply, 1);
1242 s->state = RS_IDLE; 1242 s->state = RS_IDLE;
1243 } else { 1243 } else {
1244 - reply[0] = '+';  
1245 - put_buffer(s, reply, 1); 1244 + reply = '+';
  1245 + put_buffer(s, &reply, 1);
1246 s->state = gdb_handle_packet(s, env, s->line_buf); 1246 s->state = gdb_handle_packet(s, env, s->line_buf);
1247 } 1247 }
1248 break; 1248 break;
hw/fdc.c
@@ -180,7 +180,7 @@ typedef struct fd_format_t { @@ -180,7 +180,7 @@ typedef struct fd_format_t {
180 uint8_t last_sect; 180 uint8_t last_sect;
181 uint8_t max_track; 181 uint8_t max_track;
182 uint8_t max_head; 182 uint8_t max_head;
183 - const unsigned char *str; 183 + const char *str;
184 } fd_format_t; 184 } fd_format_t;
185 185
186 static const fd_format_t fd_formats[] = { 186 static const fd_format_t fd_formats[] = {
hw/ide.c
@@ -471,12 +471,12 @@ static void ide_identify(IDEState *s) @@ -471,12 +471,12 @@ static void ide_identify(IDEState *s)
471 put_le16(p + 5, 512); /* XXX: retired, remove ? */ 471 put_le16(p + 5, 512); /* XXX: retired, remove ? */
472 put_le16(p + 6, s->sectors); 472 put_le16(p + 6, s->sectors);
473 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 473 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
474 - padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ 474 + padstr((char *)(p + 10), buf, 20); /* serial number */
475 put_le16(p + 20, 3); /* XXX: retired, remove ? */ 475 put_le16(p + 20, 3); /* XXX: retired, remove ? */
476 put_le16(p + 21, 512); /* cache size in sectors */ 476 put_le16(p + 21, 512); /* cache size in sectors */
477 put_le16(p + 22, 4); /* ecc bytes */ 477 put_le16(p + 22, 4); /* ecc bytes */
478 - padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */  
479 - padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); /* model */ 478 + padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */
  479 + padstr((char *)(p + 27), "QEMU HARDDISK", 40); /* model */
480 #if MAX_MULT_SECTORS > 1 480 #if MAX_MULT_SECTORS > 1
481 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); 481 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
482 #endif 482 #endif
@@ -536,12 +536,12 @@ static void ide_atapi_identify(IDEState *s) @@ -536,12 +536,12 @@ static void ide_atapi_identify(IDEState *s)
536 /* Removable CDROM, 50us response, 12 byte packets */ 536 /* Removable CDROM, 50us response, 12 byte packets */
537 put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); 537 put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0));
538 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 538 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
539 - padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ 539 + padstr((char *)(p + 10), buf, 20); /* serial number */
540 put_le16(p + 20, 3); /* buffer type */ 540 put_le16(p + 20, 3); /* buffer type */
541 put_le16(p + 21, 512); /* cache size in sectors */ 541 put_le16(p + 21, 512); /* cache size in sectors */
542 put_le16(p + 22, 4); /* ecc bytes */ 542 put_le16(p + 22, 4); /* ecc bytes */
543 - padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */  
544 - padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */ 543 + padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */
  544 + padstr((char *)(p + 27), "QEMU CD-ROM", 40); /* model */
545 put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */ 545 put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
546 #ifdef USE_DMA_CDROM 546 #ifdef USE_DMA_CDROM
547 put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */ 547 put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */
@@ -591,10 +591,10 @@ static void ide_cfata_identify(IDEState *s) @@ -591,10 +591,10 @@ static void ide_cfata_identify(IDEState *s)
591 put_le16(p + 7, s->nb_sectors >> 16); /* Sectors per card */ 591 put_le16(p + 7, s->nb_sectors >> 16); /* Sectors per card */
592 put_le16(p + 8, s->nb_sectors); /* Sectors per card */ 592 put_le16(p + 8, s->nb_sectors); /* Sectors per card */
593 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 593 snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
594 - padstr((uint8_t *)(p + 10), buf, 20); /* Serial number in ASCII */ 594 + padstr((char *)(p + 10), buf, 20); /* Serial number in ASCII */
595 put_le16(p + 22, 0x0004); /* ECC bytes */ 595 put_le16(p + 22, 0x0004); /* ECC bytes */
596 - padstr((uint8_t *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */  
597 - padstr((uint8_t *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */ 596 + padstr((char *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */
  597 + padstr((char *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */
598 #if MAX_MULT_SECTORS > 1 598 #if MAX_MULT_SECTORS > 1
599 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); 599 put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
600 #else 600 #else
hw/ne2000.c
@@ -647,7 +647,7 @@ static uint32_t ne2000_reset_ioport_read(void *opaque, uint32_t addr) @@ -647,7 +647,7 @@ static uint32_t ne2000_reset_ioport_read(void *opaque, uint32_t addr)
647 static void ne2000_save(QEMUFile* f,void* opaque) 647 static void ne2000_save(QEMUFile* f,void* opaque)
648 { 648 {
649 NE2000State* s=(NE2000State*)opaque; 649 NE2000State* s=(NE2000State*)opaque;
650 - int tmp; 650 + uint32_t tmp;
651 651
652 if (s->pci_dev) 652 if (s->pci_dev)
653 pci_device_save(s->pci_dev, f); 653 pci_device_save(s->pci_dev, f);
@@ -679,7 +679,7 @@ static int ne2000_load(QEMUFile* f,void* opaque,int version_id) @@ -679,7 +679,7 @@ static int ne2000_load(QEMUFile* f,void* opaque,int version_id)
679 { 679 {
680 NE2000State* s=(NE2000State*)opaque; 680 NE2000State* s=(NE2000State*)opaque;
681 int ret; 681 int ret;
682 - int tmp; 682 + uint32_t tmp;
683 683
684 if (version_id > 3) 684 if (version_id > 3)
685 return -EINVAL; 685 return -EINVAL;
hw/rtl8139.c
@@ -3119,7 +3119,7 @@ static uint32_t rtl8139_mmio_readl(void *opaque, target_phys_addr_t addr) @@ -3119,7 +3119,7 @@ static uint32_t rtl8139_mmio_readl(void *opaque, target_phys_addr_t addr)
3119 static void rtl8139_save(QEMUFile* f,void* opaque) 3119 static void rtl8139_save(QEMUFile* f,void* opaque)
3120 { 3120 {
3121 RTL8139State* s=(RTL8139State*)opaque; 3121 RTL8139State* s=(RTL8139State*)opaque;
3122 - int i; 3122 + unsigned int i;
3123 3123
3124 pci_device_save(s->pci_dev, f); 3124 pci_device_save(s->pci_dev, f);
3125 3125
@@ -3205,7 +3205,8 @@ static void rtl8139_save(QEMUFile* f,void* opaque) @@ -3205,7 +3205,8 @@ static void rtl8139_save(QEMUFile* f,void* opaque)
3205 static int rtl8139_load(QEMUFile* f,void* opaque,int version_id) 3205 static int rtl8139_load(QEMUFile* f,void* opaque,int version_id)
3206 { 3206 {
3207 RTL8139State* s=(RTL8139State*)opaque; 3207 RTL8139State* s=(RTL8139State*)opaque;
3208 - int i, ret; 3208 + unsigned int i;
  3209 + int ret;
3209 3210
3210 /* just 2 versions for now */ 3211 /* just 2 versions for now */
3211 if (version_id > 3) 3212 if (version_id > 3)
hw/usb-uhci.c
@@ -508,7 +508,7 @@ static void uhci_async_complete_packet(USBPacket * packet, void *opaque); @@ -508,7 +508,7 @@ static void uhci_async_complete_packet(USBPacket * packet, void *opaque);
508 0 if TD successful 508 0 if TD successful
509 1 if TD unsuccessful or inactive 509 1 if TD unsuccessful or inactive
510 */ 510 */
511 -static int uhci_handle_td(UHCIState *s, UHCI_TD *td, int *int_mask, 511 +static int uhci_handle_td(UHCIState *s, UHCI_TD *td, uint32_t *int_mask,
512 int completion) 512 int completion)
513 { 513 {
514 uint8_t pid; 514 uint8_t pid;
@@ -733,8 +733,8 @@ static void uhci_frame_timer(void *opaque) @@ -733,8 +733,8 @@ static void uhci_frame_timer(void *opaque)
733 { 733 {
734 UHCIState *s = opaque; 734 UHCIState *s = opaque;
735 int64_t expire_time; 735 int64_t expire_time;
736 - uint32_t frame_addr, link, old_td_ctrl, val;  
737 - int int_mask, cnt, ret; 736 + uint32_t frame_addr, link, old_td_ctrl, val, int_mask;
  737 + int cnt, ret;
738 UHCI_TD td; 738 UHCI_TD td;
739 UHCI_QH qh; 739 UHCI_QH qh;
740 uint32_t old_async_qh; 740 uint32_t old_async_qh;
monitor.c
@@ -76,7 +76,7 @@ static int hide_banner; @@ -76,7 +76,7 @@ static int hide_banner;
76 static term_cmd_t term_cmds[]; 76 static term_cmd_t term_cmds[];
77 static term_cmd_t info_cmds[]; 77 static term_cmd_t info_cmds[];
78 78
79 -static char term_outbuf[1024]; 79 +static uint8_t term_outbuf[1024];
80 static int term_outbuf_index; 80 static int term_outbuf_index;
81 81
82 static void monitor_start_input(void); 82 static void monitor_start_input(void);
@@ -97,7 +97,7 @@ void term_flush(void) @@ -97,7 +97,7 @@ void term_flush(void)
97 /* flush at every end of line or if the buffer is full */ 97 /* flush at every end of line or if the buffer is full */
98 void term_puts(const char *str) 98 void term_puts(const char *str)
99 { 99 {
100 - int c; 100 + char c;
101 for(;;) { 101 for(;;) {
102 c = *str++; 102 c = *str++;
103 if (c == '\0') 103 if (c == '\0')
@@ -2876,7 +2876,7 @@ static CharDriverState *qemu_chr_open_win_file_out(const char *file_out) @@ -2876,7 +2876,7 @@ static CharDriverState *qemu_chr_open_win_file_out(const char *file_out)
2876 typedef struct { 2876 typedef struct {
2877 int fd; 2877 int fd;
2878 struct sockaddr_in daddr; 2878 struct sockaddr_in daddr;
2879 - char buf[1024]; 2879 + uint8_t buf[1024];
2880 int bufcnt; 2880 int bufcnt;
2881 int bufptr; 2881 int bufptr;
2882 int max_size; 2882 int max_size;
@@ -3034,7 +3034,7 @@ static int tcp_chr_read_poll(void *opaque) @@ -3034,7 +3034,7 @@ static int tcp_chr_read_poll(void *opaque)
3034 #define IAC_BREAK 243 3034 #define IAC_BREAK 243
3035 static void tcp_chr_process_IAC_bytes(CharDriverState *chr, 3035 static void tcp_chr_process_IAC_bytes(CharDriverState *chr,
3036 TCPCharDriver *s, 3036 TCPCharDriver *s,
3037 - char *buf, int *size) 3037 + uint8_t *buf, int *size)
3038 { 3038 {
3039 /* Handle any telnet client's basic IAC options to satisfy char by 3039 /* Handle any telnet client's basic IAC options to satisfy char by
3040 * char mode with no echo. All IAC options will be removed from 3040 * char mode with no echo. All IAC options will be removed from
@@ -8266,7 +8266,7 @@ int main(int argc, char **argv) @@ -8266,7 +8266,7 @@ int main(int argc, char **argv)
8266 /* We just do some generic consistency checks */ 8266 /* We just do some generic consistency checks */
8267 { 8267 {
8268 /* Could easily be extended to 64 devices if needed */ 8268 /* Could easily be extended to 64 devices if needed */
8269 - const unsigned char *p; 8269 + const char *p;
8270 8270
8271 boot_devices_bitmap = 0; 8271 boot_devices_bitmap = 0;
8272 for (p = boot_devices; *p != '\0'; p++) { 8272 for (p = boot_devices; *p != '\0'; p++) {
@@ -60,12 +60,12 @@ typedef struct Buffer @@ -60,12 +60,12 @@ typedef struct Buffer
60 { 60 {
61 size_t capacity; 61 size_t capacity;
62 size_t offset; 62 size_t offset;
63 - char *buffer; 63 + uint8_t *buffer;
64 } Buffer; 64 } Buffer;
65 65
66 typedef struct VncState VncState; 66 typedef struct VncState VncState;
67 67
68 -typedef int VncReadEvent(VncState *vs, char *data, size_t len); 68 +typedef int VncReadEvent(VncState *vs, uint8_t *data, size_t len);
69 69
70 typedef void VncWritePixels(VncState *vs, void *data, int size); 70 typedef void VncWritePixels(VncState *vs, void *data, int size);
71 71
@@ -376,7 +376,7 @@ static void vnc_write_pixels_generic(VncState *vs, void *pixels1, int size) @@ -376,7 +376,7 @@ static void vnc_write_pixels_generic(VncState *vs, void *pixels1, int size)
376 static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h) 376 static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h)
377 { 377 {
378 int i; 378 int i;
379 - char *row; 379 + uint8_t *row;
380 380
381 vnc_framebuffer_update(vs, x, y, w, h, 0); 381 vnc_framebuffer_update(vs, x, y, w, h, 0);
382 382
@@ -440,8 +440,8 @@ static void send_framebuffer_update(VncState *vs, int x, int y, int w, int h) @@ -440,8 +440,8 @@ static void send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
440 static void vnc_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h) 440 static void vnc_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
441 { 441 {
442 int src, dst; 442 int src, dst;
443 - char *src_row;  
444 - char *dst_row; 443 + uint8_t *src_row;
  444 + uint8_t *dst_row;
445 char *old_row; 445 char *old_row;
446 int y = 0; 446 int y = 0;
447 int pitch = ds->linesize; 447 int pitch = ds->linesize;
@@ -499,7 +499,7 @@ static void vnc_update_client(void *opaque) @@ -499,7 +499,7 @@ static void vnc_update_client(void *opaque)
499 499
500 if (vs->need_update && vs->csock != -1) { 500 if (vs->need_update && vs->csock != -1) {
501 int y; 501 int y;
502 - char *row; 502 + uint8_t *row;
503 char *old_row; 503 char *old_row;
504 uint32_t width_mask[VNC_DIRTY_WORDS]; 504 uint32_t width_mask[VNC_DIRTY_WORDS];
505 int n_rectangles; 505 int n_rectangles;
@@ -516,10 +516,11 @@ static void vnc_update_client(void *opaque) @@ -516,10 +516,11 @@ static void vnc_update_client(void *opaque)
516 for (y = 0; y < vs->height; y++) { 516 for (y = 0; y < vs->height; y++) {
517 if (vnc_and_bits(vs->dirty_row[y], width_mask, VNC_DIRTY_WORDS)) { 517 if (vnc_and_bits(vs->dirty_row[y], width_mask, VNC_DIRTY_WORDS)) {
518 int x; 518 int x;
519 - char *ptr, *old_ptr; 519 + uint8_t *ptr;
  520 + char *old_ptr;
520 521
521 ptr = row; 522 ptr = row;
522 - old_ptr = old_row; 523 + old_ptr = (char*)old_row;
523 524
524 for (x = 0; x < vs->ds->width; x += 16) { 525 for (x = 0; x < vs->ds->width; x += 16) {
525 if (memcmp(old_ptr, ptr, 16 * vs->depth) == 0) { 526 if (memcmp(old_ptr, ptr, 16 * vs->depth) == 0) {
@@ -622,7 +623,7 @@ static int buffer_empty(Buffer *buffer) @@ -622,7 +623,7 @@ static int buffer_empty(Buffer *buffer)
622 return buffer->offset == 0; 623 return buffer->offset == 0;
623 } 624 }
624 625
625 -static char *buffer_end(Buffer *buffer) 626 +static uint8_t *buffer_end(Buffer *buffer)
626 { 627 {
627 return buffer->buffer + buffer->offset; 628 return buffer->buffer + buffer->offset;
628 } 629 }
@@ -853,7 +854,7 @@ static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport, @@ -853,7 +854,7 @@ static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,
853 } 854 }
854 #endif /* CONFIG_VNC_TLS */ 855 #endif /* CONFIG_VNC_TLS */
855 856
856 -static void client_cut_text(VncState *vs, size_t len, char *text) 857 +static void client_cut_text(VncState *vs, size_t len, uint8_t *text)
857 { 858 {
858 } 859 }
859 860
@@ -1181,7 +1182,7 @@ static void set_pixel_format(VncState *vs, @@ -1181,7 +1182,7 @@ static void set_pixel_format(VncState *vs,
1181 vga_hw_update(); 1182 vga_hw_update();
1182 } 1183 }
1183 1184
1184 -static int protocol_client_msg(VncState *vs, char *data, size_t len) 1185 +static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
1185 { 1186 {
1186 int i; 1187 int i;
1187 uint16_t limit; 1188 uint16_t limit;
@@ -1254,7 +1255,7 @@ static int protocol_client_msg(VncState *vs, char *data, size_t len) @@ -1254,7 +1255,7 @@ static int protocol_client_msg(VncState *vs, char *data, size_t len)
1254 return 0; 1255 return 0;
1255 } 1256 }
1256 1257
1257 -static int protocol_client_init(VncState *vs, char *data, size_t len) 1258 +static int protocol_client_init(VncState *vs, uint8_t *data, size_t len)
1258 { 1259 {
1259 char pad[3] = { 0, 0, 0 }; 1260 char pad[3] = { 0, 0, 0 };
1260 char buf[1024]; 1261 char buf[1024];
@@ -1327,11 +1328,11 @@ static void make_challenge(VncState *vs) @@ -1327,11 +1328,11 @@ static void make_challenge(VncState *vs)
1327 vs->challenge[i] = (int) (256.0*rand()/(RAND_MAX+1.0)); 1328 vs->challenge[i] = (int) (256.0*rand()/(RAND_MAX+1.0));
1328 } 1329 }
1329 1330
1330 -static int protocol_client_auth_vnc(VncState *vs, char *data, size_t len) 1331 +static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len)
1331 { 1332 {
1332 - char response[VNC_AUTH_CHALLENGE_SIZE]; 1333 + unsigned char response[VNC_AUTH_CHALLENGE_SIZE];
1333 int i, j, pwlen; 1334 int i, j, pwlen;
1334 - char key[8]; 1335 + unsigned char key[8];
1335 1336
1336 if (!vs->password || !vs->password[0]) { 1337 if (!vs->password || !vs->password[0]) {
1337 VNC_DEBUG("No password configured on server"); 1338 VNC_DEBUG("No password configured on server");
@@ -1738,7 +1739,7 @@ static int vnc_start_tls(struct VncState *vs) { @@ -1738,7 +1739,7 @@ static int vnc_start_tls(struct VncState *vs) {
1738 return vnc_continue_handshake(vs); 1739 return vnc_continue_handshake(vs);
1739 } 1740 }
1740 1741
1741 -static int protocol_client_vencrypt_auth(VncState *vs, char *data, size_t len) 1742 +static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len)
1742 { 1743 {
1743 int auth = read_u32(data, 0); 1744 int auth = read_u32(data, 0);
1744 1745
@@ -1768,7 +1769,7 @@ static int protocol_client_vencrypt_auth(VncState *vs, char *data, size_t len) @@ -1768,7 +1769,7 @@ static int protocol_client_vencrypt_auth(VncState *vs, char *data, size_t len)
1768 return 0; 1769 return 0;
1769 } 1770 }
1770 1771
1771 -static int protocol_client_vencrypt_init(VncState *vs, char *data, size_t len) 1772 +static int protocol_client_vencrypt_init(VncState *vs, uint8_t *data, size_t len)
1772 { 1773 {
1773 if (data[0] != 0 || 1774 if (data[0] != 0 ||
1774 data[1] != 2) { 1775 data[1] != 2) {
@@ -1798,7 +1799,7 @@ static int start_auth_vencrypt(VncState *vs) @@ -1798,7 +1799,7 @@ static int start_auth_vencrypt(VncState *vs)
1798 } 1799 }
1799 #endif /* CONFIG_VNC_TLS */ 1800 #endif /* CONFIG_VNC_TLS */
1800 1801
1801 -static int protocol_client_auth(VncState *vs, char *data, size_t len) 1802 +static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len)
1802 { 1803 {
1803 /* We only advertise 1 auth scheme at a time, so client 1804 /* We only advertise 1 auth scheme at a time, so client
1804 * must pick the one we sent. Verify this */ 1805 * must pick the one we sent. Verify this */
@@ -1847,7 +1848,7 @@ static int protocol_client_auth(VncState *vs, char *data, size_t len) @@ -1847,7 +1848,7 @@ static int protocol_client_auth(VncState *vs, char *data, size_t len)
1847 return 0; 1848 return 0;
1848 } 1849 }
1849 1850
1850 -static int protocol_version(VncState *vs, char *version, size_t len) 1851 +static int protocol_version(VncState *vs, uint8_t *version, size_t len)
1851 { 1852 {
1852 char local[13]; 1853 char local[13];
1853 1854
vnchextile.h
@@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, @@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs,
13 uint32_t *last_fg32, 13 uint32_t *last_fg32,
14 int *has_bg, int *has_fg) 14 int *has_bg, int *has_fg)
15 { 15 {
16 - char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); 16 + uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth);
17 pixel_t *irow = (pixel_t *)row; 17 pixel_t *irow = (pixel_t *)row;
18 int j, i; 18 int j, i;
19 pixel_t *last_bg = (pixel_t *)last_bg32; 19 pixel_t *last_bg = (pixel_t *)last_bg32;