debuggers.hg

view tools/ioemu/patches/vnc-fix-signedness @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 # HG changeset patch
2 # User kaf24@localhost.localdomain
3 # Date 1167325891 0
4 # Node ID ede2f5280810789c3cb37603cf2e6b34c60982b1
5 # Parent a138fabc2120376cfb4bf72596a334a1edf8adb0
6 [QEMU] Fix a number of signedness issues plus a typo in the version checking in vnc.c.
7 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
9 Index: ioemu/vnc.c
10 ===================================================================
11 --- ioemu.orig/vnc.c 2007-05-10 15:19:29.000000000 +0100
12 +++ ioemu/vnc.c 2007-05-10 15:19:30.000000000 +0100
13 @@ -50,12 +50,12 @@
14 {
15 size_t capacity;
16 size_t offset;
17 - char *buffer;
18 + uint8_t *buffer;
19 } Buffer;
21 typedef struct VncState VncState;
23 -typedef int VncReadEvent(VncState *vs, char *data, size_t len);
24 +typedef int VncReadEvent(VncState *vs, uint8_t *data, size_t len);
26 typedef void VncWritePixels(VncState *vs, void *data, int size);
28 @@ -86,7 +86,7 @@
29 uint64_t *update_row; /* outstanding updates */
30 int has_update; /* there's outstanding updates in the
31 * visible area */
32 - char *old_data;
33 + uint8_t *old_data;
34 int depth; /* internal VNC frame buffer byte per pixel */
35 int has_resize;
36 int has_hextile;
37 @@ -161,7 +161,7 @@
38 static void vnc_update_client(void *opaque);
39 static void vnc_client_read(void *opaque);
40 static void framebuffer_set_updated(VncState *vs, int x, int y, int w, int h);
41 -static int make_challenge(char *random, int size);
42 +static int make_challenge(unsigned char *random, int size);
43 static void set_seed(unsigned int *seedp);
44 static void get_random(int len, unsigned char *buf);
46 @@ -353,7 +353,7 @@
47 static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h)
48 {
49 int i;
50 - char *row;
51 + uint8_t *row;
53 vnc_framebuffer_update(vs, x, y, w, h, 0);
55 @@ -417,9 +417,9 @@
56 static void vnc_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
57 {
58 int src, dst;
59 - char *src_row;
60 - char *dst_row;
61 - char *old_row;
62 + uint8_t *src_row;
63 + uint8_t *dst_row;
64 + uint8_t *old_row;
65 int y = 0;
66 int pitch = ds->linesize;
67 VncState *vs = ds->opaque;
68 @@ -488,8 +488,8 @@
69 VncState *vs = opaque;
70 int64_t now;
71 int y;
72 - char *row;
73 - char *old_row;
74 + uint8_t *row;
75 + uint8_t *old_row;
76 uint64_t width_mask;
77 int n_rectangles;
78 int saved_offset;
79 @@ -514,7 +514,7 @@
80 for (y = 0; y < vs->ds->height; y++) {
81 if (vs->dirty_row[y] & width_mask) {
82 int x;
83 - char *ptr, *old_ptr;
84 + uint8_t *ptr, *old_ptr;
86 ptr = row;
87 old_ptr = old_row;
88 @@ -677,7 +677,7 @@
89 return buffer->offset == 0;
90 }
92 -static char *buffer_end(Buffer *buffer)
93 +static uint8_t *buffer_end(Buffer *buffer)
94 {
95 return buffer->buffer + buffer->offset;
96 }
97 @@ -811,7 +811,7 @@
99 static void vnc_write_u8(VncState *vs, uint8_t value)
100 {
101 - vnc_write(vs, (char *)&value, 1);
102 + vnc_write(vs, &value, 1);
103 }
105 static void vnc_flush(VncState *vs)
106 @@ -1135,11 +1135,10 @@
107 vga_hw_update();
108 }
110 -static int protocol_client_msg(VncState *vs, char *data, size_t len)
111 +static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
112 {
113 int i;
114 uint16_t limit;
115 - int64_t now;
117 switch (data[0]) {
118 case 0:
119 @@ -1208,7 +1207,7 @@
120 return 8 + v;
121 }
123 - client_cut_text(vs, read_u32(data, 4), data + 8);
124 + client_cut_text(vs, read_u32(data, 4), (char *)(data + 8));
125 break;
126 default:
127 printf("Msg: %d\n", data[0]);
128 @@ -1220,7 +1219,7 @@
129 return 0;
130 }
132 -static int protocol_client_init(VncState *vs, char *data, size_t len)
133 +static int protocol_client_init(VncState *vs, uint8_t *data, size_t len)
134 {
135 size_t l;
136 char pad[3] = { 0, 0, 0 };
137 @@ -1281,7 +1280,7 @@
138 return 0;
139 }
141 -static int protocol_response(VncState *vs, char *client_response, size_t len)
142 +static int protocol_response(VncState *vs, uint8_t *client_response, size_t len)
143 {
144 extern char vncpasswd[64];
145 extern unsigned char challenge[AUTHCHALLENGESIZE];
146 @@ -1319,7 +1318,7 @@
147 return 0;
148 }
150 -static int protocol_version(VncState *vs, char *version, size_t len)
151 +static int protocol_version(VncState *vs, uint8_t *version, size_t len)
152 {
153 extern char vncpasswd[64];
154 extern unsigned char challenge[AUTHCHALLENGESIZE];
155 @@ -1535,7 +1534,7 @@
157 unsigned int seed;
159 -static int make_challenge(char *random, int size)
160 +static int make_challenge(unsigned char *random, int size)
161 {
163 set_seed(&seed);
164 Index: ioemu/vnchextile.h
165 ===================================================================
166 --- ioemu.orig/vnchextile.h 2007-05-10 15:17:54.000000000 +0100
167 +++ ioemu/vnchextile.h 2007-05-10 15:19:30.000000000 +0100
168 @@ -13,7 +13,7 @@
169 uint32_t *last_fg32,
170 int *has_bg, int *has_fg)
171 {
172 - char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth);
173 + uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth);
174 pixel_t *irow = (pixel_t *)row;
175 int j, i;
176 pixel_t *last_bg = (pixel_t *)last_bg32;