CVS: rdesktop xwin.c,1.203,1.204

Peter Åstrand <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16625

Modified Files:
	xwin.c 
Log Message:
Applied rdesktop-visual-host-be-fix.patch from #1390148, which fixes a problem when rdesktop is run on a machine with different byte order than the Xserver.

Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -C2 -d -r1.203 -r1.204
*** xwin.c	24 Jan 2006 12:40:24 -0000	1.203
--- xwin.c	1 Mar 2006 13:54:19 -0000	1.204
***************
*** 72,81 ****
  static BOOL g_focused;
  static BOOL g_mouse_in_wnd;
! /* Indicates the visual is has 15, 16 or 24 depth
!    and the same color channel masks as its RDP equivalent. */
! static BOOL g_compatible_depth;
  /* Indicates whether RDP's bitmaps and our XImages have the same
     binary format. If so, we can avoid an expensive translation.
!    If this is True, so is g_compatible_depth. */
  static BOOL g_no_translate_image = False;
  
--- 72,92 ----
  static BOOL g_focused;
  static BOOL g_mouse_in_wnd;
! /* Indicates that:
!    1) visual has 15, 16 or 24 depth and the same color channel masks
!       as its RDP equivalent (implies X server is LE),
!    2) host is LE
!    This will trigger an optimization whose real value is questionable.
! */
! static BOOL g_compatible_arch;
  /* Indicates whether RDP's bitmaps and our XImages have the same
     binary format. If so, we can avoid an expensive translation.
!    Note that this can be true when g_compatible_arch is false,
!    e.g.:
!    
!      RDP(LE) <-> host(BE) <-> X-Server(LE)
!      
!    ('host' is the machine running rdesktop; the host simply memcpy's
!     so its endianess doesn't matter)
!  */
  static BOOL g_no_translate_image = False;
  
***************
*** 244,247 ****
--- 255,261 ----
  			x = (x << 16) | (x >> 16); }
  
+ /* The following macros output the same octet sequences
+    on both BE and LE hosts: */
+ 
  #define BOUT16(o, x) { *(o++) = x >> 8; *(o++) = x; }
  #define BOUT24(o, x) { *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }
***************
*** 323,327 ****
  	uint16 value;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 337,341 ----
  	uint16 value;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 357,361 ****
  	uint32 value;
  
! 	if (g_compatible_depth)
  	{
  		while (out < end)
--- 371,375 ----
  	uint32 value;
  
! 	if (g_compatible_arch)
  	{
  		while (out < end)
***************
*** 380,384 ****
  	uint32 value;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 394,398 ----
  	uint32 value;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 452,456 ****
  	PixelColour pc;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 466,470 ----
  	PixelColour pc;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 502,506 ****
  	PixelColour pc;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 516,520 ----
  	PixelColour pc;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 610,614 ****
  	PixelColour pc;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 624,628 ----
  	PixelColour pc;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 680,684 ****
  	PixelColour pc;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 694,698 ----
  	PixelColour pc;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 809,813 ****
  	PixelColour pc;
  
! 	if (g_compatible_depth)
  	{
  		/* *INDENT-OFF* */
--- 823,827 ----
  	PixelColour pc;
  
! 	if (g_compatible_arch)
  	{
  		/* *INDENT-OFF* */
***************
*** 1022,1026 ****
  	g_visual = NULL;
  	g_no_translate_image = False;
! 	g_compatible_depth = False;
  	if (vmatches != NULL)
  	{
--- 1036,1040 ----
  	g_visual = NULL;
  	g_no_translate_image = False;
! 	g_compatible_arch = False;
  	if (vmatches != NULL)
  	{
***************
*** 1049,1053 ****
  				g_visual = visual_info->visual;
  				g_depth = visual_info->depth;
! 				g_compatible_depth = True;
  				g_no_translate_image = (visual_info->depth == g_server_depth);
  				if (g_no_translate_image)
--- 1063,1067 ----
  				g_visual = visual_info->visual;
  				g_depth = visual_info->depth;
! 				g_compatible_arch = !g_host_be;
  				g_no_translate_image = (visual_info->depth == g_server_depth);
  				if (g_no_translate_image)
***************
*** 1057,1061 ****
  			else
  			{
! 				g_compatible_depth = False;
  			}
  
--- 1071,1075 ----
  			else
  			{
! 				g_compatible_arch = False;
  			}
  



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.