shithub: mc

Download patch

ref: 85e637db4543ca443a88bd7d0a1f1efe50a2aecb
parent: ce1d62e095493346ea500219a9c11a97562275bb
author: Ori Bernstein <[email protected]>
date: Fri Jul 27 11:05:04 EDT 2012

Remove unused constants.

--- a/str.myr
+++ b/str.myr
@@ -6,16 +6,8 @@
 	const Badchar	: char = -1 castto(char)
 
 	const nextc	: (str : byte[,] -> [char, byte[,]])
-	const chrlen	: (chr : char -> size)
 ;;
 
-/* utf8 conversion constants */
-const Utfx = 0xe0	/* mask for "rest" chars */
-const Utf1 = 0x80	/* mask for length 1 char */
-const Utf2 = 0xe0	/* mask for length 1 char */
-const Utf3 = 0xf0	/* mask for length 1 char */
-const Utf4 = 0xf8	/* mask for length 1 char */
-
 const nextc = {str
 	var len : size
 	var mask
@@ -25,13 +17,13 @@
 	var tmp
 
 	c = str[0]
-	if c & 0x80 == 0
+	if c & 0x80 == 0 /* ascii range */
 		len = 1
-	elif c & 0xe0 == 0xc0
+	elif c & 0xe0 == 0xc0 /* 0b110x_xxxx */
 		len = 2
-	elif c & 0xf0 == 0xe0
+	elif c & 0xf0 == 0xe0 /* 0b1110_xxxx */
 		len = 3
-	elif c & 0xf8 == 0xf0
+	elif c & 0xf8 == 0xf0 /* 0b1111_0xxx */
 		len = 4
 	else
 		/* skip one char forward so we can try