CVS: rdesktop bitmap.c,1.21,1.22

Michael Gernoth <[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-serv5150

Modified Files:
	bitmap.c 
Log Message:
Speedup fixes on all architectures from Jay


Index: bitmap.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/bitmap.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** bitmap.c	27 Apr 2004 09:04:42 -0000	1.21
--- bitmap.c	7 May 2004 04:57:39 -0000	1.22
***************
*** 32,36 ****
  
  #define CVAL(p)   (*(p++))
! #define CVAL2(p)   (*(((uint16*)p)++)) /* for 16 bit */
  
  #define UNROLL8(exp) { exp exp exp exp exp exp exp exp }
--- 32,44 ----
  
  #define CVAL(p)   (*(p++))
! #ifdef NEED_ALIGN
! #ifdef L_ENDIAN
! #define CVAL2(p, v) { v = (*(p++)); v |= (*(p++)) << 8; }
! #else
! #define CVAL2(p, v) { v = (*(p++)) << 8; v |= (*(p++)); }
! #endif /* L_ENDIAN */
! #else
! #define CVAL2(p, v) v = (*(((uint16*)p)++));
! #endif /* NEED_ALIGN */
  
  #define UNROLL8(exp) { exp exp exp exp exp exp exp exp }
***************
*** 331,353 ****
  				break;
  			case 8:	/* Bicolour */
! #ifdef NEED_ALIGNMENT
! 				memcpy(&colour1,&CVAL2(input),2);
! #else
! 				colour1 = CVAL2(input);
! #endif
  			case 3:	/* Colour */
! #ifdef NEED_ALIGNMENT
! 				memcpy(&colour2,&CVAL2(input),2);
! #else
! 				colour2 = CVAL2(input);
! #endif
  				break;
  			case 6:	/* SetMix/Mix */
  			case 7:	/* SetMix/FillOrMix */
! #ifdef NEED_ALIGNMENT
! 				memcpy(&mix,&CVAL2(input),2);
! #else
! 				mix = CVAL2(input);
! #endif
  				opcode -= 5;
  				break;
--- 339,349 ----
  				break;
  			case 8:	/* Bicolour */
! 				CVAL2(input, colour1);
  			case 3:	/* Colour */
! 				CVAL2(input, colour2);
  				break;
  			case 6:	/* SetMix/Mix */
  			case 7:	/* SetMix/FillOrMix */
! 				CVAL2(input, mix);
  				opcode -= 5;
  				break;
***************
*** 437,445 ****
  					break;
  				case 4:	/* Copy */
! #ifdef NEED_ALIGNMENT
! 					REPEAT(memcpy(&line[x],&CVAL2(input),2))
! #else
! 					REPEAT(line[x] = CVAL2(input))
! #endif
  					break;
  				case 8:	/* Bicolour */
--- 433,437 ----
  					break;
  				case 4:	/* Copy */
! 					REPEAT(CVAL2(input, line[x]))
  					break;
  				case 8:	/* Bicolour */



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
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.