X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=handy.h;h=fe29019b438fd968b17df8aded7a5289831f2cf8;hb=b31b80f9d91ded188b47dd78c18a0a1effe2584d;hp=9a06b77e2612844efb25c9b7393e177dd323506a;hpb=0e983133b1c8b37e15a466d55b4d79492d02e7da;p=p5sagit%2Fp5-mst-13.2.git diff --git a/handy.h b/handy.h index 9a06b77..fe29019 100644 --- a/handy.h +++ b/handy.h @@ -460,7 +460,10 @@ Converts the specified character to lowercase. #define isBLANK_LC_uni(c) isBLANK(c) /* could be wrong */ #define isALNUM_utf8(p) is_utf8_alnum(p) -#define isIDFIRST_utf8(p) is_utf8_idfirst(p) +/* The ID_Start of Unicode is quite limiting: it assumes a L-class + * character (meaning that you cannot have, say, a CJK character). + * Instead, let's allow ID_Continue but not digits. */ +#define isIDFIRST_utf8(p) (is_utf8_idcont(p) && !is_utf8_digit(p)) #define isALPHA_utf8(p) is_utf8_alpha(p) #define isSPACE_utf8(p) is_utf8_space(p) #define isDIGIT_utf8(p) is_utf8_digit(p) @@ -575,8 +578,12 @@ destination, C is the number of items, and C is the type. =for apidoc Am|void|StructCopy|type src|type dest|type This is an architecture-independent macro to copy one structure to another. -=cut -*/ +=for apidoc Am|void|Poison|void* dest|int nitems|type + +Fill up memory with a pattern (byte 0xAB over and over again) that +hopefully catches attempts to access uninitialized memory. + +=cut */ #ifndef lint @@ -620,6 +627,8 @@ extern long lastxycount[MAXXCOUNT][MAXYCOUNT]; #define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) #define Zero(d,n,t) (void)memzero((char*)(d), (n) * sizeof(t)) +#define Poison(d,n,t) (void)memset((char*)(d), 0xAB, (n) * sizeof(t)) + #else /* lint */ #define New(x,v,n,s) (v = Null(s *)) @@ -629,6 +638,7 @@ extern long lastxycount[MAXXCOUNT][MAXYCOUNT]; #define Move(s,d,n,t) #define Copy(s,d,n,t) #define Zero(d,n,t) +#define Poison(d,n,t) #define Safefree(d) (d) = (d) #endif /* lint */