Skip to content

Commit 7c7925e

Browse files
committed
WS Cleanup Stage #9 - reformat structs
1 parent 50e673c commit 7c7925e

17 files changed

+966
-982
lines changed

av.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
*/
1010

1111
struct xpvav {
12-
HV* xmg_stash; /* class package */
12+
HV *xmg_stash; /* class package */
1313
union _xmgu xmg_u;
1414
SSize_t xav_fill; /* Index of last element present */
1515
SSize_t xav_max; /* max index for which array has space */
16-
SV** xav_alloc; /* pointer to beginning of C array of SVs */
16+
SV **xav_alloc; /* pointer to beginning of C array of SVs */
1717
};
1818

1919
/* SV* xav_arylen; */

cop.h

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
*/
3232

3333
struct jmpenv {
34-
struct jmpenv * je_prev;
35-
Sigjmp_buf je_buf; /* uninit if je_prev is NULL */
36-
int je_ret; /* last exception thrown */
37-
bool je_mustcatch; /* longjmp()s must be caught locally */
38-
U16 je_old_delaymagic; /* saved PL_delaymagic */
39-
SSize_t je_old_stack_hwm;
34+
struct jmpenv *je_prev;
35+
Sigjmp_buf je_buf; /* uninit if je_prev is NULL */
36+
int je_ret; /* last exception thrown */
37+
bool je_mustcatch; /* longjmp()s must be caught locally */
38+
U16 je_old_delaymagic; /* saved PL_delaymagic */
39+
SSize_t je_old_stack_hwm;
4040
};
4141

4242
typedef struct jmpenv JMPENV;
@@ -427,29 +427,29 @@ struct cop {
427427
BASEOP
428428
/* On LP64 putting this here takes advantage of the fact that BASEOP isn't
429429
an exact multiple of 8 bytes to save structure padding. */
430-
line_t cop_line; /* line # of this command */
430+
line_t cop_line; /* line # of this command */
431431
/* label for this construct is now stored in cop_hints_hash */
432432
#ifdef USE_ITHREADS
433-
PADOFFSET cop_stashoff; /* offset into PL_stashpad, for the package
434-
the line was compiled in */
435-
char * cop_file; /* rcpv containing name of file
436-
this command is from */
433+
PADOFFSET cop_stashoff; /* offset into PL_stashpad, for the package
434+
the line was compiled in */
435+
char *cop_file; /* rcpv containing name of file
436+
this command is from */
437437
#else
438-
HV * cop_stash; /* package line was compiled in */
439-
GV * cop_filegv; /* name of GV file this command is from */
438+
HV *cop_stash; /* package line was compiled in */
439+
GV *cop_filegv; /* name of GV file this command is from */
440440
#endif
441-
U32 cop_hints; /* hints bits from pragmata */
442-
U32 cop_seq; /* parse sequence number */
443-
char * cop_warnings; /* Lexical warnings bitmask vector. Refcounted
444-
shared copy of ${^WARNING_BITS}. This
445-
pointer either points at one of the magic
446-
values for warnings, or it points at a
447-
buffer constructed with rcpv_new(). Use the
448-
RCPV_LEN() macro to get its length.
449-
*/
441+
U32 cop_hints; /* hints bits from pragmata */
442+
U32 cop_seq; /* parse sequence number */
443+
char *cop_warnings; /* Lexical warnings bitmask vector. Refcounted
444+
shared copy of ${^WARNING_BITS}. This
445+
pointer either points at one of the magic
446+
values for warnings, or it points at a
447+
buffer constructed with rcpv_new(). Use the
448+
RCPV_LEN() macro to get its length.
449+
*/
450450
/* compile time state of %^H. See the comment in op.c for how
451451
this is used to recreate a hash to return from caller. */
452-
COPHH * cop_hints_hash;
452+
COPHH *cop_hints_hash;
453453
/* for now just a bitmask stored here. If we get sufficient features
454454
this may become a pointer. How these flags are stored is subject
455455
to change without notice. Use the macros to test for features.
@@ -536,10 +536,10 @@ is always injected at the end of the string by rcpv_new().
536536
*/
537537

538538
struct rcpv {
539-
STRLEN refcount; /* UV would mean a 64 refcnt on 32 bit
540-
builds with -Duse64bitint */
541-
STRLEN len; /* length of string including mandatory
542-
null byte at end */
539+
STRLEN refcount; /* UV would mean a 64 refcnt on 32 bit
540+
builds with -Duse64bitint */
541+
STRLEN len; /* length of string including mandatory
542+
null byte at end */
543543
char pv[1];
544544
};
545545
typedef struct rcpv RCPV;
@@ -799,27 +799,27 @@ returned label, by setting C<*flags> to 0 or C<SVf_UTF8>.
799799

800800
/* subroutine context */
801801
struct block_sub {
802-
OP * retop; /* op to execute on exit from sub */
803-
I32 old_cxsubix; /* previous value of si_cxsubix */
802+
OP *retop; /* op to execute on exit from sub */
803+
I32 old_cxsubix; /* previous value of si_cxsubix */
804804
/* Above here is the same for sub, format and eval. */
805-
PAD *prevcomppad; /* the caller's PL_comppad */
806-
CV * cv;
805+
PAD *prevcomppad; /* the caller's PL_comppad */
806+
CV *cv;
807807
/* Above here is the same for sub and format. */
808-
I32 olddepth;
809-
AV *savearray;
808+
I32 olddepth;
809+
AV *savearray;
810810
};
811811

812812

813813
/* format context */
814814
struct block_format {
815-
OP * retop; /* op to execute on exit from sub */
816-
I32 old_cxsubix; /* previous value of si_cxsubix */
815+
OP *retop; /* op to execute on exit from sub */
816+
I32 old_cxsubix; /* previous value of si_cxsubix */
817817
/* Above here is the same for sub, format and eval. */
818-
PAD *prevcomppad; /* the caller's PL_comppad */
819-
CV * cv;
818+
PAD *prevcomppad; /* the caller's PL_comppad */
819+
CV *cv;
820820
/* Above here is the same for sub and format. */
821-
GV * gv;
822-
GV * dfoutgv;
821+
GV *gv;
822+
GV *dfoutgv;
823823
};
824824

825825
/* return a pointer to the current context */
@@ -873,14 +873,14 @@ struct block_format {
873873

874874
/* eval context */
875875
struct block_eval {
876-
OP * retop; /* op to execute on exit from eval */
877-
I32 old_cxsubix; /* previous value of si_cxsubix */
876+
OP *retop; /* op to execute on exit from eval */
877+
I32 old_cxsubix; /* previous value of si_cxsubix */
878878
/* Above here is the same for sub, format and eval. */
879-
SV * old_namesv;
880-
OP * old_eval_root;
881-
SV * cur_text;
882-
CV * cv;
883-
JMPENV * cur_top_env; /* value of PL_top_env when eval CX created */
879+
SV *old_namesv;
880+
OP *old_eval_root;
881+
SV *cur_text;
882+
CV *cv;
883+
JMPENV *cur_top_env; /* value of PL_top_env when eval CX created */
884884
};
885885

886886
/* If we ever need more than 512 op types, change the shift from 7. blku_gimme
@@ -895,32 +895,32 @@ struct block_eval {
895895

896896
/* loop context */
897897
struct block_loop {
898-
LOOP * my_op; /* My op, that contains redo, next and last ops. */
899-
union { /* different ways of locating the iteration variable */
900-
SV **svp; /* for lexicals: address of pad slot */
901-
GV *gv; /* for package vars */
902-
} itervar_u;
903-
SV *itersave; /* the original iteration var */
898+
LOOP *my_op; /* My op, that contains redo, next and last ops. */
899+
union { /* different ways of locating the iteration variable */
900+
SV **svp; /* for lexicals: address of pad slot */
901+
GV *gv; /* for package vars */
902+
} itervar_u;
903+
SV *itersave; /* the original iteration var */
904904
union {
905905
struct { /* CXt_LOOP_ARY, C<for (@ary)> */
906-
AV *ary; /* array being iterated over */
907-
IV ix; /* index relative to base of array */
908-
} ary;
906+
AV *ary; /* array being iterated over */
907+
IV ix; /* index relative to base of array */
908+
} ary;
909909
struct { /* CXt_LOOP_LIST, C<for (list)> */
910910
I32 basesp; /* first element of list on stack */
911-
IV ix; /* index relative to basesp */
912-
} stack;
911+
IV ix; /* index relative to basesp */
912+
} stack;
913913
struct { /* CXt_LOOP_LAZYIV, C<for (1..9)> */
914-
IV cur;
915-
IV end;
916-
} lazyiv;
914+
IV cur;
915+
IV end;
916+
} lazyiv;
917917
struct { /* CXt_LOOP_LAZYSV C<for ('a'..'z')> */
918-
SV * cur;
919-
SV * end; /* maximum value (or minimum in reverse) */
920-
} lazysv;
921-
} state_u;
918+
SV *cur;
919+
SV *end; /* maximum value (or minimum in reverse) */
920+
} lazysv;
921+
} state_u;
922922
#ifdef USE_ITHREADS
923-
PAD *oldcomppad; /* needed to map itervar_u.svp during thread clone */
923+
PAD *oldcomppad; /* needed to map itervar_u.svp during thread clone */
924924
#endif
925925
};
926926

@@ -954,33 +954,33 @@ struct block_loop {
954954

955955
/* given/when context */
956956
struct block_givwhen {
957-
OP *leave_op;
958-
SV *defsv_save; /* the original $_ */
957+
OP *leave_op;
958+
SV *defsv_save; /* the original $_ */
959959
};
960960

961961

962962

963963
/* context common to subroutines, evals and loops */
964964
struct block {
965-
U8 blku_type; /* what kind of context this is */
966-
U8 blku_gimme; /* is this block running in list context? */
967-
U16 blku_u16; /* used by block_sub and block_eval (so far) */
968-
I32 blku_oldsaveix; /* saved PL_savestack_ix */
965+
U8 blku_type; /* what kind of context this is */
966+
U8 blku_gimme; /* is this block running in list context? */
967+
U16 blku_u16; /* used by block_sub and block_eval (so far) */
968+
I32 blku_oldsaveix; /* saved PL_savestack_ix */
969969
/* all the fields above must be aligned with same-sized fields as sbu */
970-
I32 blku_oldsp; /* current sp floor: where nextstate pops to */
971-
I32 blku_oldmarksp; /* mark stack index */
972-
COP * blku_oldcop; /* old curcop pointer */
973-
PMOP * blku_oldpm; /* values of pattern match vars */
974-
SSize_t blku_old_tmpsfloor; /* saved PL_tmps_floor */
975-
I32 blku_oldscopesp; /* scope stack index */
970+
I32 blku_oldsp; /* current sp floor: where nextstate pops to */
971+
I32 blku_oldmarksp; /* mark stack index */
972+
COP *blku_oldcop; /* old curcop pointer */
973+
PMOP *blku_oldpm; /* values of pattern match vars */
974+
SSize_t blku_old_tmpsfloor; /* saved PL_tmps_floor */
975+
I32 blku_oldscopesp; /* scope stack index */
976976

977977
union {
978978
struct block_sub blku_sub;
979979
struct block_format blku_format;
980980
struct block_eval blku_eval;
981981
struct block_loop blku_loop;
982982
struct block_givwhen blku_givwhen;
983-
} blk_u;
983+
} blk_u;
984984
};
985985
#define blk_oldsp cx_u.cx_blk.blku_oldsp
986986
#define blk_oldcop cx_u.cx_blk.blku_oldcop
@@ -1013,21 +1013,21 @@ struct block {
10131013

10141014
/* substitution context */
10151015
struct subst {
1016-
U8 sbu_type; /* same as blku_type */
1017-
U8 sbu_rflags;
1018-
U16 sbu_rxtainted;
1019-
I32 sbu_oldsaveix; /* same as blku_oldsaveix */
1016+
U8 sbu_type; /* same as blku_type */
1017+
U8 sbu_rflags;
1018+
U16 sbu_rxtainted;
1019+
I32 sbu_oldsaveix; /* same as blku_oldsaveix */
10201020
/* all the fields above must be aligned with same-sized fields as blk_u */
1021-
SSize_t sbu_iters;
1022-
SSize_t sbu_maxiters;
1023-
char * sbu_orig;
1024-
SV * sbu_dstr;
1025-
SV * sbu_targ;
1026-
char * sbu_s;
1027-
char * sbu_m;
1028-
char * sbu_strend;
1029-
void * sbu_rxres;
1030-
REGEXP * sbu_rx;
1021+
SSize_t sbu_iters;
1022+
SSize_t sbu_maxiters;
1023+
char *sbu_orig;
1024+
SV *sbu_dstr;
1025+
SV *sbu_targ;
1026+
char *sbu_s;
1027+
char *sbu_m;
1028+
char *sbu_strend;
1029+
void *sbu_rxres;
1030+
REGEXP *sbu_rx;
10311031
};
10321032

10331033
#ifdef PERL_CORE
@@ -1083,7 +1083,7 @@ struct context {
10831083
union {
10841084
struct block cx_blk;
10851085
struct subst cx_subst;
1086-
} cx_u;
1086+
} cx_u;
10871087
};
10881088
#define cx_type cx_u.cx_subst.sbu_type
10891089

@@ -1223,10 +1223,10 @@ struct context {
12231223
#define PERLSI_REGCOMP 11
12241224

12251225
struct stackinfo {
1226-
AV * si_stack; /* stack for current runlevel */
1227-
PERL_CONTEXT * si_cxstack; /* context stack for runlevel */
1228-
struct stackinfo * si_prev;
1229-
struct stackinfo * si_next;
1226+
AV *si_stack; /* stack for current runlevel */
1227+
PERL_CONTEXT *si_cxstack; /* context stack for runlevel */
1228+
struct stackinfo *si_prev;
1229+
struct stackinfo *si_next;
12301230
I32 si_cxix; /* current context index */
12311231
I32 si_cxmax; /* maximum allocated index */
12321232
I32 si_cxsubix; /* topmost sub/eval/format */
@@ -1236,7 +1236,7 @@ struct stackinfo {
12361236
* with DEBUGGING, but not
12371237
* #ifdef-ed for bincompat */
12381238
#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
1239-
/* high water mark: for checking if the stack was correctly
1239+
/* high water mark: for checking if the stack was correctly
12401240
* extended / tested for extension by each pp function */
12411241
SSize_t si_stack_hwm;
12421242
#endif

gv.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
*/
1111

1212
struct gp {
13-
SV * gp_sv; /* scalar value */
14-
struct io * gp_io; /* filehandle value */
15-
CV * gp_cv; /* subroutine value */
16-
U32 gp_cvgen; /* generational validity of cached gp_cv */
17-
U32 gp_refcnt; /* how many globs point to this? */
18-
HV * gp_hv; /* hash value */
19-
AV * gp_av; /* array value */
20-
CV * gp_form; /* format value */
21-
GV * gp_egv; /* effective gv, if *glob */
22-
PERL_BITFIELD32 gp_line:31; /* line first declared at (for -w) */
13+
SV *gp_sv; /* scalar value */
14+
struct io *gp_io; /* filehandle value */
15+
CV *gp_cv; /* subroutine value */
16+
U32 gp_cvgen; /* generational validity of cached gp_cv */
17+
U32 gp_refcnt; /* how many globs point to this? */
18+
HV *gp_hv; /* hash value */
19+
AV *gp_av; /* array value */
20+
CV *gp_form; /* format value */
21+
GV *gp_egv; /* effective gv, if *glob */
22+
PERL_BITFIELD32 gp_line:31; /* line first declared at (for -w) */
2323
PERL_BITFIELD32 gp_flags:1;
24-
HEK * gp_file_hek; /* file first declared in (for -w) */
24+
HEK *gp_file_hek; /* file first declared in (for -w) */
2525
};
2626

2727
#define GvXPVGV(gv) ((XPVGV*)SvANY(gv))

0 commit comments

Comments
 (0)