charset: code constants in hexadecimal where appropriate
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 21 Apr 2017 22:12:59 +0000 (00:12 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:10:24 +0000 (22:10 +0200)
charset.plp

index b84816ae6d96f4f8db4b9e50f24979d00791cb3b..7e115a87581dee89111a7fc7bd5ae61f244eae37 100644 (file)
@@ -223,7 +223,7 @@ sub tabinput {
                elsif (defined $visible->{ascii}) {
                        $row{parent} = $parents[0];
                        $params = $parents[1] // 80;
-                       $params = 80 if hex $params >= 128;  # ascii offset at most
+                       $params = 80 if hex $params >= 0x80;  # ascii offset at most
                }
                elsif (@parents) {
                        $row{parent} = $parents[0];
@@ -281,14 +281,14 @@ sub tabinput {
        elsif (lc $input eq 'uu') {
                $row{cell} = do 'charset-ucplanes.inc.pl'
                        or Alert('Table data could not be read', $@ || $!);
-               $row{endpoint} ||= 1023;
+               $row{endpoint} ||= 0x3FF;
                $row{set} = 'Unicode planes';
        }
        elsif (lc $input eq 'u') {
                $row{cell} = do 'charset-unicode.inc.pl'
                        or Alert('Table data could not be read', $@ || $!);
 
-               $row{endpoint} ||= 8191;
+               $row{endpoint} ||= 0x1FFF;
                $row{set} = 'Unicode ' . (
                        $row{startpoint} <  0x1000 && $row{endpoint} < 0x1000 ? 'BMP' :
                        $row{startpoint} >= 0x1000 && $row{endpoint} < 0x2000 ? 'SMP' :
@@ -299,11 +299,11 @@ sub tabinput {
                $row{set} = 'UTF-8';
                $row{cell} = do 'charset-utf8.inc.pl'
                        or Alert('Table data could not be read', $@ || $!);
-               $row{endpoint} = 255;
+               $row{endpoint} = 0xFF;
        }
        elsif ($row{set} = Encode::resolve_alias($input)) {
                $row{offset} = delete $row{startpoint};
-               $row{endpoint} ||= 255;
+               $row{endpoint} ||= 0xFF;
                if ($row{set} eq 'MacHebrew' or $row{set} eq 'MacThai') {
                        # array of possibly multiple characters per code point
                        $row{table} = [