From 3a323bbcc1f71777337962dc7573acf061a89981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Wed, 15 Oct 2003 14:01:32 +0000 Subject: [PATCH] Fixed indentation git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@498 423420c4-83ab-492f-b58f-81f9feb106b5 --- channels.c | 2 +- proto.h | 75 ++++++++++++++++++++++++++------------------- rdpsnd.c | 86 +++++++++++++++++++++++++++------------------------- rdpsnd_oss.c | 17 ++++++----- rdpsnd_sun.c | 57 +++++++++++++++++----------------- types.h | 19 ++++++------ xwin.c | 24 ++++++--------- 7 files changed, 148 insertions(+), 132 deletions(-) diff --git a/channels.c b/channels.c index c7e5b88..b978e8e 100644 --- a/channels.c +++ b/channels.c @@ -89,7 +89,7 @@ channel_send(STREAM s, VCHANNEL * channel) DEBUG_CLIPBOARD(("channel_send, length = %d\n", length)); - thislength = MIN(length, CHANNEL_CHUNK_LENGTH); + thislength = MIN(length, CHANNEL_CHUNK_LENGTH); /* Note: In the original clipboard implementation, this number was 1592, not 1600. However, I don't remember the reason and 1600 seems to work so.. This applies only to *this* length, not the length of diff --git a/proto.h b/proto.h index 5e6ed22..76d4f46 100644 --- a/proto.h +++ b/proto.h @@ -1,30 +1,33 @@ /* bitmap.c */ -BOOL bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size, int Bpp); +BOOL bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size, + int Bpp); /* cache.c */ HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx); void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap); FONTGLYPH *cache_get_font(uint8 font, uint16 character); -void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap); +void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, + uint16 height, HGLYPH pixmap); DATABLOB *cache_get_text(uint8 cache_id); void cache_put_text(uint8 cache_id, void *data, int length); uint8 *cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel); -void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data); +void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, + uint8 * data); HCURSOR cache_get_cursor(uint16 cache_idx); void cache_put_cursor(uint16 cache_idx, HCURSOR cursor); /* channels.c */ -VCHANNEL *channel_register(char *name, uint32 flags, void (*callback)(STREAM)); -STREAM channel_init(VCHANNEL *channel, uint32 length); -void channel_send(STREAM s, VCHANNEL *channel); +VCHANNEL *channel_register(char *name, uint32 flags, void (*callback) (STREAM)); +STREAM channel_init(VCHANNEL * channel, uint32 length); +void channel_send(STREAM s, VCHANNEL * channel); void channel_process(STREAM s, uint16 mcs_channel); /* cliprdr.c */ void cliprdr_send_text_format_announce(void); void cliprdr_send_blah_format_announce(void); -void cliprdr_send_native_format_announce(uint8 *data, uint32 length); +void cliprdr_send_native_format_announce(uint8 * data, uint32 length); void cliprdr_send_data_request(uint32 format); -void cliprdr_send_data(uint8 *data, uint32 length); +void cliprdr_send_data(uint8 * data, uint32 length); BOOL cliprdr_init(void); /* ewmhints.c */ -int get_current_workarea(uint32 *x, uint32 *y, uint32 *width, uint32 *height); +int get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height); /* iso.c */ STREAM iso_init(int length); void iso_send(STREAM s); @@ -37,7 +40,7 @@ void licence_process(STREAM s); STREAM mcs_init(int length); void mcs_send_to_channel(STREAM s, uint16 channel); void mcs_send(STREAM s); -STREAM mcs_recv(uint16 *channel); +STREAM mcs_recv(uint16 * channel); BOOL mcs_connect(char *server, STREAM mcs_data, char *username); void mcs_disconnect(void); /* orders.c */ @@ -46,7 +49,7 @@ void reset_order_state(void); /* printer.c */ /* rdesktop.c */ int main(int argc, char *argv[]); -void generate_random(uint8 *random); +void generate_random(uint8 * random); void *xmalloc(int size); void *xrealloc(void *oldmem, int size); void xfree(void *mem); @@ -58,14 +61,16 @@ int load_licence(unsigned char **data); void save_licence(unsigned char *data, int length); /* rdp.c */ void rdp_out_unistr(STREAM s, char *string, int len); -void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2); +void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, + uint16 param2); void process_null_system_pointer_pdu(STREAM s); void process_colour_pointer_pdu(STREAM s); void process_cached_pointer_pdu(STREAM s); void process_bitmap_updates(STREAM s); void process_palette(STREAM s); BOOL rdp_main_loop(void); -BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory); +BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, + char *directory); void rdp_disconnect(void); /* rdp5.c */ void rdp5_process(STREAM s, BOOL encryption); @@ -73,7 +78,8 @@ void rdp5_process(STREAM s, BOOL encryption); void rdpdr_send_connect(void); void rdpdr_send_name(void); void rdpdr_send_available(void); -void rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 *buffer, uint32 length); +void rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer, + uint32 length); BOOL rdpdr_init(void); /* rdpsnd.c */ STREAM rdpsnd_init_packet(uint16 type, uint16 size); @@ -85,17 +91,18 @@ BOOL rdpsnd_init(void); /* rdpsnd_oss.c */ BOOL wave_out_open(void); void wave_out_close(void); -BOOL wave_out_format_supported(WAVEFORMATEX *pwfx); -BOOL wave_out_set_format(WAVEFORMATEX *pwfx); +BOOL wave_out_format_supported(WAVEFORMATEX * pwfx); +BOOL wave_out_set_format(WAVEFORMATEX * pwfx); void wave_out_write(STREAM s, uint16 tick, uint8 index); void wave_out_play(void); void wave_out_volume(uint16 left, uint16 right); /* secure.c */ -void sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2, uint8 salt); -void sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2); -void buf_out_uint32(uint8 *buffer, uint32 value); -void sec_sign(uint8 *signature, int siglen, uint8 *session_key, int keylen, uint8 *data, int datalen); -void sec_decrypt(uint8 *data, int length); +void sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt); +void sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2); +void buf_out_uint32(uint8 * buffer, uint32 value); +void sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data, + int datalen); +void sec_decrypt(uint8 * data, int length); STREAM sec_init(uint32 flags, int maxlen); void sec_send_to_channel(STREAM s, uint32 flags, uint16 channel); void sec_send(STREAM s, uint32 flags); @@ -136,28 +143,34 @@ void ui_destroy_window(void); void xwin_toggle_fullscreen(void); int ui_select(int rdp_socket); void ui_move_pointer(int x, int y); -HBITMAP ui_create_bitmap(int width, int height, uint8 *data); -void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data); +HBITMAP ui_create_bitmap(int width, int height, uint8 * data); +void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data); void ui_destroy_bitmap(HBITMAP bmp); -HGLYPH ui_create_glyph(int width, int height, uint8 *data); +HGLYPH ui_create_glyph(int width, int height, uint8 * data); void ui_destroy_glyph(HGLYPH glyph); -HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 *andmask, uint8 *xormask); +HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * andmask, + uint8 * xormask); void ui_set_cursor(HCURSOR cursor); void ui_destroy_cursor(HCURSOR cursor); -HCOLOURMAP ui_create_colourmap(COLOURMAP *colours); +HCOLOURMAP ui_create_colourmap(COLOURMAP * colours); void ui_destroy_colourmap(HCOLOURMAP map); void ui_set_colourmap(HCOLOURMAP map); void ui_set_clip(int x, int y, int cx, int cy); void ui_reset_clip(void); void ui_bell(void); void ui_destblt(uint8 opcode, int x, int y, int cx, int cy); -void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour); +void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour, + int fgcolour); void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy); void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy); -void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour); -void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen); +void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, + BRUSH * brush, int bgcolour, int fgcolour); +void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen); void ui_rect(int x, int y, int cx, int cy, int colour); -void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour); -void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour, int fgcolour, uint8 *text, uint8 length); +void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, + int bgcolour, int fgcolour); +void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy, + int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour, + int fgcolour, uint8 * text, uint8 length); void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy); void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy); diff --git a/rdpsnd.c b/rdpsnd.c index 448ce38..547d90d 100644 --- a/rdpsnd.c +++ b/rdpsnd.c @@ -43,7 +43,7 @@ rdpsnd_init_packet(uint16 type, uint16 size) { STREAM s; - s = channel_init(rdpsnd_channel, size+4); + s = channel_init(rdpsnd_channel, size + 4); out_uint16_le(s, type); out_uint16_le(s, size); return s; @@ -54,18 +54,19 @@ rdpsnd_send(STREAM s) { #ifdef RDPSND_DEBUG printf("RDPSND send:\n"); - hexdump(s->channel_hdr+8, s->end-s->channel_hdr-8); + hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8); #endif channel_send(s, rdpsnd_channel); } -void rdpsnd_send_completion(uint16 tick, uint8 packet_index) +void +rdpsnd_send_completion(uint16 tick, uint8 packet_index) { STREAM s; s = rdpsnd_init_packet(RDPSND_COMPLETION, 4); - out_uint16_le(s, tick+50); + out_uint16_le(s, tick + 50); out_uint8(s, packet_index); out_uint8(s, 0); s_mark_end(s); @@ -93,7 +94,7 @@ rdpsnd_process_negotiate(STREAM in) } format_count = 0; - if (s_check_rem(in, 18*in_format_count)) + if (s_check_rem(in, 18 * in_format_count)) { for (i = 0; i < in_format_count; i++) { @@ -111,7 +112,8 @@ rdpsnd_process_negotiate(STREAM in) discardcnt = 0; if (format->cbSize > MAX_CBSIZE) { - fprintf(stderr, "cbSize too large for buffer: %d\n", format->cbSize); + fprintf(stderr, "cbSize too large for buffer: %d\n", + format->cbSize); readcnt = MAX_CBSIZE; discardcnt = format->cbSize - MAX_CBSIZE; } @@ -127,16 +129,16 @@ rdpsnd_process_negotiate(STREAM in) } } - out = rdpsnd_init_packet(RDPSND_NEGOTIATE | 0x200, 20 + 18*format_count); - out_uint32_le(out, 3); /* flags */ + out = rdpsnd_init_packet(RDPSND_NEGOTIATE | 0x200, 20 + 18 * format_count); + out_uint32_le(out, 3); /* flags */ out_uint32(out, 0xffffffff); /* volume */ - out_uint32(out, 0); /* pitch */ - out_uint16(out, 0); /* UDP port */ + out_uint32(out, 0); /* pitch */ + out_uint16(out, 0); /* UDP port */ out_uint16_le(out, format_count); - out_uint8(out, 0x95); /* pad? */ - out_uint16_le(out, 2); /* status */ - out_uint8(out, 0x77); /* pad? */ + out_uint8(out, 0x95); /* pad? */ + out_uint16_le(out, 2); /* status */ + out_uint8(out, 0x77); /* pad? */ for (i = 0; i < format_count; i++) { @@ -147,7 +149,7 @@ rdpsnd_process_negotiate(STREAM in) out_uint32_le(out, format->nAvgBytesPerSec); out_uint16_le(out, format->nBlockAlign); out_uint16_le(out, format->wBitsPerSample); - out_uint16(out, 0); /* cbSize */ + out_uint16(out, 0); /* cbSize */ } s_mark_end(out); @@ -183,7 +185,7 @@ rdpsnd_process(STREAM s) #ifdef RDPSND_DEBUG printf("RDPSND recv:\n"); - hexdump(s->p, s->end-s->p); + hexdump(s->p, s->end - s->p); #endif if (awaiting_data_packet) @@ -218,37 +220,37 @@ rdpsnd_process(STREAM s) } in_uint8(s, type); - in_uint8s(s, 1); /* unknown? */ + in_uint8s(s, 1); /* unknown? */ in_uint16_le(s, datalen); switch (type) { - case RDPSND_WRITE: - in_uint16_le(s, tick); - in_uint16_le(s, format); - in_uint8(s, packet_index); - awaiting_data_packet = True; - break; - case RDPSND_CLOSE: - wave_out_close(); - device_open = False; - break; - case RDPSND_NEGOTIATE: - rdpsnd_process_negotiate(s); - break; - case RDPSND_UNKNOWN6: - rdpsnd_process_unknown6(s); - break; - case RDPSND_SET_VOLUME: - in_uint32(s, volume); - if ( device_open ) - { - wave_out_volume((volume & 0xffff), (volume & 0xffff0000) >> 16); - } - break; - default: - unimpl("RDPSND packet type %d\n", type); - break; + case RDPSND_WRITE: + in_uint16_le(s, tick); + in_uint16_le(s, format); + in_uint8(s, packet_index); + awaiting_data_packet = True; + break; + case RDPSND_CLOSE: + wave_out_close(); + device_open = False; + break; + case RDPSND_NEGOTIATE: + rdpsnd_process_negotiate(s); + break; + case RDPSND_UNKNOWN6: + rdpsnd_process_unknown6(s); + break; + case RDPSND_SET_VOLUME: + in_uint32(s, volume); + if (device_open) + { + wave_out_volume((volume & 0xffff), (volume & 0xffff0000) >> 16); + } + break; + default: + unimpl("RDPSND packet type %d\n", type); + break; } } diff --git a/rdpsnd_oss.c b/rdpsnd_oss.c index 29968b3..077609f 100644 --- a/rdpsnd_oss.c +++ b/rdpsnd_oss.c @@ -31,7 +31,8 @@ int g_dsp_fd; BOOL g_dsp_busy; -static struct audio_packet { +static struct audio_packet +{ struct stream s; uint16 tick; uint8 index; @@ -43,14 +44,14 @@ wave_out_open(void) { char *dsp_dev = "/dev/dsp"; - if ((g_dsp_fd = open(dsp_dev, O_WRONLY|O_NONBLOCK)) == -1) + if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) { perror(dsp_dev); return False; } /* Non-blocking so that user interface is responsive */ - fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL)|O_NONBLOCK); + fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL) | O_NONBLOCK); return True; } @@ -61,7 +62,7 @@ wave_out_close(void) } BOOL -wave_out_format_supported(WAVEFORMATEX *pwfx) +wave_out_format_supported(WAVEFORMATEX * pwfx) { if (pwfx->wFormatTag != WAVE_FORMAT_PCM) return False; @@ -74,7 +75,7 @@ wave_out_format_supported(WAVEFORMATEX *pwfx) } BOOL -wave_out_set_format(WAVEFORMATEX *pwfx) +wave_out_set_format(WAVEFORMATEX * pwfx) { int speed, channels, format; @@ -117,8 +118,8 @@ wave_out_volume(uint16 left, uint16 right) { uint32 volume; - volume = left/(65536/100); - volume |= right/(65536/100) << 8; + volume = left / (65536 / 100); + volume |= right / (65536 / 100) << 8; if (ioctl(g_dsp_fd, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1) { perror("MIXER_WRITE(SOUND_MIXER_PCM)"); @@ -170,7 +171,7 @@ wave_out_play(void) packet = &packet_queue[queue_lo]; out = &packet->s; - len = write(g_dsp_fd, out->p, out->end-out->p); + len = write(g_dsp_fd, out->p, out->end - out->p); if (len == -1) { if (errno != EWOULDBLOCK) diff --git a/rdpsnd_sun.c b/rdpsnd_sun.c index bde8a9c..766c7c2 100644 --- a/rdpsnd_sun.c +++ b/rdpsnd_sun.c @@ -36,7 +36,8 @@ static BOOL reopened; static BOOL swapaudio; static short samplewidth; -static struct audio_packet { +static struct audio_packet +{ struct stream s; uint16 tick; uint8 index; @@ -48,23 +49,23 @@ wave_out_open(void) { char *dsp_dev = getenv("AUDIODEV"); - if ( dsp_dev == NULL ) + if (dsp_dev == NULL) { - dsp_dev="/dev/audio"; + dsp_dev = "/dev/audio"; } - if ((g_dsp_fd = open(dsp_dev, O_WRONLY|O_NONBLOCK)) == -1) + if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) { perror(dsp_dev); return False; } /* Non-blocking so that user interface is responsive */ - fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL)|O_NONBLOCK); - + fcntl(g_dsp_fd, F_SETFL, fcntl(g_dsp_fd, F_GETFL) | O_NONBLOCK); + queue_lo = queue_hi = 0; reopened = True; - + return True; } @@ -72,7 +73,7 @@ void wave_out_close(void) { /* Ack all remaining packets */ - while ( queue_lo != queue_hi ) + while (queue_lo != queue_hi) { rdpsnd_send_completion(packet_queue[queue_lo].tick, packet_queue[queue_lo].index); free(packet_queue[queue_lo].s.data); @@ -80,12 +81,12 @@ wave_out_close(void) } /* Flush the audiobuffer */ - ioctl(g_dsp_fd,I_FLUSH,FLUSHW); + ioctl(g_dsp_fd, I_FLUSH, FLUSHW); close(g_dsp_fd); } BOOL -wave_out_format_supported(WAVEFORMATEX *pwfx) +wave_out_format_supported(WAVEFORMATEX * pwfx) { if (pwfx->wFormatTag != WAVE_FORMAT_PCM) return False; @@ -98,7 +99,7 @@ wave_out_format_supported(WAVEFORMATEX *pwfx) } BOOL -wave_out_set_format(WAVEFORMATEX *pwfx) +wave_out_set_format(WAVEFORMATEX * pwfx) { audio_info_t info; int test = 1; @@ -119,13 +120,13 @@ wave_out_set_format(WAVEFORMATEX *pwfx) swapaudio = !(*(uint8 *) (&test)); } - samplewidth = pwfx->wBitsPerSample/8; + samplewidth = pwfx->wBitsPerSample / 8; - if (pwfx->nChannels == 1 ) - { + if (pwfx->nChannels == 1) + { info.play.channels = AUDIO_CHANNELS_MONO; } - else if (pwfx->nChannels == 2 ) + else if (pwfx->nChannels == 2) { info.play.channels = AUDIO_CHANNELS_STEREO; samplewidth *= 2; @@ -163,16 +164,18 @@ wave_out_volume(uint16 left, uint16 right) volume = (left > right) ? left : right; - if ( volume/AUDIO_MID_BALANCE != 0 ) + if (volume / AUDIO_MID_BALANCE != 0) { - balance = AUDIO_MID_BALANCE - (left/(volume/AUDIO_MID_BALANCE)) + (right/(volume/AUDIO_MID_BALANCE)); + balance = + AUDIO_MID_BALANCE - (left / (volume / AUDIO_MID_BALANCE)) + + (right / (volume / AUDIO_MID_BALANCE)); } else { balance = AUDIO_MID_BALANCE; } - info.play.gain = volume/(65536/AUDIO_MAX_GAIN); + info.play.gain = volume / (65536 / AUDIO_MAX_GAIN); info.play.balance = balance; if (ioctl(g_dsp_fd, AUDIO_SETINFO, &info) == -1) @@ -193,7 +196,7 @@ wave_out_write(STREAM s, uint16 tick, uint8 index) error("No space to queue audio packet\n"); return; } - + queue_hi = next_hi; packet->s = *s; @@ -224,7 +227,7 @@ wave_out_play(void) while (1) { - if ( reopened ) + if (reopened) { /* Device was just (re)openend */ samplecnt = 0; @@ -243,9 +246,9 @@ wave_out_play(void) out = &packet->s; /* Swap the current packet, but only once */ - if ( swapaudio && ! swapped ) + if (swapaudio && !swapped) { - for ( i = 0; i < out->end - out->p; i += 2 ) + for (i = 0; i < out->end - out->p; i += 2) { swap = *(out->p + i); *(out->p + i) = *(out->p + i + 1); @@ -254,15 +257,15 @@ wave_out_play(void) swapped = True; } - if ( sentcompletion ) + if (sentcompletion) { sentcompletion = False; - numsamples = (out->end - out->p)/samplewidth; + numsamples = (out->end - out->p) / samplewidth; } - len=0; + len = 0; - if ( out->end != out->p ) + if (out->end != out->p) { len = write(g_dsp_fd, out->p, out->end - out->p); if (len == -1) @@ -284,7 +287,7 @@ wave_out_play(void) } /* Ack the packet, if we have played at least 70% */ - if ( info.play.samples >= samplecnt+((numsamples*7)/10) ) + if (info.play.samples >= samplecnt + ((numsamples * 7) / 10)) { samplecnt += numsamples; rdpsnd_send_completion(packet->tick, packet->index); diff --git a/types.h b/types.h index 04e8120..ac038e3 100644 --- a/types.h +++ b/types.h @@ -122,15 +122,16 @@ VCHANNEL; #define MAX_CBSIZE 256 /* RDPSND */ -typedef struct { - uint16 wFormatTag; - uint16 nChannels; - uint32 nSamplesPerSec; - uint32 nAvgBytesPerSec; - uint16 nBlockAlign; - uint16 wBitsPerSample; - uint16 cbSize; - uint8 cb[MAX_CBSIZE]; +typedef struct +{ + uint16 wFormatTag; + uint16 nChannels; + uint32 nSamplesPerSec; + uint32 nAvgBytesPerSec; + uint16 nBlockAlign; + uint16 wBitsPerSample; + uint16 cbSize; + uint8 cb[MAX_CBSIZE]; } WAVEFORMATEX; /* RDPDR */ diff --git a/xwin.c b/xwin.c index 034d1b7..c6d87e6 100644 --- a/xwin.c +++ b/xwin.c @@ -333,8 +333,7 @@ translate15to16(uint16 * data, uint8 * out, uint8 * end) if (g_host_be) { - BSWAP16(pixel) - } + BSWAP16(pixel)} value = make_colour16(split_colour15(pixel)); @@ -363,8 +362,7 @@ translate15to24(uint16 * data, uint8 * out, uint8 * end) if (g_host_be) { - BSWAP16(pixel) - } + BSWAP16(pixel)} value = make_colour24(split_colour15(pixel)); if (g_xserver_be) @@ -457,8 +455,7 @@ translate16to24(uint16 * data, uint8 * out, uint8 * end) if (g_host_be) { - BSWAP16(pixel) - } + BSWAP16(pixel)} value = make_colour24(split_colour16(pixel)); @@ -489,8 +486,7 @@ translate16to32(uint16 * data, uint8 * out, uint8 * end) if (g_host_be) { - BSWAP16(pixel) - } + BSWAP16(pixel)} value = make_colour32(split_colour16(pixel)); @@ -500,15 +496,15 @@ translate16to32(uint16 * data, uint8 * out, uint8 * end) *(out++) = value >> 16; *(out++) = value >> 8; *(out++) = value; - } - else - { + } + else + { *(out++) = value; *(out++) = value >> 8; *(out++) = value >> 16; *(out++) = value >> 24; - } - } + } + } } static void @@ -1203,7 +1199,7 @@ ui_select(int rdp_socket) { FD_SET(g_dsp_fd, &wfds); n = (g_dsp_fd + 1 > n) ? g_dsp_fd + 1 : n; - } + } #endif switch (select(n, &rfds, &wfds, NULL, NULL))