changes so it compiles with g++(mainly for ports)

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@375 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2003-05-19 21:36:33 +00:00
parent 679261b7fc
commit 70de4fa1f9
8 changed files with 38 additions and 39 deletions

View File

@ -661,7 +661,7 @@ process_raw_bmpcache(STREAM s)
in_uint8p(s, data, bufsize);
DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));
inverted = xmalloc(width * height * Bpp);
inverted = (uint8*)xmalloc(width * height * Bpp);
for (y = 0; y < height; y++)
{
memcpy(&inverted[(height - y - 1) * (width * Bpp)], &data[y * (width * Bpp)],
@ -684,7 +684,7 @@ process_bmpcache(STREAM s)
uint16 bufsize, pad2, row_size, final_size;
uint8 pad1;
pad2 = row_size = final_size = -1; /* Shut the compiler up */
pad2 = row_size = final_size = 0xffff; /* Shut the compiler up */
in_uint8(s, cache_id);
in_uint8(s, pad1); /* pad */
@ -709,12 +709,12 @@ process_bmpcache(STREAM s)
}
in_uint8p(s, data, size);
DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d,bpp=%d,size=%d,pad1=%d,bufsize=%d,pad2=%d,rs=%d,fs=%d)\n",
width, height,
DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d,bpp=%d,size=%d,pad1=%d,bufsize=%d,pad2=%d,rs=%d,fs=%d)\n",
width, height,
cache_id, cache_idx,
bpp, size, pad1, bufsize, pad2, row_size, final_size));
bmpdata = xmalloc(width * height * Bpp);
bmpdata = (uint8*)xmalloc(width * height * Bpp);
if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
{
@ -742,7 +742,7 @@ process_colcache(STREAM s)
in_uint8(s, cache_id);
in_uint16_le(s, map.ncolours);
map.colours = xmalloc(3 * map.ncolours);
map.colours = (COLOURENTRY*)xmalloc(3 * map.ncolours);
for (i = 0; i < map.ncolours; i++)
{

View File

@ -42,7 +42,7 @@ void xfree(void *mem);
void error(char *format, ...);
void warning(char *format, ...);
void unimpl(char *format, ...);
void hexdump(unsigned char *p, unsigned int len);
void hexdump(unsigned char *p, int len);
int load_licence(unsigned char **data);
void save_licence(unsigned char *data, int length);
/* rdp.c */
@ -75,9 +75,9 @@ void sec_disconnect(void);
void sec_process_mcs_data(STREAM s);
void sec_decrypt(uint8 * data, int length);
/* tcp.c */
STREAM tcp_init(int maxlen);
STREAM tcp_init(uint32 maxlen);
void tcp_send(STREAM s);
STREAM tcp_recv(int length);
STREAM tcp_recv(uint32 length);
BOOL tcp_connect(char *server);
void tcp_disconnect(void);
/* xkeymap.c */

View File

@ -549,11 +549,10 @@ unimpl(char *format, ...)
/* produce a hex dump */
void
hexdump(unsigned char *p, unsigned int len)
hexdump(unsigned char *p, int len)
{
unsigned char *line = p;
unsigned int thisline, offset = 0;
int i;
int i, thisline, offset = 0;
while (offset < len)
{
@ -589,7 +588,7 @@ load_licence(unsigned char **data)
if (home == NULL)
return -1;
path = xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
fd = open(path, O_RDONLY);
@ -599,7 +598,7 @@ load_licence(unsigned char **data)
if (fstat(fd, &st))
return -1;
*data = xmalloc(st.st_size);
*data = (uint8*)xmalloc(st.st_size);
length = read(fd, *data, st.st_size);
close(fd);
xfree(path);
@ -616,7 +615,7 @@ save_licence(unsigned char *data, int length)
if (home == NULL)
return;
path = xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
sprintf(path, "%s/.rdesktop", home);
if ((mkdir(path, 0700) == -1) && errno != EEXIST)
@ -628,7 +627,7 @@ save_licence(unsigned char *data, int length)
/* write licence to licence.hostname.new, then atomically rename to licence.hostname */
sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
tmppath = xmalloc(strlen(path) + sizeof(".new"));
tmppath = (char*)xmalloc(strlen(path) + sizeof(".new"));
strcpy(tmppath, path);
strcat(tmppath, ".new");

8
rdp.c
View File

@ -236,7 +236,7 @@ rdp_send_logon_info(uint32 flags, char *domain, char *user,
rdp_out_unistr(s, directory, len_directory);
} else {
out_uint16_le(s, 0);
}
}
out_uint16_le(s, 2);
out_uint16_le(s, len_ip+2); // Length of client ip
rdp_out_unistr(s, "127.0.0.1", len_ip);
@ -710,7 +710,7 @@ process_bitmap_updates(STREAM s)
if (!compress)
{
int y;
bmpdata = xmalloc(width * height * Bpp);
bmpdata = (uint8*)xmalloc(width * height * Bpp);
for (y = 0; y < height; y++)
{
in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)],
@ -733,7 +733,7 @@ process_bitmap_updates(STREAM s)
in_uint8s(s, 4); /* line_size, final_size */
}
in_uint8p(s, data, size);
bmpdata = xmalloc(width * height * Bpp);
bmpdata = (uint8*)xmalloc(width * height * Bpp);
if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
{
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata);
@ -760,7 +760,7 @@ process_palette(STREAM s)
in_uint16_le(s, map.ncolours);
in_uint8s(s, 2); /* pad */
map.colours = xmalloc(3 * map.ncolours);
map.colours = (COLOURENTRY*)xmalloc(3 * map.ncolours);
DEBUG(("PALETTE(c=%d)\n", map.ncolours));

View File

@ -804,7 +804,7 @@ sec_connect(char *server, char *username)
/* We exchange some RDP data during the MCS-Connect */
mcs_data.size = 512;
mcs_data.p = mcs_data.data = xmalloc(mcs_data.size);
mcs_data.p = mcs_data.data = (uint8*)xmalloc(mcs_data.size);
sec_out_mcs_data(&mcs_data);
if (!mcs_connect(server, &mcs_data, username))

18
tcp.c
View File

@ -12,7 +12,7 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -39,11 +39,11 @@ extern int tcp_port_rdp;
/* Initialise TCP transport data packet */
STREAM
tcp_init(int maxlen)
tcp_init(uint32 maxlen)
{
if (maxlen > out.size)
{
out.data = xrealloc(out.data, maxlen);
out.data = (uint8*)xrealloc(out.data, maxlen);
out.size = maxlen;
}
@ -74,13 +74,13 @@ tcp_send(STREAM s)
/* Receive a message on the TCP layer */
STREAM
tcp_recv(int length)
tcp_recv(uint32 length)
{
int rcvd = 0;
if (length > in.size)
{
in.data = xrealloc(in.data, length);
in.data = (uint8*)xrealloc(in.data, length);
in.size = length;
}
@ -112,7 +112,7 @@ tcp_connect(char *server)
{
struct hostent *nslookup;
struct sockaddr_in servaddr;
int true = 1;
int true_value = 1;
if ((nslookup = gethostbyname(server)) != NULL)
{
@ -140,13 +140,13 @@ tcp_connect(char *server)
return False;
}
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void *) &true, sizeof(true));
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void *) &true_value, sizeof(true_value));
in.size = 4096;
in.data = xmalloc(in.size);
in.data = (uint8*)xmalloc(in.size);
out.size = 4096;
out.data = xmalloc(out.size);
out.data = (uint8*)xmalloc(out.size);
return True;
}

View File

@ -12,7 +12,7 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -359,7 +359,7 @@ xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state)
warning("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym));
/* not in keymap, try to interpret the raw scancode */
if ((keycode >= min_keycode) && (keycode <= 0x60))
if (((int)keycode >= min_keycode) && (keycode <= 0x60))
{
tr.scancode = keycode - min_keycode;

14
xwin.c
View File

@ -413,7 +413,7 @@ static uint8 *
translate_image(int width, int height, uint8 * data)
{
int size = width * height * bpp / 8;
uint8 *out = xmalloc(size);
uint8 *out = (uint8*)xmalloc(size);
uint8 *end = out + size;
switch (server_bpp)
@ -787,7 +787,7 @@ xwin_process_events(void)
case ClientMessage:
/* the window manager told us to quit */
if ((xevent.xclient.message_type == protocol_atom)
&& (xevent.xclient.data.l[0] == kill_atom))
&& ((Atom)xevent.xclient.data.l[0] == kill_atom))
/* Quit */
return 0;
break;
@ -1137,10 +1137,10 @@ ui_create_cursor(unsigned int x, unsigned int y, int width, int height,
scanline = (width + 7) / 8;
offset = scanline * height;
cursor = xmalloc(offset);
cursor = (uint8*)xmalloc(offset);
memset(cursor, 0, offset);
mask = xmalloc(offset);
mask = (uint8*)xmalloc(offset);
memset(mask, 0, offset);
/* approximate AND and XOR masks with a monochrome X pointer */
@ -1219,7 +1219,7 @@ ui_create_colourmap(COLOURMAP * colours)
int i, ncolours = colours->ncolours;
if (!owncolmap)
{
uint32 *map = xmalloc(sizeof(*colmap) * ncolours);
uint32 *map = (uint32*)xmalloc(sizeof(*colmap) * ncolours);
XColor xentry;
XColor xc_cache[256];
uint32 colour;
@ -1297,7 +1297,7 @@ ui_create_colourmap(COLOURMAP * colours)
XColor *xcolours, *xentry;
Colormap map;
xcolours = xmalloc(sizeof(XColor) * ncolours);
xcolours = (XColor*)xmalloc(sizeof(XColor) * ncolours);
for (i = 0; i < ncolours; i++)
{
entry = &colours->colours[i];
@ -1327,7 +1327,7 @@ void
ui_set_colourmap(HCOLOURMAP map)
{
if (!owncolmap)
colmap = map;
colmap = (uint32*)map;
else
XSetWindowColormap(display, wnd, (Colormap) map);
}