From f343e868ce1e0d5994ab1d154fa467f79cf5e80b Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Tue, 6 Sep 2022 12:07:25 +0200 Subject: [PATCH 01/17] XS-APItest/t/locale.t - deal with indented values properly The old code used a regex that would split on exactly one space, so if the data was changed to have more than one then it would get absorbed into the name that was parsed out of the header file, leading the code to test for things like "FOO ", which of course don't exist. Likely this could have caused other issues too, but the defines in practice are single symbols. --- ext/XS-APItest/t/locale.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/XS-APItest/t/locale.t b/ext/XS-APItest/t/locale.t index 1a14fb45cf4f..b8eb09a3fdea 100644 --- a/ext/XS-APItest/t/locale.t +++ b/ext/XS-APItest/t/locale.t @@ -152,7 +152,7 @@ SKIP: { chomp; next unless / - \d+ $ /x; s/ ^ \# \s* define \s*//x; - m/ (.*) \ (.*) /x; + m/ (\S+) \s+ (.*) /x; $items{$1} = ($has_nl_langinfo) ? $1 # Yields 'YESSTR' : $2; # Yields -54 From 48e5befa55fa1345edb489b741f73d3d8da4c4d5 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sun, 4 Sep 2022 19:27:10 +0200 Subject: [PATCH 02/17] XSUB.h - line up properly and make sure they are shorter than 80 cols --- XSUB.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/XSUB.h b/XSUB.h index 5ec8ede20d44..82cd0dc7777c 100644 --- a/XSUB.h +++ b/XSUB.h @@ -329,15 +329,15 @@ Rethrows a previously caught exception. See L. return; \ } STMT_END -#define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END -#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END -#define XSRETURN_NV(v) STMT_START { XST_mNV(0,v); XSRETURN(1); } STMT_END -#define XSRETURN_PV(v) STMT_START { XST_mPV(0,v); XSRETURN(1); } STMT_END -#define XSRETURN_PVN(v,n) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END -#define XSRETURN_NO STMT_START { XST_mNO(0); XSRETURN(1); } STMT_END -#define XSRETURN_YES STMT_START { XST_mYES(0); XSRETURN(1); } STMT_END -#define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END -#define XSRETURN_EMPTY STMT_START { XSRETURN(0); } STMT_END +#define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END +#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END +#define XSRETURN_NV(v) STMT_START { XST_mNV(0,v); XSRETURN(1); } STMT_END +#define XSRETURN_PV(v) STMT_START { XST_mPV(0,v); XSRETURN(1); } STMT_END +#define XSRETURN_PVN(v,n) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END +#define XSRETURN_NO STMT_START { XST_mNO(0); XSRETURN(1); } STMT_END +#define XSRETURN_YES STMT_START { XST_mYES(0); XSRETURN(1); } STMT_END +#define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END +#define XSRETURN_EMPTY STMT_START { XSRETURN(0); } STMT_END #define newXSproto(a,b,c,d) newXS_flags(a,b,c,d,0) From 9813a564e348a57810c2d713b63bfc21f10c3e02 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Tue, 6 Sep 2022 23:25:34 +0200 Subject: [PATCH 03/17] handy.h - remove unused macros None of these are used anymore. See c62fdeb784c7643c90d2ea8c2ec0f03a548da338 for more details. --- handy.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/handy.h b/handy.h index 41e3465d01cc..efbfc0296f64 100644 --- a/handy.h +++ b/handy.h @@ -1831,13 +1831,6 @@ END_EXTERN_C * don't think it's necessary to be so for the purposes where this gets * compiled */ # define isQUOTEMETA_(c) (FITS_IN_8_BITS(c) && ! isWORDCHAR_L1(c)) -# define _IS_IN_SOME_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) isALPHA_L1(c) - - /* And these aren't accurate at all. They are useful only for above - * Latin1, which utilities and bootstrapping don't deal with */ -# define _IS_NON_FINAL_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) 0 -# define _HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) 0 -# define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) 0 /* Many of the macros later in this file are defined in terms of these. By * implementing them with a function, which converts the class number into From a1efe93e5aca0b5d32bf3829b8a2ea9520c18b7b Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 14:06:29 +0200 Subject: [PATCH 04/17] perlio.h - break long comment line --- perlio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perlio.h b/perlio.h index b802105e87f5..96fc6f51ccbf 100644 --- a/perlio.h +++ b/perlio.h @@ -32,7 +32,7 @@ # error "stdio is no longer supported as the default base layer -- use perlio." #endif -/* -------------------- End of Configure controls ---------------------------- */ +/*-------------------- End of Configure controls ---------------------------*/ /* * Although we may not want stdio to be used including here From 49c0e7343f240dfc3c4b2e0f230b29af9f64f6e4 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 14:45:09 +0200 Subject: [PATCH 05/17] cop.h - fix incorrect var name in comment (PL_in_eval) Someone missed an '_' in the name in the comment, the correct name is 'PL_in_eval' not 'PL in_eval'. --- cop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cop.h b/cop.h index 4499a9a4ab55..969a17846b5f 100644 --- a/cop.h +++ b/cop.h @@ -887,7 +887,7 @@ struct block_eval { /* blk_u16 bit usage for eval contexts: */ -#define CxOLD_IN_EVAL(cx) (((cx)->blk_u16) & 0x3F) /* saved PL in_eval */ +#define CxOLD_IN_EVAL(cx) (((cx)->blk_u16) & 0x3F) /* saved PL_in_eval */ #define CxEVAL_TXT_REFCNTED(cx) (((cx)->blk_u16) & 0x40) /* cur_text rc++ */ #define CxOLD_OP_TYPE(cx) (((cx)->blk_u16) >> 7) /* type of eval op */ From 2b8628d7fbf5e4d04883ec112431327da301fce7 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 15:10:24 +0200 Subject: [PATCH 06/17] handy.h - join a comment together into one line a later commit will resplit this again --- handy.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handy.h b/handy.h index efbfc0296f64..199580be5a47 100644 --- a/handy.h +++ b/handy.h @@ -1659,8 +1659,7 @@ END_EXTERN_C # define isPUNCT_A(c) generic_isCC_A_(c, CC_PUNCT_) # define isSPACE_A(c) generic_isCC_A_(c, CC_SPACE_) # define isWORDCHAR_A(c) generic_isCC_A_(c, CC_WORDCHAR_) -# define isXDIGIT_A(c) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits - */ +# define isXDIGIT_A(c) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */ # define isIDFIRST_A(c) generic_isCC_A_(c, CC_IDFIRST_) # define isALPHA_L1(c) generic_isCC_(c, CC_ALPHA_) # define isALPHANUMERIC_L1(c) generic_isCC_(c, CC_ALPHANUMERIC_) From 58b327e5dfcba72f7689ee558a9f01fcedb8f729 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 15:30:09 +0200 Subject: [PATCH 07/17] utfebcdic.h - fix comment indent --- utfebcdic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utfebcdic.h b/utfebcdic.h index 1aab31226131..347a7b121fc4 100644 --- a/utfebcdic.h +++ b/utfebcdic.h @@ -73,7 +73,7 @@ * macro NATIVE_TO_I8(). However, one "shadow", or parallel table, * PL_utf8skip, has been constructed that doesn't require undoing things. It * is such that for each byte, it says how long the sequence is if that -* (UTF-EBCDIC) byte were to begin it + * (UTF-EBCDIC) byte were to begin it. * * There are actually 3 slightly different UTF-EBCDIC encodings in * ebcdic_tables.h, one for each of the code pages recognized by Perl. That From 957319969cfb75a5f9844dcd741c2ec8dfe148a1 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 22:01:16 +0200 Subject: [PATCH 08/17] handy.h - fix typo in comment --- handy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handy.h b/handy.h index 199580be5a47..2e6d73655034 100644 --- a/handy.h +++ b/handy.h @@ -161,7 +161,7 @@ required, but is kept for backwards compatibility. #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__SUNPRO_C)) /* C99 or close enough. */ # define FUNCTION__ __func__ # define SAFE_FUNCTION__ __func__ -#elif (defined(__DECC_VER)) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tur64, -c99 not known, only -std1). */ +#elif (defined(__DECC_VER)) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tru64, -c99 not known, only -std1). */ # define FUNCTION__ ("") # define SAFE_FUNCTION__ ("UNKNOWN") #else From 2c8fc70dfb7c98e23fb57b3582425d975b6b6207 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 22:46:00 +0200 Subject: [PATCH 09/17] intrpvar.h - break comment over multiple lines --- intrpvar.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/intrpvar.h b/intrpvar.h index 0560e0a3b864..b6243842a4d5 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -58,7 +58,10 @@ PERLVARI(I, sub_generation, U32, 1) /* incr to invalidate method cache */ #ifdef PERL_HASH_RANDOMIZE_KEYS #ifdef USE_PERL_PERTURB_KEYS -PERLVARI(I, hash_rand_bits_enabled, U8, 1) /* used to randomize hash stuff 0 == no-random, 1 == random, 2 == deterministic */ +PERLVARI(I, hash_rand_bits_enabled, U8, 1) /* used to randomize hash stuff + 0. no-random + 1. random + 2. determinsitic */ #endif PERLVARI(I, hash_rand_bits, UV, 0) /* used to randomize hash stuff */ #endif @@ -998,7 +1001,7 @@ PERLVARI(I, sv_serial, U32, 0) /* SV serial number, used in sv.c */ PERLVARA(I, sv_consts, SV_CONSTS_COUNT, SV*) /* constant SVs with precomputed hash value */ #ifdef PERL_TRACE_OPS -PERLVARA(I, op_exec_cnt, OP_max+2, UV) /* Counts of executed OPs of the given type. +PERLVARA(I, op_exec_cnt, OP_max+2, UV) /* Counts of executed OPs of the given type. If PERL_TRACE_OPS is enabled, we'll dump a summary count of all ops executed in the program at perl_destruct time. For From 344ec3636dbe349d9f60c166b69ec33ec70ddb09 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 22:53:02 +0200 Subject: [PATCH 10/17] pad.h - reword comment to be more legible The prevous verbiage ended the comment with the term "padnamelist *", which put the "*" right next to the end comment marker, which was a bit confusing. This wording put the * in the middle of the sentence where it is clear it is not a mistake. Also note that the previous text used tabs internally, and so this change /looks/ like it is off indent, it is not, it is lined up with the surrounding lines. --- pad.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pad.h b/pad.h index 6d3f3ff48282..fa5b2896d745 100644 --- a/pad.h +++ b/pad.h @@ -23,8 +23,9 @@ typedef SSize_t PADOFFSET; /* signed so that -1 is a valid value */ struct padlist { SSize_t xpadl_max; /* max index for which array has space */ union { - PAD ** xpadlarr_alloc; /* Pointer to beginning of array of AVs. - index 0 is a padnamelist * */ + PAD ** xpadlarr_alloc; /* Pointer to beginning of array of AVs. + Note that a 'padnamelist *' is stored + in the 0 index of the AV. */ struct { PADNAMELIST * padnl; PAD * pad_1; /* this slice of PAD * array always alloced */ From a5a18e930b69f5fb1acddbfa209e703429529248 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 22:56:44 +0200 Subject: [PATCH 11/17] intrpvar.h - reword comment to be easier to understand and wrap. The old text was difficult to wrap and a little disjointed in terms of readibility. This captures the same essence but in a more concise and easier to wrap form. --- intrpvar.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/intrpvar.h b/intrpvar.h index b6243842a4d5..6df316952043 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -1004,9 +1004,8 @@ PERLVARA(I, sv_consts, SV_CONSTS_COUNT, SV*) /* constant SVs with precomputed ha PERLVARA(I, op_exec_cnt, OP_max+2, UV) /* Counts of executed OPs of the given type. If PERL_TRACE_OPS is enabled, we'll dump a summary count of all ops executed in the - program at perl_destruct time. For - profiling/debugging only. Works only if - DEBUGGING is enabled, too. */ + program at perl_destruct time. Used only + for profiling in DEBUGGING mode. */ #endif PERLVAR(I, random_state, PL_RANDOM_STATE_TYPE) From 044eaf453b1fdabe379f076eaa68d8491f2ce714 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 7 Sep 2022 23:37:38 +0200 Subject: [PATCH 12/17] zaphod32_hash.h - rework comment to be more legible --- zaphod32_hash.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zaphod32_hash.h b/zaphod32_hash.h index bf802ccbb711..834d8cb3fd84 100644 --- a/zaphod32_hash.h +++ b/zaphod32_hash.h @@ -133,12 +133,17 @@ void zaphod32_seed_state ( const U32 *seed= (const U32 *)seed_ch; U32 *state= (U32 *)state_ch; - /* hex expansion of pi, skipping first two digits. pi= 3.2[43f6...]*/ - /* pi value in hex from here: - * http://turner.faculty.swau.edu/mathematics/materialslibrary/pi/pibases.html*/ - /* Ensure that the three state vectors are nonzero regardless of the seed. */ - /* The idea of these two steps is to ensure that the 0 state comes from a seed - * utterly unlike that of the value we replace it with.*/ + /* hex expansion of PI, skipping first two digits. PI= 3.2[43f6...] + * + * PI value in hex from here: + * + * http://turner.faculty.swau.edu/mathematics/materialslibrary/pi/pibases.html + * + * Ensure that the three state vectors are nonzero regardless of + * the seed. The idea of these two steps is to ensure that the 0 + * state comes from a seed utterly unlike that of the value we + * replace it with. + */ state[0]= seed[0] ^ 0x43f6a888; state[1]= seed[1] ^ 0x5a308d31; state[2]= seed[2] ^ 0x3198a2e0; From f783831ece1eaadae0ef4bd165a5cc59726620fc Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Fri, 9 Sep 2022 12:25:32 +0200 Subject: [PATCH 13/17] util.h - remove slash to make line easier to autowrap later --- util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.h b/util.h index 99675d3e851b..d9b61611e484 100644 --- a/util.h +++ b/util.h @@ -184,7 +184,7 @@ typedef struct { /* uses var file to set default filename for newXS_deffile to use for CvFILE */ #define HSf_SETXSUBFN 0x00000020 #define HSf_POPMARK 0x00000040 /* popmark mode or you must supply ax and items */ -#define HSf_IMP_CXT 0x00000080 /* ABI, threaded/MULTIPLICITY, pTHX_ present */ +#define HSf_IMP_CXT 0x00000080 /* ABI, threaded, MULTIPLICITY, pTHX_ present */ #define HSm_INTRPSIZE 0xFFFF0000 /* ABI, interp struct size */ /* A mask of bits in the key which must always match between a XS mod and interp. Also if all ABI bits in a key are true, skip all ABI checks, it is very From a0d9669a1b89bc3b1075e3f9bf2cd07e2a1a1ca9 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Fri, 9 Sep 2022 22:25:51 +0200 Subject: [PATCH 14/17] cv.h - remove left sidecomment star --- cv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cv.h b/cv.h index 833dd28f26e6..51f411629d76 100644 --- a/cv.h +++ b/cv.h @@ -120,7 +120,7 @@ See L. #define CVf_CLONED 0x0040 /* a clone of one of those */ #define CVf_ANON 0x0080 /* CV is not pointed to by a GV */ #define CVf_UNIQUE 0x0100 /* sub is only called once (eg PL_main_cv, - * require, eval). */ + require, eval). */ #define CVf_NODEBUG 0x0200 /* no DB::sub indirection for this CV (esp. useful for special XSUBs) */ #define CVf_CVGV_RC 0x0400 /* CvGV is reference counted */ From 8d02f2eabfd834d52803eb074ff58d3864715eec Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sat, 10 Sep 2022 18:50:00 +0200 Subject: [PATCH 15/17] EXTERN.h - Add whitespace to comment to make more readable Makes it a bit more clear that this is documenting two things. --- EXTERN.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/EXTERN.h b/EXTERN.h index 0fb540481154..e6d97caa44df 100644 --- a/EXTERN.h +++ b/EXTERN.h @@ -9,10 +9,11 @@ */ /* - * EXT designates a global var which is defined in perl.h - * dEXT designates a global var which is defined in another - * file, so we can't count on finding it in perl.h - * (this practice should be avoided). + * EXT: designates a global var which is defined in perl.h + * + * dEXT: designates a global var which is defined in another + * file, so we can't count on finding it in perl.h + * (this practice should be avoided). */ #undef EXT #undef dEXT From df8f9b0442e9dde23e490f19e16d8e8cc1c2138c Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Tue, 27 Sep 2022 13:31:45 +0200 Subject: [PATCH 16/17] op_reg_common.h - break long defines --- op_reg_common.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/op_reg_common.h b/op_reg_common.h index e8770e6352e9..1273cb6f2195 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -101,8 +101,20 @@ get_regex_charset(const U32 flags) /* Mask of the above bits. These need to be transferred from op_pmflags to * re->extflags during compilation */ -#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_EXTENDED_MORE|RXf_PMf_KEEPCOPY|RXf_PMf_NOCAPTURE|RXf_PMf_CHARSET|RXf_PMf_STRICT) -#define RXf_PMf_FLAGCOPYMASK (RXf_PMf_COMPILETIME|RXf_PMf_SPLIT) +#define RXf_PMf_COMPILETIME \ + ( RXf_PMf_MULTILINE \ + | RXf_PMf_SINGLELINE \ + | RXf_PMf_FOLD \ + | RXf_PMf_EXTENDED \ + | RXf_PMf_EXTENDED_MORE \ + | RXf_PMf_KEEPCOPY \ + | RXf_PMf_NOCAPTURE \ + | RXf_PMf_CHARSET \ + | RXf_PMf_STRICT ) + +#define RXf_PMf_FLAGCOPYMASK \ + ( RXf_PMf_COMPILETIME \ + | RXf_PMf_SPLIT ) /* Temporary to get Jenkins happy again * See thread starting at http://nntp.perl.org/group/perl.perl5.porters/220710 From efd868809604bb844e9722b2281617cbd55193e3 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Tue, 18 Oct 2022 18:23:10 +0200 Subject: [PATCH 17/17] gv.h - mark the unused GVf flag with a RESERVED define this make the table layout of the defines more obvious. --- gv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gv.h b/gv.h index ccdc97a1fb32..68865b99916d 100644 --- a/gv.h +++ b/gv.h @@ -162,7 +162,7 @@ Return the CV from the GV. #define GVf_INTRO 0x01 #define GVf_MULTI 0x02 #define GVf_ASSUMECV 0x04 -/* UNUSED 0x08 */ +#define GVf_RESERVED 0x08 /* unused */ #define GVf_IMPORTED 0xF0 #define GVf_IMPORTED_SV 0x10 #define GVf_IMPORTED_AV 0x20