diff --git a/plan9/aperl b/plan9/aperl index 4d032e3c3d..b260973989 100644 --- a/plan9/aperl +++ b/plan9/aperl @@ -3,5 +3,6 @@ # aperl: # Executes perl command and alters stderr to produce Acme-friendly error messages # Created 02-JUL-1996, Luther Huffman, lutherh@stratcom.com +# Modified May 2020, David Romano, unobe@cpan.org -/bin/perl $* |[2] /bin/perl -pe 's/ line (\d+)/:$1/' >[1=2] +/bin/perl-_P9P_VERSION $* |[2] /bin/perl-_P9P_VERSION -pe 's/ line (\d+)/:$1/' >[1=2] diff --git a/plan9/config.plan9 b/plan9/config.plan9 index ef73254c6c..dd88ea2887 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -2,10 +2,10 @@ * This file is mangled by fndvers (and perhaps other scripts) to produce * the config.h for Plan 9. It was handwritten because the standard * configuration scripts were written in a shell dialect incomprehensible - * to Plan 9. + * to Plan 9. * config.h for Plan 9 - * Version: 5.8.0 - */ + * Version: 5.8.9 + */ /* Configuration time: 21-Oct-1996 15:11 * Configured by: Luther Huffman, lutherh@stratcom.com @@ -21,16 +21,38 @@ #ifndef _config_h_ #define _config_h_ +/* CHARBITS: + * This symbol contains the size of a char, so that the C preprocessor + * can make decisions based on it. + */ +#define CHARBITS 8 /**/ + + /* CAT2: * This macro catenates 2 tokens together. */ -#define CAT2(a,b)a ## b +#if 42 == 1 +#define CAT2(a,b) a/**/b +#define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +#define PeRl_CaTiFy(a, b) a ## b +#define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +#define CAT2(a,b) PeRl_CaTiFy(a,b) +#define StGiFy(a) PeRl_StGiFy(a) +#define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +# include "Bletch: How does this C preprocessor catenate tokens?" +#endif + #define CAT3(a,b,c)a ## b ## c #define CAT4(a,b,c,d)a ## b ## c ## d #define CAT5(a,b,c,d,e)a ## b ## c ## d ## e -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) #define SCAT2(a,b)StGiFy(a) StGiFy(b) #define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c) #define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) @@ -52,16 +74,22 @@ # endif #endif -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. +/* BYTEORDER: + * This symbol holds the hexadecimal constant defined in byteorder, + * in a UV, i.e. 0x1234 or 0x4321 or 0x12345678, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. + * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture + * Binaries (MAB) on either big endian or little endian machines. + * The endian-ness is available at compile-time. This only matters + * for perl, where the config.h can be generated and installed on + * one system, and used by a different architecture to build an + * extension. Older versions of NeXT that might not have + * defined either *_ENDIAN__ were all on Motorola 680x0 series, + * so the default case (for NeXT) is big endian to catch them. + * This might matter for NeXT 3.0. */ -#define BIN "/_P9P_OBJTYPE/bin" /* */ -#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ /* LOC_SED: * This symbol holds the complete pathname to the sed program. @@ -239,7 +267,7 @@ #define HAS_GETLOGIN /**/ /* HAS_GETPGID: - * This symbol, if defined, indicates to the C program that + * This symbol, if defined, indicates to the C program that * the getpgid(pid) function is available to get the * process group id. */ @@ -771,7 +799,7 @@ /*#define I_MEMORY / **/ /* I_NET_ERRNO: - * This symbol, if defined, indicates that exists and + * This symbol, if defined, indicates that exists and * should be included. */ /*#define I_NET_ERRNO /* config-skip */ @@ -1014,17 +1042,6 @@ */ #define PLAN9 /**/ -/* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double, or a long double when applicable. Usual values are 2, - * 4 and 8. The default is eight, for safety. - */ -#if defined(USE_CROSS_COMPILE) || defined(MULTIARCH) -# define MEM_ALIGNBYTES 8 -#else -#define MEM_ALIGNBYTES 4 -#endif - /* ARCHLIB: * This variable, if defined, holds the name of the directory in * which the user wants to put architecture-dependent public @@ -1069,8 +1086,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "/usr/bin" /**/ -#define BIN_EXP "/usr/bin" /**/ +#define BIN "/_P9P_OBJTYPE/bin" /* */ +#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, @@ -1081,11 +1098,11 @@ * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture * Binaries (MAB) on either big endian or little endian machines. * The endian-ness is available at compile-time. This only matters - * for perl, where the config.h can be generated and installed on + * for perl, where the config.h can be generated and installed on * one system, and used by a different architecture to build an * extension. Older versions of NeXT that might not have * defined either *_ENDIAN__ were all on Motorola 680x0 series, - * so the default case (for NeXT) is big endian to catch them. + * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ #if defined(USE_CROSS_COMPILE) || defined(MULTIARCH) @@ -1115,30 +1132,6 @@ #define BYTEORDER 0x1234 /* large digits for MSB */ #endif /* NeXT */ -/* CAT2: - * This macro catenates 2 tokens together. - */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. - */ -#if 42 == 1 -#define CAT2(a,b) a/**/b -#define STRINGIFY(a) "a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define PeRl_CaTiFy(a, b) a ## b -#define PeRl_StGiFy(a) #a -/* the additional level of indirection enables these macros to be - * used as arguments to other macros. See K&R 2nd ed., page 231. */ -#define CAT2(a,b) PeRl_CaTiFy(a,b) -#define StGiFy(a) PeRl_StGiFy(a) -#define STRINGIFY(a) PeRl_StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -# include "Bletch: How does this C preprocessor concatenate tokens?" -#endif - /* CPPSTDIN: * This symbol contains the first part of the string which will invoke * the C preprocessor on the standard input and produce to standard @@ -1856,11 +1849,11 @@ * REENTRANT_PROTO_T_ABC macros of reentr.h if d_gmtime_r * is defined. */ -/*#define HAS_GMTIME_R / **/ +#define HAS_GMTIME_R / **/ #define GMTIME_R_PROTO 0 /**/ /* HAS_GNULIBC: - * This symbol, if defined, indicates to the C program that + * This symbol, if defined, indicates to the C program that * the GNU C library is being used. A better check is to use * the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc. */ @@ -1913,7 +1906,7 @@ #define HAS_INT64_T /**/ /* HAS_ISASCII: - * This manifest constant lets the C program know that isascii + * This manifest constant lets the C program know that isascii * is available. */ /*#define HAS_ISASCII / **/ @@ -1973,16 +1966,21 @@ * REENTRANT_PROTO_T_ABC macros of reentr.h if d_localtime_r * is defined. */ -/*#define HAS_LOCALTIME_R / **/ -/*#define LOCALTIME_R_NEEDS_TZSET / **/ +#define HAS_LOCALTIME_R +#define LOCALTIME_R_NEEDS_TZSET / **/ #define LOCALTIME_R_PROTO 0 /**/ +#ifdef LOCALTIME_R_NEEDS_TZSET +#define L_R_TZSET tzset(), +#else +#define L_R_TZSET +#endif /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. */ /* LONG_DOUBLESIZE: - * This symbol contains the size of a long double, so that the + * This symbol contains the size of a long double, so that the * C preprocessor can make decisions based on it. It is only * defined if the system supports long doubles. */ @@ -1995,7 +1993,7 @@ * This symbol will be defined if the C compiler supports long long. */ /* LONGLONGSIZE: - * This symbol contains the size of a long long, so that the + * This symbol contains the size of a long long, so that the * C preprocessor can make decisions based on it. It is only * defined if the system supports long long. */ @@ -2111,7 +2109,7 @@ /*#define OLD_PTHREAD_CREATE_JOINABLE / **/ /* HAS_PTHREAD_YIELD: - * This symbol, if defined, indicates that the pthread_yield + * This symbol, if defined, indicates that the pthread_yield * routine is available to yield the execution of the current * thread. sched_yield is preferable to pthread_yield. */ @@ -2823,8 +2821,8 @@ * This symbol holds the type used for the second argument to * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, gid_t, etc... - * It may be necessary to include to get any + * It can be int, ushort, gid_t, etc... + * It may be necessary to include to get any * typedef'ed information. This is only required if you have * getgroups() or setgroups().. */ @@ -3148,7 +3146,7 @@ #define MYMALLOC /**/ /* Mode_t: - * This symbol holds the type used to declare file modes + * This symbol holds the type used to declare file modes * for systems calls. It is usually mode_t, but may be * int or unsigned short. It may be necessary to include * to get any typedef'ed information. @@ -3298,6 +3296,16 @@ * This symbol contains the number of bits a variable of type NVTYPE * can preserve of a variable of type UVTYPE. */ +/* NV_OVERFLOWS_INTEGERS_AT: + * This symbol gives the largest integer value that NVs can hold. This + * value + 1.0 cannot be stored accurately. It is expressed as constant + * floating point expression to reduce the chance of decimale/binary + * conversion issues. If it can not be determined, the value 0 is given. + */ +/* NV_ZERO_IS_ALLBITS_ZERO: + * This symbol, if defined, indicates that a variable of type NVTYPE + * stores 0.0 in memory as all bits zero. + */ #define IVTYPE long /**/ #define UVTYPE unsigned long /**/ #define I8TYPE char /**/ @@ -3324,8 +3332,10 @@ #define U64SIZE 8 /**/ #endif #define NVSIZE 8 /**/ -/*#define NV_PRESERVES_UV +#define NV_PRESERVES_UV #define NV_PRESERVES_UV_BITS 31 +#define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0 +#undef NV_ZERO_IS_ALLBITS_ZERO /* IVdf: * This symbol defines the format string used for printing a Perl IV @@ -3385,8 +3395,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "/sys/lib/perl/5.18.4" /**/ -#define PRIVLIB_EXP "/sys/lib/perl/5.18.4" /**/ +#define PRIVLIB "/sys/lib/perl/_P9P_VERSION" /**/ +#define PRIVLIB_EXP "/sys/lib/perl/_P9P_VERSION" /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -3433,7 +3443,7 @@ /* Select_fd_set_t: * This symbol holds the type used for the 2nd, 3rd, and 4th * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET - * is defined, and 'int *' otherwise. This is only useful if you + * is defined, and 'int *' otherwise. This is only useful if you * have select(), of course. */ #define Select_fd_set_t fd_set* /**/ @@ -3459,10 +3469,10 @@ * The signals in the list are separated with commas, and the indices * within that list and the SIG_NAME list match, so it's easy to compute * the signal name from a number or vice versa at the price of a small - * dynamic linear lookup. + * dynamic linear lookup. * Duplicates are allowed, but are moved to the end of the list. * The signal number corresponding to sig_name[i] is sig_number[i]. - * if (i < NSIG) then sig_number[i] == i. + * if (i < NSIG) then sig_number[i] == i. * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ @@ -3513,9 +3523,9 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "/sys/lib/perl/5.18.4/site_perl" /**/ -#define SITELIB_EXP "/sys/lib/perl/5.18.4/site_perl" /**/ -#define SITELIB_STEM "/sys/lib/perl/5.18.4/site_perl" /**/ +#define SITELIB "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_EXP "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_STEM "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. @@ -3551,7 +3561,7 @@ * script to make sure (one hopes) that it runs with perl and not * some shell. */ -#define STARTPERL "#!/bin/perl" /**/ +#define STARTPERL "#!/bin/perl-_P9P_VERSION" /**/ /* STDCHAR: * This symbol is defined to be the type of char used in stdio.h. @@ -3593,6 +3603,27 @@ */ #define Uid_t uid_t /* UID type */ +/* GMTIME_MAX: + * This symbol contains the maximum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +/* GMTIME_MIN: + * This symbol contains the minimum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +/* LOCALTIME_MAX: + * This symbol contains the maximum value for the time_t offset that + * the system function localtime () accepts, and defaults to 0 + */ +/* LOCALTIME_MIN: + * This symbol contains the minimum value for the time_t offset that + * the system function localtime () accepts, and defaults to 0 + */ +#define GMTIME_MAX 2147483647 /**/ +#define GMTIME_MIN 0 /**/ +#define LOCALTIME_MAX 2147483647 /**/ +#define LOCALTIME_MIN 0 /**/ + /* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers @@ -3706,11 +3737,11 @@ * If defined, this symbol contains the name of a private library. * The library is private in the sense that it needn't be in anyone's * execution path, but it should be accessible by the world. - * It may have a ~ on the front. + * It may have a ~ on the front. * The standard distribution will put nothing in this directory. * Vendors who distribute perl may wish to place their own * architecture-dependent modules and extensions in this directory with - * MakeMaker Makefile.PL INSTALLDIRS=vendor + * MakeMaker Makefile.PL INSTALLDIRS=vendor * or equivalent. See INSTALL for details. */ /* PERL_VENDORARCH_EXP: diff --git a/plan9/exclude b/plan9/exclude index 7d9fc3c8af..1a6a8b5286 100644 --- a/plan9/exclude +++ b/plan9/exclude @@ -16,3 +16,4 @@ op/misc.t op/oct.t op/split.t op/stat.t +.git diff --git a/plan9/fndvers b/plan9/fndvers old mode 100644 new mode 100755 index a848de2b6d..b05a98f65d --- a/plan9/fndvers +++ b/plan9/fndvers @@ -12,3 +12,8 @@ ed plan9/genconfig.pl< lib/ExtUtils/Miniperl.pm + # Don't load any extensions for now + #./miniperl -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' $extensions > perlmain.c + ./miniperl -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' > perlmain.c config.h: plan9/fndvers plan9/fndvers @@ -79,10 +88,16 @@ $perlshr: ${ext_obj:%=$perlshr(%)} ar rv $perlshr $ext_obj $RANLIB $perlshr +uudmap.h: generate_uudmap.c + $CCCMD generate_uudmap.c + $LD $CFLAGS -o generate_uudmap generate_uudmap.$O + chmod +x generate_uudmap + ./generate_uudmap uudmap.h bitcount.h mg_data.h + IO.c: miniperl ext/IO/IO.xs ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/IO/IO.xs > $target cp ext/IO/*.pm $privlib - if (test !-d $privlib/IO) { + if (test ! -d $privlib/IO) { mkdir $privlib/IO cp ext/IO/lib/IO/*.pm $privlib/IO } @@ -126,7 +141,10 @@ plan9.$O: config.h ./plan9/plan9.c $CCCMD $stem.c $archlib/Config.pm: miniperl config.sh - ./miniperl configpm $archlib/Config.pm + ./miniperl -Ilib make_patchnum.pl + ./miniperl -Ilib configpm + # Might need to fine-tune this + {cd lib; tar c .} | {cd $archlib; tar x} config.sh: miniperl config.h ./miniperl ./plan9/genconfig.pl @@ -143,7 +161,7 @@ man:V: $perlpods pod/pod2man.PL perl for (i in $histpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i nuke clean:V: - rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c + rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c generate_uudmap uudmap.h bitcount.h mg_data.h rm -rf $privlib/IO deleteman:V: diff --git a/plan9/plan9.c b/plan9/plan9.c index ebdac27dcb..51c9dd5655 100644 --- a/plan9/plan9.c +++ b/plan9/plan9.c @@ -1,20 +1,7 @@ #include "EXTERN.h" #include "perl.h" -/* Functions mentioned in but not implemented */ - -int getsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"getsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - -int setsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"setsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - +/* Functions mentioned in but not implemented */ int recvmsg(int a, struct msghdr *b, int c) { @@ -112,23 +99,3 @@ void endservent() { croak("Function \"endservent\" not implemented in this version of perl."); } - -int tcdrain(int) -{ -croak("Function \"tcdrain\" not implemented in this version of perl."); -} - -int tcflow(int, int) -{ -croak("Function \"tcflow\" not implemented in this version of perl."); -} - -int tcflush(int, int) -{ -croak("Function \"tcflush\" not implemented in this version of perl."); -} - -int tcsendbreak(int, int) -{ -croak("Function \"tcsendbreak\" not implemented in this version of perl."); -} diff --git a/plan9/setup.rc b/plan9/setup.rc index dd96c1f9c7..6b8c2589ed 100644 --- a/plan9/setup.rc +++ b/plan9/setup.rc @@ -5,40 +5,45 @@ # permissions. # Last modified 6/30/96 by: # Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com +# Last modified May 2020 by: +# David Romano, unobe@cpan.org awk -f versnum ../patchlevel.h . buildinfo builddir = `{ cd .. ; pwd } if (~ $#* 0) platforms = $objtype if not switch($1) { - case -a ; platforms = (386 mips sparc 68020) + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit } -sourcedir=/sys/src/cmd/perl/$p9pvers -privlib=/sys/lib/perl +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers sitelib=$privlib/site_perl #Build source directory -if (test ! -d /sys/src/cmd/perl) mkdir /sys/src/cmd/perl +if (test ! -d $sourceroot) mkdir $sourceroot if (test ! -d $sourcedir) mkdir $sourcedir #Populate source directory echo Building source directories ... {cd $builddir ; tar c .} | { cd $sourcedir ; tar x} cp $builddir/plan9/plan9.c $builddir/plan9/plan9ish.h $builddir/plan9/mkfile $sourcedir -cd $sourcedir/lib ; rm -rf * #Build library directories echo Building library directories ... +if (test ! -d $privroot) mkdir $privroot if (test ! -d $privlib) mkdir $privlib if (test ! -d $privlib/auto) mkdir $privlib/auto if (test ! -d $sitelib) mkdir $sitelib for(i in $platforms){ - archlib=/$i/lib/perl/$p9pvers + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers sitearch=$archlib/site_perl corelib=$archlib/CORE arpalib=$corelib/arpa - if (test ! -d /$i/lib/perl) mkdir /$i/lib/perl + if (test ! -d $archroot) mkdir $archroot if (test ! -d $archlib) mkdir $archlib if (test ! -d $sitearch) mkdir $sitearch if (test ! -d $corelib) mkdir $corelib diff --git a/plan9/uninstall.rc b/plan9/uninstall.rc new file mode 100755 index 0000000000..503991a684 --- /dev/null +++ b/plan9/uninstall.rc @@ -0,0 +1,25 @@ +#!/bin/rc + +. buildinfo +if (~ $#* 0) platforms = $objtype +if not switch($1) { + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) + case * ; echo 'Usage: uninstall.rc [-a]' >[1=2] ; exit +} +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers +sitelib=$privlib/site_perl + +echo Uninstalling perl/$p9pvers +cd $sourceroot + +for(i in $platforms){ + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers + if (test -d $archlib) rm -r $archlib + rm /$i/bin/perl-$p9pvers +} +if (test -d $privlib) rm -r $privlib +if (test -d $sourcedir) rm -r $sourcedir diff --git a/plan9/versnum b/plan9/versnum index 6e579f3048..55f80d067e 100644 --- a/plan9/versnum +++ b/plan9/versnum @@ -1,8 +1,9 @@ -/PERL_VERSION/ {base = $3} -/PERL_SUBVERSION/ {subvers = $3} +/define PERL_REVISION/ {revision = $3} +/define PERL_VERSION/ {version = $3} +/define PERL_SUBVERSION/ {subvers = $3} END { if (subvers == 0) - printf "p9pvers = 5.%03d\n", base> "buildinfo"; + printf "p9pvers = %d.%d\n", revision, version> "buildinfo"; else - printf "p9pvers = 5.%03d_%02d\n" , base, subvers> "buildinfo"; + printf "p9pvers = %d.%d.%d\n" , revision, version, subvers> "buildinfo"; } diff --git a/sv.c b/sv.c index cd8b6c627a..fe96da3813 100644 --- a/sv.c +++ b/sv.c @@ -830,10 +830,13 @@ struct body_details { U8 body_size; /* Size to allocate */ U8 copy; /* Size of structure to copy (may be shorter) */ U8 offset; - unsigned int type : 4; /* We have space for a sanity check. */ - unsigned int cant_upgrade : 1; /* Cannot upgrade this type */ - unsigned int zero_nv : 1; /* zero the NV when upgrading from this */ - unsigned int arena : 1; /* Allocated from an arena */ + + /** 9front, May 2020: These were changed from bitfield definitions (:4, :1, :1, :1, respectively), due to compilation failure later on when creating an array of these structs. I think the types are alright, but maybe have to revisit. **/ + U32 type; /* We have space for a sanity check. */ + U8 cant_upgrade; /* Cannot upgrade this type */ + U8 zero_nv; /* zero the NV when upgrading from this */ + U8 arena; /* Allocated from an arena */ + size_t arena_size; /* Size of arena to allocate */ }; @@ -2803,8 +2806,8 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) return RX_WRAPPED(re); } else { - const char *const typestr = sv_reftype(referent, 0); - const STRLEN typelen = strlen(typestr); + const char *const typestring = sv_reftype(referent, 0); + const STRLEN typelen = strlen(typestring); UV addr = PTR2UV(referent); const char *stashname = NULL; STRLEN stashnamelen = 0; /* hush, gcc */ @@ -2847,7 +2850,7 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) *--retval = '('; retval -= typelen; - memcpy(retval, typestr, typelen); + memcpy(retval, typestring, typelen); if (stashname) { *--retval = '='; diff --git a/time64.c b/time64.c index 8cbfa7c170..90d1106ed3 100644 --- a/time64.c +++ b/time64.c @@ -504,7 +504,8 @@ static struct TM *S_localtime64_r (const Time64_T *time, struct TM *local_tm) } safe_time = (time_t)S_timegm64(&gm_tm); - if( LOCALTIME_R(&safe_time, &safe_date) == NULL ) { + // 9front: May 2020. By casting NULL to int, we miss the case when LOCALTIME_R really is 0, which is a valid datetime. + if( LOCALTIME_R(&safe_time, &safe_date) == (int) NULL ) { TIME64_TRACE1("localtime_r(%d) returned NULL\n", (int)safe_time); return NULL; } diff --git a/utf8.c b/utf8.c index 2228778d2b..096e9dacdc 100644 --- a/utf8.c +++ b/utf8.c @@ -3328,7 +3328,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8) * terminated by a \n or the null string terminator. * lend points to the null terminator of that string * wants_value is non-zero if the swash expects a third number - * typestr is the name of the swash's mapping, like 'ToLower' + * typestring is the name of the swash's mapping, like 'ToLower' * On output: *min, *max, and *val are set to the values read from the line. * returns a pointer just beyond the line examined. If there was no * valid min number on the line, returns lend+1 @@ -3336,9 +3336,9 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8) STATIC U8* S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, - const bool wants_value, const U8* const typestr) + const bool wants_value, const U8* const typestring) { - const int typeto = typestr[0] == 'T' && typestr[1] == 'o'; + const int typeto = typestring[0] == 'T' && typestring[1] == 'o'; STRLEN numlen; /* Length of the number */ I32 flags = PERL_SCAN_SILENT_ILLDIGIT | PERL_SCAN_DISALLOW_PREFIX @@ -3403,7 +3403,7 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, if (typeto) { /* diag_listed_as: To%s: illegal mapping '%s' */ Perl_croak(aTHX_ "%s: illegal mapping '%s'", - typestr, l); + typestring, l); } } } @@ -3417,7 +3417,7 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, *val = 0; if (typeto) { /* diag_listed_as: To%s: illegal mapping '%s' */ - Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestr, l); + Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestring, l); } } else @@ -3451,7 +3451,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) SV** listsvp = NULL; /* The string containing the main body of the table */ SV** extssvp = NULL; SV** invert_it_svp = NULL; - U8* typestr = NULL; + U8* typestring = NULL; STRLEN bits; STRLEN octets; /* if bits == 1, then octets == 0 */ UV none; @@ -3467,7 +3467,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) bits = SvUV(*bitssvp); none = SvUV(*nonesvp); - typestr = (U8*)SvPV_nolen(*typesvp); + typestring = (U8*)SvPV_nolen(*typesvp); } else { bits = 1; @@ -3528,7 +3528,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) while (l < lend) { UV min, max, val, upper; l = S_swash_scan_list_line(aTHX_ l, lend, &min, &max, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break; } @@ -3800,7 +3800,7 @@ Perl__swash_inversion_hash(pTHX_ SV* const swash) SV** const bitssvp = hv_fetchs(hv, "BITS", FALSE); SV** const nonesvp = hv_fetchs(hv, "NONE", FALSE); /*SV** const extssvp = hv_fetchs(hv, "EXTRAS", FALSE);*/ - const U8* const typestr = (U8*)SvPV_nolen(*typesvp); + const U8* const typestring = (U8*)SvPV_nolen(*typesvp); const STRLEN bits = SvUV(*bitssvp); const STRLEN octets = bits >> 3; /* if bits == 1, then octets == 0 */ const UV none = SvUV(*nonesvp); @@ -3937,7 +3937,7 @@ Perl__swash_inversion_hash(pTHX_ SV* const swash) UV min, max, val; UV inverse; l = S_swash_scan_list_line(aTHX_ l, lend, &min, &max, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break; } @@ -4039,7 +4039,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) SV** extssvp; SV** invert_it_svp; - U8* typestr; + U8* typestring; STRLEN bits; STRLEN octets; /* if bits == 1, then octets == 0 */ U8 *x, *xend; @@ -4061,7 +4061,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) extssvp = hv_fetchs(hv, "EXTRAS", FALSE); invert_it_svp = hv_fetchs(hv, "INVERT_IT", FALSE); - typestr = (U8*)SvPV_nolen(*typesvp); + typestring = (U8*)SvPV_nolen(*typesvp); bits = SvUV(*bitssvp); octets = bits >> 3; /* if bits == 1, then octets == 0 */ @@ -4104,7 +4104,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) UV val; /* Not used by this function */ l = S_swash_scan_list_line(aTHX_ l, lend, &start, &end, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break;