X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utf8.h;h=659319e82d68f91f9ad2eecb32f1687e6878e21d;hb=eb1c4873a4d2b3d386b680baf0b251a75d67e654;hp=f9f1bec462484278303ddaff41a54cdfac992bbf;hpb=b3ab6785f6871a84567168e1bd0426ff2f66d282;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utf8.h b/utf8.h index f9f1bec..659319e 100644 --- a/utf8.h +++ b/utf8.h @@ -1,6 +1,6 @@ /* utf8.h * - * Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007, by Larry Wall and others + * Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007, 2009 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -118,8 +118,8 @@ encoded character. #define UTF8_IS_CONTINUED(c) (((U8)c) & 0x80) #define UTF8_IS_DOWNGRADEABLE_START(c) (((U8)c & 0xfc) == 0xc0) -#define UTF_START_MARK(len) ((len > 7) ? 0xFF : (0xFE << (7-len))) -#define UTF_START_MASK(len) ((len >= 7) ? 0x00 : (0x1F >> (len-2))) +#define UTF_START_MARK(len) (((len) > 7) ? 0xFF : (0xFE << (7-(len)))) +#define UTF_START_MASK(len) (((len) >= 7) ? 0x00 : (0x1F >> ((len)-2))) #define UTF_CONTINUATION_MARK 0x80 #define UTF_ACCUMULATION_SHIFT 6