shithub: rd

Download patch

ref: e03dacec1212ac8c9aa89fe199c314ebbbdd41ca
parent: 0cf43c33919bfded0879410d49c6181e38142e50
author: Yaroslav Kolomiiets <yarikos@gmail.com>
date: Tue Sep 5 11:58:13 EDT 2017

drop MIN macro

--- a/dat.h
+++ b/dat.h
@@ -5,8 +5,6 @@
 typedef	struct	Caps Caps;
 typedef	struct	Imgupd Imgupd;
 
-#define	MIN(x,y)		(((x) < (y)) ? (x) : (y))
-
 enum
 {
 	MAXTPDU=	16386,	/* max TPDU size */
--- a/mcs.c
+++ b/mcs.c
@@ -299,6 +299,8 @@
 	earlyCapabilityFlags = CanErrinfo;
 	if(depth == 32)
 		earlyCapabilityFlags |= Want32bpp;
+	if(depth > 24)
+		depth = 24;
 
 	memcpy(p, t124IdentifierKeyOid, 7);
 
@@ -333,7 +335,7 @@
 	iputs(p+132, 0xCA01);	// postBeta2ColorDepth=8bpp, ignored
 	iputs(p+134, 1);	// clientProductId
 	iputl(p+136, 0);	// serialNumber
-	iputs(p+140, MIN(depth, 24));	// highColorDepth: 4, 8, 15, 16, 24 bpp.
+	iputs(p+140, depth);	// highColorDepth: 4, 8, 15, 16, 24 bpp.
 	iputs(p+142, 1+2+4+8);	// supportedColorDepths: 1=24, 2=16, 4=15, 8=32 bpp
 	iputs(p+144, earlyCapabilityFlags);	// earlyCapabilityFlags 
 	memset(p+146, 64, 0);	// clientDigProductId[64]