diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-11-30 05:31:00 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1996-11-30 05:31:00 +1200 |
commit | ff68c7194e176ca1907544a3a65684b76834d0fe (patch) | |
tree | 4124d603a6b2a937f4ce1d9469426f84421f93e0 /handy.h | |
parent | eff9c6e2f5bda63e4dc69fc15e237a9843954369 (diff) | |
download | perl-ff68c7194e176ca1907544a3a65684b76834d0fe.tar.gz |
[inseparable changes from patch from perl5.003_09 to perl5.003_10]
CORE LANGUAGE CHANGES
Subject: Allow &{sub {...}} without warning
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
Subject: Make parens optional on [gs]ethost and [gs]et{pw,gr} function
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
Subject: Fix syntax error with "$x [0]" and "$x {y}" and "@x {y}"
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
DOCUMENTATION
Subject: Improve documentation for sysread() and syswrite()
From: Chip Salzenberg <chip@atlantic.net>
Files: pod/perlfunc.pod
Subject: Document how to use $SIG{ALRM} and alarm()
Date: Tue, 26 Nov 1996 11:42:49 -0500
From: Roderick Schertler <roderick@ibcinc.com>
Files: pod/perlfunc.pod
Msg-ID: <5898.849026569@eeyore.ibcinc.com>
(applied based on p5p patch as commit 5fa5e7dfc2abaaadd377c97cd1ebe78ea844da88)
OTHER CORE CHANGES
Subject: Hash key memory corruption fix and naming cleanup
From: Chip Salzenberg <chip@atlantic.net>
Files: hv.c hv.h perl.h
Subject: Undo broken perf. patch (PADTMP stealing)
From: Chip Salzenberg <chip@atlantic.net>
Files: sv.c
Subject: Make SV unstudied in sv_gets()
From: Chip Salzenberg <chip@atlantic.net>
Files: sv.c
Subject: Better support for UVs
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: global.sym old_global.sym perl.h pp.c pp.h proto.h sv.c sv.h
Subject: Minor locale cleanups
From: Chip Salzenberg <chip@atlantic.net>
Files: t/lib/posix.t util.c
Accept "POSIX" locale as standard like "C". Reset locale to
'C' when testing strtod() in t/lib/posix.t.
Subject: Always taint result of sprintf() on float
From: Chip Salzenberg <chip@atlantic.net>
Files: doop.c
Subject: Fix spurious warning from bitwise string ops
From: Chip Salzenberg <chip@atlantic.net>
Files: doop.c
Subject: Eliminate warning on {,sys}read(,$newvar,)
From: Chip Salzenberg <chip@atlantic.net>
Files: doop.c pp_sys.c
Subject: Namespace cleanup
From: Chip Salzenberg <chip@atlantic.net>
Files: global.sym old_global.sym perl.h
Subject: Modify perl_exp.SH; create old_perl_exp.SH; document old_*
From: Chip Salzenberg <chip@atlantic.net>
Files: Configure INSTALL MANIFEST old_perl_exp.SH perl_exp.SH
PORTABILITY
Subject: Reliable signal patch
Date: Tue, 26 Nov 1996 05:40:50 -0500 (EST)
From: Kenneth Albanowski <kjahds@kjahds.com>
Files: global.sym mg.c old_global.sym perl.h pp_sys.c proto.h util.c
Msg-ID: <Pine.LNX.3.93.961126053209.294J-100000@kjahds.com>
(applied based on p5p patch as commit 679728958e74b0ccd6d61567d84851f1ef994e1f)
Subject: Emulate missing flock() with either fcntl() or lockf()
From: Chip Salzenberg <chip@atlantic.net>
Files: pp_sys.c
Subject: 3_09: minor patches for OS/2
Date: Wed, 27 Nov 1996 03:30:05 -0500 (EST)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: doio.c global.sym malloc.c old_global.sym os2/Makefile.SHs os2/OS2/ExtAttr/Makefile.PL os2/OS2/PrfDB/Makefile.PL os2/OS2/Process/Makefile.PL os2/OS2/REXX/Makefile.PL os2/os2.c os2/os2ish.h perl.h
Subject: 3_09: minor patches
This patches mostly enable commpilation under OS/2, and fix malloc.c.
Enjoy,
p5p-msgid: <199611270830.DAA04985@monk.mps.ohio-state.edu>
Subject: Re: 5.003_09 and QNX
Date: Wed, 27 Nov 96 13:36:06 est
From: Norton Allen <nort@bottesini.harvard.edu>
Files: Configure MANIFEST README.qnx hints/qnx.sh qnx/ar qnx/cpp t/TEST toke.c util.c x2p/proto.h
Msg-ID: <9611271836.AA14460@bottesini.harvard.edu>
(applied based on p5p patch as commit c5117498be098729dc2af28089bd130c88c8d42b)
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 85 |
1 files changed, 46 insertions, 39 deletions
@@ -113,7 +113,7 @@ typedef unsigned short U16; # define U32_MIN PERL_ULONG_MIN #endif -#define Ctl(ch) (ch & 037) +#define Ctl(ch) ((ch) & 037) #define strNE(s1,s2) (strcmp(s1,s2)) #define strEQ(s1,s2) (!strcmp(s1,s2)) @@ -158,24 +158,26 @@ typedef unsigned short U16; #ifdef USE_NEXT_CTYPE # define isALNUM_LC(c) \ - (NXIsAlpha((unsigned int)c) || NXIsDigit((unsigned int)c) || c == '_') -# define isIDFIRST_LC(c) (NXIsAlpha((unsigned int)c) || c == '_') -# define isALPHA_LC(c) NXIsAlpha((unsigned int)c) -# define isSPACE_LC(c) NXIsSpace((unsigned int)c) -# define isDIGIT_LC(c) NXIsDigit((unsigned int)c) -# define isUPPER_LC(c) NXIsUpper((unsigned int)c) -# define isLOWER_LC(c) NXIsLower((unsigned int)c) -# define isPRINT_LC(c) NXIsPrint((unsigned int)c) -# define toUPPER_LC(c) NXToUpper((unsigned int)c) -# define toLOWER_LC(c) NXToLower((unsigned int)c) + (NXIsAlpha((unsigned int)(c)) || NXIsDigit((unsigned int)(c)) || \ + (char)(c) == '_') +# define isIDFIRST_LC(c) \ + (NXIsAlpha((unsigned int)(c)) || (char)(c) == '_') +# define isALPHA_LC(c) NXIsAlpha((unsigned int)(c)) +# define isSPACE_LC(c) NXIsSpace((unsigned int)(c)) +# define isDIGIT_LC(c) NXIsDigit((unsigned int)(c)) +# define isUPPER_LC(c) NXIsUpper((unsigned int)(c)) +# define isLOWER_LC(c) NXIsLower((unsigned int)(c)) +# define isPRINT_LC(c) NXIsPrint((unsigned int)(c)) +# define toUPPER_LC(c) NXToUpper((unsigned int)(c)) +# define toLOWER_LC(c) NXToLower((unsigned int)(c)) #else /* !USE_NEXT_CTYPE */ # if defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII)) # define isALNUM_LC(c) \ (isalpha((unsigned char)(c)) || \ - isdigit((unsigned char)(c)) || c == '_') -# define isIDFIRST_LC(c) (isalpha((unsigned char)(c)) || (c) == '_') + isdigit((unsigned char)(c)) || (char)(c) == '_') +# define isIDFIRST_LC(c) (isalpha((unsigned char)(c)) || (char)(c) == '_') # define isALPHA_LC(c) isalpha((unsigned char)(c)) # define isSPACE_LC(c) isspace((unsigned char)(c)) # define isDIGIT_LC(c) isdigit((unsigned char)(c)) @@ -188,7 +190,7 @@ typedef unsigned short U16; # else # define isALNUM_LC(c) \ - (isascii(c) && (isalpha(c) || isdigit(c) || c == '_')) + (isascii(c) && (isalpha(c) || isdigit(c) || (c) == '_')) # define isIDFIRST_LC(c) (isascii(c) && (isalpha(c) || (c) == '_')) # define isALPHA_LC(c) (isascii(c) && isalpha(c)) # define isSPACE_LC(c) (isascii(c) && isspace(c)) @@ -226,50 +228,55 @@ typedef U16 line_t; #ifndef lint #ifndef LEAKTEST -#define New(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))) -#define Newc(x,v,n,t,c) (v = (c*)safemalloc((MEM_SIZE)((n) * sizeof(t)))) -#define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))), \ - memzero((char*)(v), (n) * sizeof(t)) -#define Renew(v,n,t) (v = (t*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) -#define Renewc(v,n,t,c) (v = (c*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) -#define Safefree(d) safefree((Malloc_t)(d)) -#define NEWSV(x,len) newSV(len) +#define New(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n)*sizeof(t)))) +#define Newc(x,v,n,t,c) (v = (c*)safemalloc((MEM_SIZE)((n)*sizeof(t)))) +#define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n)*sizeof(t)))), \ + memzero((char*)(v), (n)*sizeof(t)) +#define Renew(v,n,t) \ + (v = (t*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Renewc(v,n,t,c) \ + (v = (c*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Safefree(d) safefree((Malloc_t)(d)) +#define NEWSV(x,len) newSV(len) #else /* LEAKTEST */ -#define New(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))) -#define Newc(x,v,n,t,c) (v = (c*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))) -#define Newz(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))), \ - memzero((char*)(v), (n) * sizeof(t)) -#define Renew(v,n,t) (v = (t*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) -#define Renewc(v,n,t,c) (v = (c*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) -#define Safefree(d) safexfree((Malloc_t)d) -#define NEWSV(x,len) newSV(x,len) +#define New(x,v,n,t) (v = (t*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t)))) +#define Newc(x,v,n,t,c) (v = (c*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t)))) +#define Newz(x,v,n,t) (v = (t*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t)))), \ + memzero((char*)(v), (n)*sizeof(t)) +#define Renew(v,n,t) \ + (v = (t*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Renewc(v,n,t,c) \ + (v = (c*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Safefree(d) safexfree((Malloc_t)d) +#define NEWSV(x,len) newSV(x,len) + #define MAXXCOUNT 1200 long xcount[MAXXCOUNT]; long lastxcount[MAXXCOUNT]; #endif /* LEAKTEST */ -#define Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t)) -#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 Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t)) +#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)) #else /* lint */ -#define New(x,v,n,s) (v = Null(s *)) -#define Newc(x,v,n,s,c) (v = Null(s *)) -#define Newz(x,v,n,s) (v = Null(s *)) -#define Renew(v,n,s) (v = Null(s *)) +#define New(x,v,n,s) (v = Null(s *)) +#define Newc(x,v,n,s,c) (v = Null(s *)) +#define Newz(x,v,n,s) (v = Null(s *)) +#define Renew(v,n,s) (v = Null(s *)) #define Move(s,d,n,t) #define Copy(s,d,n,t) #define Zero(d,n,t) -#define Safefree(d) d = d +#define Safefree(d) (d) = (d) #endif /* lint */ #ifdef USE_STRUCT_COPY -#define StructCopy(s,d,t) *((t*)(d)) = *((t*)(s)) +#define StructCopy(s,d,t) (*((t*)(d)) = *((t*)(s))) #else #define StructCopy(s,d,t) Copy(s,d,1,t) #endif |