CVS: rdesktop xwin.c,1.171,1.172
Jay Sorg <[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-serv936
Modified Files:
xwin.c
Log Message:
clean up and comment the repeat macros
Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -C2 -d -r1.171 -r1.172
*** xwin.c 4 Jun 2004 15:01:36 -0000 1.171
--- xwin.c 11 Jun 2004 22:37:05 -0000 1.172
***************
*** 231,236 ****
}
#define UNROLL8(stm) { stm stm stm stm stm stm stm stm }
! #define REPEAT(stm) \
{ \
while (out <= end - 8 * 4) \
--- 231,253 ----
}
+ /* indent is confused by UNROLL8 */
+ /* *INDENT-OFF* */
+
+ /* repeat and unroll, similar to bitmap.c */
+ /* potentialy any of the following translate */
+ /* functions can use repeat but just doing */
+ /* the most common ones */
+
#define UNROLL8(stm) { stm stm stm stm stm stm stm stm }
! /* 2 byte output repeat */
! #define REPEAT2(stm) \
! { \
! while (out <= end - 8 * 2) \
! UNROLL8(stm) \
! while (out < end) \
! { stm } \
! }
! /* 4 byte output repeat */
! #define REPEAT4(stm) \
{ \
while (out <= end - 8 * 4) \
***************
*** 253,277 ****
if (g_arch_match)
- REPEAT(*((uint16 *) out) = g_colmap[*(data++)];
- out += 2;)
- else
- if (g_xserver_be)
- {
- while (out < end)
{
! value = (uint16) g_colmap[*(data++)];
! *(out++) = value >> 8;
! *(out++) = value;
}
! }
! else
! {
! while (out < end)
{
! value = (uint16) g_colmap[*(data++)];
! *(out++) = value;
! *(out++) = value >> 8;
}
- }
}
--- 270,298 ----
if (g_arch_match)
{
! REPEAT2
! (
! *((uint16 *) out) = g_colmap[*(data++)];
! out += 2;
! )
}
! else if (g_xserver_be)
{
! while (out < end)
! {
! value = (uint16) g_colmap[*(data++)];
! *(out++) = value >> 8;
! *(out++) = value;
! }
! }
! else
! {
! while (out < end)
! {
! value = (uint16) g_colmap[*(data++)];
! *(out++) = value;
! *(out++) = value >> 8;
! }
}
}
***************
*** 310,339 ****
if (g_arch_match)
- REPEAT(*((uint32 *) out) = g_colmap[*(data++)];
- out += 4;)
- else
- if (g_xserver_be)
- {
- while (out < end)
{
! value = g_colmap[*(data++)];
! *(out++) = value >> 24;
! *(out++) = value >> 16;
! *(out++) = value >> 8;
! *(out++) = value;
}
! }
! else
! {
! while (out < end)
{
! value = g_colmap[*(data++)];
! *(out++) = value;
! *(out++) = value >> 8;
! *(out++) = value >> 16;
! *(out++) = value >> 24;
}
}
! }
static void
--- 331,366 ----
if (g_arch_match)
{
! REPEAT4
! (
! *((uint32 *) out) = g_colmap[*(data++)];
! out += 4;
! )
}
! else if (g_xserver_be)
{
! while (out < end)
! {
! value = g_colmap[*(data++)];
! *(out++) = value >> 24;
! *(out++) = value >> 16;
! *(out++) = value >> 8;
! *(out++) = value;
! }
! }
! else
! {
! while (out < end)
! {
! value = g_colmap[*(data++)];
! *(out++) = value;
! *(out++) = value >> 8;
! *(out++) = value >> 16;
! *(out++) = value >> 24;
! }
}
}
!
! /* *INDENT-ON* */
static void
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504