Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@737 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
6adcee4855
commit
dc156f8fcd
2
cache.c
2
cache.c
@ -40,7 +40,7 @@ cache_remove_lru_bitmap(uint8 cache_id)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint16 cache_idx = 0;
|
uint16 cache_idx = 0;
|
||||||
uint32 m = (uint32)-1;
|
uint32 m = (uint32) - 1;
|
||||||
BMPCACHEENTRY *pbce;
|
BMPCACHEENTRY *pbce;
|
||||||
|
|
||||||
for (i = 0; i < NUM_ELEMENTS(g_bmpcache[cache_id]); i++)
|
for (i = 0; i < NUM_ELEMENTS(g_bmpcache[cache_id]); i++)
|
||||||
|
10
orders.c
10
orders.c
@ -772,7 +772,7 @@ process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)
|
|||||||
in_uint8p(s, data, bufsize);
|
in_uint8p(s, data, bufsize);
|
||||||
|
|
||||||
DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",
|
DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",
|
||||||
compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize));
|
compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize));
|
||||||
|
|
||||||
bmpdata = (uint8 *) xmalloc(width * height * Bpp);
|
bmpdata = (uint8 *) xmalloc(width * height * Bpp);
|
||||||
|
|
||||||
@ -789,7 +789,7 @@ process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)
|
|||||||
{
|
{
|
||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
memcpy(&bmpdata[(height - y - 1) * (width * Bpp)],
|
memcpy(&bmpdata[(height - y - 1) * (width * Bpp)],
|
||||||
&data[y * (width * Bpp)], width * Bpp);
|
&data[y * (width * Bpp)], width * Bpp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bitmap = ui_create_bitmap(width, height, bmpdata);
|
bitmap = ui_create_bitmap(width, height, bmpdata);
|
||||||
@ -799,7 +799,7 @@ process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)
|
|||||||
cache_put_bitmap(cache_id, cache_idx, bitmap, 0);
|
cache_put_bitmap(cache_id, cache_idx, bitmap, 0);
|
||||||
if (flags & PERSIST)
|
if (flags & PERSIST)
|
||||||
pstcache_put_bitmap(cache_id, cache_idx, bitmap_id, width, height,
|
pstcache_put_bitmap(cache_id, cache_idx, bitmap_id, width, height,
|
||||||
width * height * Bpp, bmpdata);
|
width * height * Bpp, bmpdata);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -885,10 +885,10 @@ process_secondary_order(STREAM s)
|
|||||||
uint8 *next_order;
|
uint8 *next_order;
|
||||||
|
|
||||||
in_uint16_le(s, length);
|
in_uint16_le(s, length);
|
||||||
in_uint16_le(s, flags); /* used by bmpcache2 */
|
in_uint16_le(s, flags); /* used by bmpcache2 */
|
||||||
in_uint8(s, type);
|
in_uint8(s, type);
|
||||||
|
|
||||||
next_order = s->p + (sint16)length + 7;
|
next_order = s->p + (sint16) length + 7;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
2
orders.h
2
orders.h
@ -264,7 +264,7 @@ RDP_BMPCACHE_ORDER;
|
|||||||
#define MODE_SHIFT 3
|
#define MODE_SHIFT 3
|
||||||
|
|
||||||
#define LONG_FORMAT 0x80
|
#define LONG_FORMAT 0x80
|
||||||
#define BUFSIZE_MASK 0x3FFF /* or 0x1FFF? */
|
#define BUFSIZE_MASK 0x3FFF /* or 0x1FFF? */
|
||||||
|
|
||||||
#define MAX_GLYPH 32
|
#define MAX_GLYPH 32
|
||||||
|
|
||||||
|
8
proto.h
8
proto.h
@ -64,9 +64,9 @@ void printercache_process(STREAM s);
|
|||||||
/* pstcache.c */
|
/* pstcache.c */
|
||||||
void pstcache_touch_bitmap(uint8 id, uint16 idx, uint32 stamp);
|
void pstcache_touch_bitmap(uint8 id, uint16 idx, uint32 stamp);
|
||||||
BOOL pstcache_load_bitmap(uint8 id, uint16 idx);
|
BOOL pstcache_load_bitmap(uint8 id, uint16 idx);
|
||||||
BOOL pstcache_put_bitmap(uint8 id, uint16 idx, uint8 *bmp_id, uint16 wd,
|
BOOL pstcache_put_bitmap(uint8 id, uint16 idx, uint8 * bmp_id, uint16 wd,
|
||||||
uint16 ht, uint16 len, uint8 *data);
|
uint16 ht, uint16 len, uint8 * data);
|
||||||
int pstcache_enumerate(uint8 id, uint8 *list);
|
int pstcache_enumerate(uint8 id, uint8 * list);
|
||||||
BOOL pstcache_init(uint8 id);
|
BOOL pstcache_init(uint8 id);
|
||||||
/* rdesktop.c */
|
/* rdesktop.c */
|
||||||
int main(int argc, char *argv[]);
|
int main(int argc, char *argv[]);
|
||||||
@ -87,7 +87,7 @@ BOOL rd_pstcache_mkdir(void);
|
|||||||
int rd_open_file(char *filename);
|
int rd_open_file(char *filename);
|
||||||
void rd_close_file(int fd);
|
void rd_close_file(int fd);
|
||||||
int rd_read_file(int fd, void *ptr, int len);
|
int rd_read_file(int fd, void *ptr, int len);
|
||||||
int rd_write_file(int fd, void* ptr, int len);
|
int rd_write_file(int fd, void *ptr, int len);
|
||||||
int rd_lseek_file(int fd, int offset);
|
int rd_lseek_file(int fd, int offset);
|
||||||
BOOL rd_lock_file(int fd, int start, int len);
|
BOOL rd_lock_file(int fd, int start, int len);
|
||||||
/* rdp5.c */
|
/* rdp5.c */
|
||||||
|
14
pstcache.c
14
pstcache.c
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "rdesktop.h"
|
#include "rdesktop.h"
|
||||||
|
|
||||||
#define MAX_CELL_SIZE 0x1000 /* pixels */
|
#define MAX_CELL_SIZE 0x1000 /* pixels */
|
||||||
|
|
||||||
#define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0)
|
#define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0)
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ extern BOOL g_bitmap_cache_precache;
|
|||||||
int g_pstcache_fd[8];
|
int g_pstcache_fd[8];
|
||||||
int g_pstcache_Bpp;
|
int g_pstcache_Bpp;
|
||||||
BOOL g_pstcache_enumerated = False;
|
BOOL g_pstcache_enumerated = False;
|
||||||
uint8 zero_id[] = {0, 0, 0, 0, 0, 0, 0, 0};
|
uint8 zero_id[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
|
||||||
/* Update usage info for a bitmap */
|
/* Update usage info for a bitmap */
|
||||||
@ -65,7 +65,7 @@ pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
|
|||||||
fd = g_pstcache_fd[cache_id];
|
fd = g_pstcache_fd[cache_id];
|
||||||
rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
|
rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
|
||||||
rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));
|
rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));
|
||||||
celldata = (uint8 *)xmalloc(cellhdr.length);
|
celldata = (uint8 *) xmalloc(cellhdr.length);
|
||||||
rd_read_file(fd, celldata, cellhdr.length);
|
rd_read_file(fd, celldata, cellhdr.length);
|
||||||
|
|
||||||
DEBUG(("Loading bitmap from disk (%d:%d)\n", cache_id, cache_idx));
|
DEBUG(("Loading bitmap from disk (%d:%d)\n", cache_id, cache_idx));
|
||||||
@ -79,8 +79,8 @@ pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
|
|||||||
|
|
||||||
/* Store a bitmap in the persistent cache */
|
/* Store a bitmap in the persistent cache */
|
||||||
BOOL
|
BOOL
|
||||||
pstcache_put_bitmap(uint8 cache_id, uint16 cache_idx, uint8 *bitmap_id,
|
pstcache_put_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * bitmap_id,
|
||||||
uint16 width, uint16 height, uint16 length, uint8 *data)
|
uint16 width, uint16 height, uint16 length, uint8 * data)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
CELLHEADER cellhdr;
|
CELLHEADER cellhdr;
|
||||||
@ -104,7 +104,7 @@ pstcache_put_bitmap(uint8 cache_id, uint16 cache_idx, uint8 *bitmap_id,
|
|||||||
|
|
||||||
/* list the bitmaps from the persistent cache file */
|
/* list the bitmaps from the persistent cache file */
|
||||||
int
|
int
|
||||||
pstcache_enumerate(uint8 cache_id, uint8 *idlist)
|
pstcache_enumerate(uint8 cache_id, uint8 * idlist)
|
||||||
{
|
{
|
||||||
int fd, n, c = 0;
|
int fd, n, c = 0;
|
||||||
CELLHEADER cellhdr;
|
CELLHEADER cellhdr;
|
||||||
@ -127,7 +127,7 @@ pstcache_enumerate(uint8 cache_id, uint8 *idlist)
|
|||||||
if (memcmp(cellhdr.bitmap_id, zero_id, sizeof(BITMAP_ID)) != 0)
|
if (memcmp(cellhdr.bitmap_id, zero_id, sizeof(BITMAP_ID)) != 0)
|
||||||
{
|
{
|
||||||
memcpy(idlist + n * sizeof(BITMAP_ID), cellhdr.bitmap_id,
|
memcpy(idlist + n * sizeof(BITMAP_ID), cellhdr.bitmap_id,
|
||||||
sizeof(BITMAP_ID));
|
sizeof(BITMAP_ID));
|
||||||
|
|
||||||
if (cellhdr.stamp)
|
if (cellhdr.stamp)
|
||||||
{
|
{
|
||||||
|
14
rdesktop.c
14
rdesktop.c
@ -367,7 +367,7 @@ main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((c = getopt(argc, argv,
|
while ((c = getopt(argc, argv,
|
||||||
VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:Pr:045h?")) != -1)
|
VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:Pr:045h?")) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
@ -1167,7 +1167,7 @@ rd_open_file(char *filename)
|
|||||||
{
|
{
|
||||||
char *home;
|
char *home;
|
||||||
char fn[256];
|
char fn[256];
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (home == NULL)
|
if (home == NULL)
|
||||||
@ -1183,28 +1183,28 @@ rd_open_file(char *filename)
|
|||||||
void
|
void
|
||||||
rd_close_file(int fd)
|
rd_close_file(int fd)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read from file*/
|
/* read from file*/
|
||||||
int
|
int
|
||||||
rd_read_file(int fd, void *ptr, int len)
|
rd_read_file(int fd, void *ptr, int len)
|
||||||
{
|
{
|
||||||
return read(fd, ptr, len);
|
return read(fd, ptr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write to file */
|
/* write to file */
|
||||||
int
|
int
|
||||||
rd_write_file(int fd, void* ptr, int len)
|
rd_write_file(int fd, void *ptr, int len)
|
||||||
{
|
{
|
||||||
return write(fd, ptr, len);
|
return write(fd, ptr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move file pointer */
|
/* move file pointer */
|
||||||
int
|
int
|
||||||
rd_lseek_file(int fd, int offset)
|
rd_lseek_file(int fd, int offset)
|
||||||
{
|
{
|
||||||
return lseek(fd, offset, SEEK_SET);
|
return lseek(fd, offset, SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do a write lock on a file */
|
/* do a write lock on a file */
|
||||||
|
17
rdp.c
17
rdp.c
@ -410,8 +410,7 @@ rdp_enum_bmpcache2(void)
|
|||||||
out_uint32_le(s, flags);
|
out_uint32_le(s, flags);
|
||||||
|
|
||||||
/* list */
|
/* list */
|
||||||
out_uint8a(s, idlist + offset * sizeof(BITMAP_ID),
|
out_uint8a(s, idlist + offset * sizeof(BITMAP_ID), count * sizeof(BITMAP_ID));
|
||||||
count * sizeof(BITMAP_ID));
|
|
||||||
|
|
||||||
s_mark_end(s);
|
s_mark_end(s);
|
||||||
rdp_send_data(s, 0x2b);
|
rdp_send_data(s, 0x2b);
|
||||||
@ -561,7 +560,7 @@ rdp_out_bmpcache2_caps(STREAM s)
|
|||||||
{
|
{
|
||||||
out_uint32_le(s, BMPCACHE2_C2_CELLS);
|
out_uint32_le(s, BMPCACHE2_C2_CELLS);
|
||||||
}
|
}
|
||||||
out_uint8s(s, 20); /* other bitmap caches not used */
|
out_uint8s(s, 20); /* other bitmap caches not used */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Output control capability set */
|
/* Output control capability set */
|
||||||
@ -652,7 +651,7 @@ static uint8 caps_0x10[] = {
|
|||||||
|
|
||||||
/* Output unknown capability sets */
|
/* Output unknown capability sets */
|
||||||
static void
|
static void
|
||||||
rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 *caps)
|
rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 * caps)
|
||||||
{
|
{
|
||||||
out_uint16_le(s, id);
|
out_uint16_le(s, id);
|
||||||
out_uint16_le(s, length);
|
out_uint16_le(s, length);
|
||||||
@ -672,7 +671,7 @@ rdp_send_confirm_active(void)
|
|||||||
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
|
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
|
||||||
RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
|
RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
|
||||||
RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +
|
RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +
|
||||||
0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ +
|
0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ +
|
||||||
4 /* w2k fix, why? */ ;
|
4 /* w2k fix, why? */ ;
|
||||||
|
|
||||||
s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));
|
s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));
|
||||||
@ -700,11 +699,11 @@ rdp_send_confirm_active(void)
|
|||||||
rdp_out_pointer_caps(s);
|
rdp_out_pointer_caps(s);
|
||||||
rdp_out_share_caps(s);
|
rdp_out_share_caps(s);
|
||||||
|
|
||||||
rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */
|
rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */
|
||||||
rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);
|
rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);
|
||||||
rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);
|
rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);
|
||||||
rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */
|
rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */
|
||||||
|
|
||||||
s_mark_end(s);
|
s_mark_end(s);
|
||||||
sec_send(s, sec_flags);
|
sec_send(s, sec_flags);
|
||||||
}
|
}
|
||||||
@ -748,7 +747,7 @@ rdp_process_bitmap_caps(STREAM s)
|
|||||||
if (g_width != width || g_height != height)
|
if (g_width != width || g_height != height)
|
||||||
{
|
{
|
||||||
warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height,
|
warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height,
|
||||||
width, height);
|
width, height);
|
||||||
g_width = width;
|
g_width = width;
|
||||||
g_height = height;
|
g_height = height;
|
||||||
ui_resize_window();
|
ui_resize_window();
|
||||||
|
Loading…
Reference in New Issue
Block a user