Skip to content

Commit 1a628d7

Browse files
committed
WS Cleanup Stage #9 - reformat structs
1 parent aa9490e commit 1a628d7

16 files changed

+773
-773
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: 87 additions & 87 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,23 +427,23 @@ 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; /* name of file 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; /* name of file this command is from */
436436
#else
437-
HV * cop_stash; /* package line was compiled in */
438-
GV * cop_filegv; /* name of GV file this command is from */
437+
HV *cop_stash; /* package line was compiled in */
438+
GV *cop_filegv; /* name of GV file this command is from */
439439
#endif
440-
U32 cop_hints; /* hints bits from pragmata */
441-
U32 cop_seq; /* parse sequence number */
440+
U32 cop_hints; /* hints bits from pragmata */
441+
U32 cop_seq; /* parse sequence number */
442442
/* Beware. mg.c and warnings.pl assume the type of this is STRLEN *: */
443-
STRLEN * cop_warnings; /* lexical warnings bitmask */
443+
STRLEN *cop_warnings; /* lexical warnings bitmask */
444444
/* compile time state of %^H. See the comment in op.c for how
445445
this is used to recreate a hash to return from caller. */
446-
COPHH * cop_hints_hash;
446+
COPHH *cop_hints_hash;
447447
/* for now just a bitmask stored here. If we get sufficient features
448448
this may become a pointer. How these flags are stored is subject
449449
to change without notice. Use the macros to test for features.
@@ -697,27 +697,27 @@ returned label, by setting C<*flags> to 0 or C<SVf_UTF8>.
697697

698698
/* subroutine context */
699699
struct block_sub {
700-
OP * retop; /* op to execute on exit from sub */
701-
I32 old_cxsubix; /* previous value of si_cxsubix */
700+
OP *retop; /* op to execute on exit from sub */
701+
I32 old_cxsubix; /* previous value of si_cxsubix */
702702
/* Above here is the same for sub, format and eval. */
703-
PAD *prevcomppad; /* the caller's PL_comppad */
704-
CV * cv;
703+
PAD *prevcomppad; /* the caller's PL_comppad */
704+
CV *cv;
705705
/* Above here is the same for sub and format. */
706-
I32 olddepth;
707-
AV *savearray;
706+
I32 olddepth;
707+
AV *savearray;
708708
};
709709

710710

711711
/* format context */
712712
struct block_format {
713-
OP * retop; /* op to execute on exit from sub */
714-
I32 old_cxsubix; /* previous value of si_cxsubix */
713+
OP *retop; /* op to execute on exit from sub */
714+
I32 old_cxsubix; /* previous value of si_cxsubix */
715715
/* Above here is the same for sub, format and eval. */
716-
PAD *prevcomppad; /* the caller's PL_comppad */
717-
CV * cv;
716+
PAD *prevcomppad; /* the caller's PL_comppad */
717+
CV *cv;
718718
/* Above here is the same for sub and format. */
719-
GV * gv;
720-
GV * dfoutgv;
719+
GV *gv;
720+
GV *dfoutgv;
721721
};
722722

723723
/* return a pointer to the current context */
@@ -771,14 +771,14 @@ struct block_format {
771771

772772
/* eval context */
773773
struct block_eval {
774-
OP * retop; /* op to execute on exit from eval */
775-
I32 old_cxsubix; /* previous value of si_cxsubix */
774+
OP *retop; /* op to execute on exit from eval */
775+
I32 old_cxsubix; /* previous value of si_cxsubix */
776776
/* Above here is the same for sub, format and eval. */
777-
SV * old_namesv;
778-
OP * old_eval_root;
779-
SV * cur_text;
780-
CV * cv;
781-
JMPENV * cur_top_env; /* value of PL_top_env when eval CX created */
777+
SV *old_namesv;
778+
OP *old_eval_root;
779+
SV *cur_text;
780+
CV *cv;
781+
JMPENV *cur_top_env; /* value of PL_top_env when eval CX created */
782782
};
783783

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

794794
/* loop context */
795795
struct block_loop {
796-
LOOP * my_op; /* My op, that contains redo, next and last ops. */
797-
union { /* different ways of locating the iteration variable */
798-
SV **svp; /* for lexicals: address of pad slot */
799-
GV *gv; /* for package vars */
800-
} itervar_u;
801-
SV *itersave; /* the original iteration var */
796+
LOOP *my_op; /* My op, that contains redo, next and last ops. */
797+
union { /* different ways of locating the iteration variable */
798+
SV **svp; /* for lexicals: address of pad slot */
799+
GV *gv; /* for package vars */
800+
} itervar_u;
801+
SV *itersave; /* the original iteration var */
802802
union {
803803
struct { /* CXt_LOOP_ARY, C<for (@ary)> */
804-
AV *ary; /* array being iterated over */
805-
IV ix; /* index relative to base of array */
806-
} ary;
804+
AV *ary; /* array being iterated over */
805+
IV ix; /* index relative to base of array */
806+
} ary;
807807
struct { /* CXt_LOOP_LIST, C<for (list)> */
808808
I32 basesp; /* first element of list on stack */
809-
IV ix; /* index relative to basesp */
810-
} stack;
809+
IV ix; /* index relative to basesp */
810+
} stack;
811811
struct { /* CXt_LOOP_LAZYIV, C<for (1..9)> */
812-
IV cur;
813-
IV end;
814-
} lazyiv;
812+
IV cur;
813+
IV end;
814+
} lazyiv;
815815
struct { /* CXt_LOOP_LAZYSV C<for ('a'..'z')> */
816-
SV * cur;
817-
SV * end; /* maxiumum value (or minimum in reverse) */
818-
} lazysv;
819-
} state_u;
816+
SV *cur;
817+
SV *end; /* maxiumum value (or minimum in reverse) */
818+
} lazysv;
819+
} state_u;
820820
#ifdef USE_ITHREADS
821-
PAD *oldcomppad; /* needed to map itervar_u.svp during thread clone */
821+
PAD *oldcomppad; /* needed to map itervar_u.svp during thread clone */
822822
#endif
823823
};
824824

@@ -852,33 +852,33 @@ struct block_loop {
852852

853853
/* given/when context */
854854
struct block_givwhen {
855-
OP *leave_op;
856-
SV *defsv_save; /* the original $_ */
855+
OP *leave_op;
856+
SV *defsv_save; /* the original $_ */
857857
};
858858

859859

860860

861861
/* context common to subroutines, evals and loops */
862862
struct block {
863-
U8 blku_type; /* what kind of context this is */
864-
U8 blku_gimme; /* is this block running in list context? */
865-
U16 blku_u16; /* used by block_sub and block_eval (so far) */
866-
I32 blku_oldsaveix; /* saved PL_savestack_ix */
863+
U8 blku_type; /* what kind of context this is */
864+
U8 blku_gimme; /* is this block running in list context? */
865+
U16 blku_u16; /* used by block_sub and block_eval (so far) */
866+
I32 blku_oldsaveix; /* saved PL_savestack_ix */
867867
/* all the fields above must be aligned with same-sized fields as sbu */
868-
I32 blku_oldsp; /* current sp floor: where nextstate pops to */
869-
I32 blku_oldmarksp; /* mark stack index */
870-
COP * blku_oldcop; /* old curcop pointer */
871-
PMOP * blku_oldpm; /* values of pattern match vars */
872-
SSize_t blku_old_tmpsfloor; /* saved PL_tmps_floor */
873-
I32 blku_oldscopesp; /* scope stack index */
868+
I32 blku_oldsp; /* current sp floor: where nextstate pops to */
869+
I32 blku_oldmarksp; /* mark stack index */
870+
COP *blku_oldcop; /* old curcop pointer */
871+
PMOP *blku_oldpm; /* values of pattern match vars */
872+
SSize_t blku_old_tmpsfloor; /* saved PL_tmps_floor */
873+
I32 blku_oldscopesp; /* scope stack index */
874874

875875
union {
876876
struct block_sub blku_sub;
877877
struct block_format blku_format;
878878
struct block_eval blku_eval;
879879
struct block_loop blku_loop;
880880
struct block_givwhen blku_givwhen;
881-
} blk_u;
881+
} blk_u;
882882
};
883883
#define blk_oldsp cx_u.cx_blk.blku_oldsp
884884
#define blk_oldcop cx_u.cx_blk.blku_oldcop
@@ -911,21 +911,21 @@ struct block {
911911

912912
/* substitution context */
913913
struct subst {
914-
U8 sbu_type; /* same as blku_type */
915-
U8 sbu_rflags;
916-
U16 sbu_rxtainted;
917-
I32 sbu_oldsaveix; /* same as blku_oldsaveix */
914+
U8 sbu_type; /* same as blku_type */
915+
U8 sbu_rflags;
916+
U16 sbu_rxtainted;
917+
I32 sbu_oldsaveix; /* same as blku_oldsaveix */
918918
/* all the fields above must be aligned with same-sized fields as blk_u */
919-
SSize_t sbu_iters;
920-
SSize_t sbu_maxiters;
921-
char * sbu_orig;
922-
SV * sbu_dstr;
923-
SV * sbu_targ;
924-
char * sbu_s;
925-
char * sbu_m;
926-
char * sbu_strend;
927-
void * sbu_rxres;
928-
REGEXP * sbu_rx;
919+
SSize_t sbu_iters;
920+
SSize_t sbu_maxiters;
921+
char *sbu_orig;
922+
SV *sbu_dstr;
923+
SV *sbu_targ;
924+
char *sbu_s;
925+
char *sbu_m;
926+
char *sbu_strend;
927+
void *sbu_rxres;
928+
REGEXP *sbu_rx;
929929
};
930930

931931
#ifdef PERL_CORE
@@ -981,7 +981,7 @@ struct context {
981981
union {
982982
struct block cx_blk;
983983
struct subst cx_subst;
984-
} cx_u;
984+
} cx_u;
985985
};
986986
#define cx_type cx_u.cx_subst.sbu_type
987987

@@ -1121,10 +1121,10 @@ struct context {
11211121
#define PERLSI_REGCOMP 11
11221122

11231123
struct stackinfo {
1124-
AV * si_stack; /* stack for current runlevel */
1125-
PERL_CONTEXT * si_cxstack; /* context stack for runlevel */
1126-
struct stackinfo * si_prev;
1127-
struct stackinfo * si_next;
1124+
AV *si_stack; /* stack for current runlevel */
1125+
PERL_CONTEXT *si_cxstack; /* context stack for runlevel */
1126+
struct stackinfo *si_prev;
1127+
struct stackinfo *si_next;
11281128
I32 si_cxix; /* current context index */
11291129
I32 si_cxmax; /* maximum allocated index */
11301130
I32 si_cxsubix; /* topmost sub/eval/format */
@@ -1134,7 +1134,7 @@ struct stackinfo {
11341134
* with DEBUGGING, but not
11351135
* #ifdef-ed for bincompat */
11361136
#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
1137-
/* high water mark: for checking if the stack was correctly
1137+
/* high water mark: for checking if the stack was correctly
11381138
* extended / tested for extension by each pp function */
11391139
SSize_t si_stack_hwm;
11401140
#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)