From: Malcolm Beattie Date: Thu, 13 Nov 1997 14:13:30 +0000 (+0000) Subject: Change CONTEXT to PERL_CONTEXT throughout source (since the #define X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c09156bb55f832ab6700e99026187942841f0ae4;p=p5sagit%2Fp5-mst-13.2.git Change CONTEXT to PERL_CONTEXT throughout source (since the #define to avoid the Digital UNIX clash no longer works). Changed the #ifdef in pp_sys.c for whether getnet* function get protoyped (since the default had a broken prototype for getnetbyaddr). p4raw-id: //depot/perl@247 --- diff --git a/mg.c b/mg.c index bcb9e83..e2ecdf9 100644 --- a/mg.c +++ b/mg.c @@ -1686,7 +1686,7 @@ sighandler(int sig) OP *myop = op; U32 flags = 0; I32 o_save_i = savestack_ix, type; - CONTEXT *cx; + PERL_CONTEXT *cx; XPV *tXpv = Xpv; if (savestack_ix + 15 <= savestack_max) diff --git a/op.c b/op.c index 796c034..bc672f7 100644 --- a/op.c +++ b/op.c @@ -163,7 +163,7 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix) I32 off; SV *sv; register I32 i; - register CONTEXT *cx; + register PERL_CONTEXT *cx; int saweval; for (cv = startcv; cv; cv = CvOUTSIDE(cv)) { diff --git a/perl.c b/perl.c index 7264648..bb08c6a 100644 --- a/perl.c +++ b/perl.c @@ -1226,7 +1226,7 @@ perl_call_sv(SV *sv, I32 flags) markstack_ptr--; /* we're trying to emulate pp_entertry() here */ { - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = GIMME_V; ENTER; @@ -1294,7 +1294,7 @@ perl_call_sv(SV *sv, I32 flags) SV **newsp; PMOP *newpm; I32 gimme; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 optype; POPBLOCK(cx,newpm); @@ -2448,8 +2448,8 @@ init_stacks(ARGSproto) stack_sp = stack_base; stack_max = stack_base + 127; - cxstack_max = 8192 / sizeof(CONTEXT) - 2; /* Use most of 8K. */ - New(50,cxstack,cxstack_max + 1,CONTEXT); + cxstack_max = 8192 / sizeof(PERL_CONTEXT) - 2; /* Use most of 8K. */ + New(50,cxstack,cxstack_max + 1,PERL_CONTEXT); cxstack_ix = -1; New(50,tmps_stack,128,SV*); @@ -2986,7 +2986,7 @@ static void my_exit_jump(void) { dTHR; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme; SV **newsp; diff --git a/perl.h b/perl.h index d562a31..2d49fc3 100644 --- a/perl.h +++ b/perl.h @@ -881,11 +881,6 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); #endif -/* Digital UNIX defines a typedef CONTEXT when pthreads is in use */ -#if defined(__osf__) -# define CONTEXT PERL_CONTEXT -#endif - typedef MEM_SIZE STRLEN; typedef struct op OP; @@ -914,7 +909,7 @@ typedef struct regexp REGEXP; typedef struct gp GP; typedef struct gv GV; typedef struct io IO; -typedef struct context CONTEXT; +typedef struct context PERL_CONTEXT; typedef struct block BLOCK; typedef struct magic MAGIC; @@ -1945,7 +1940,7 @@ IEXT OP * Ieval_start; IEXT COP * VOL Icurcop IINIT(&compiling); IEXT COP * Icurcopdb IINIT(NULL); IEXT line_t Icopline IINIT(NOLINE); -IEXT CONTEXT * Icxstack; +IEXT PERL_CONTEXT * Icxstack; IEXT I32 Icxstack_ix IINIT(-1); IEXT I32 Icxstack_max IINIT(128); IEXT JMPENV Istart_env; /* empty startup sigjmp() environment */ diff --git a/pp_ctl.c b/pp_ctl.c index edd0220..a39e836 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -105,7 +105,7 @@ PP(pp_substcont) { djSP; register PMOP *pm = (PMOP*) cLOGOP->op_other; - register CONTEXT *cx = &cxstack[cxstack_ix]; + register PERL_CONTEXT *cx = &cxstack[cxstack_ix]; register SV *dstr = cx->sb_dstr; register char *s = cx->sb_s; register char *m = cx->sb_m; @@ -688,7 +688,7 @@ PP(pp_sort) if (sortcop) { if (max > 1) { AV *oldstack; - CONTEXT *cx; + PERL_CONTEXT *cx; SV** newsp; bool oldcatch = CATCH_GET; @@ -846,7 +846,7 @@ dopoptolabel(char *label) { dTHR; register I32 i; - register CONTEXT *cx; + register PERL_CONTEXT *cx; for (i = cxstack_ix; i >= 0; i--) { cx = &cxstack[i]; @@ -915,7 +915,7 @@ dopoptosub(I32 startingblock) { dTHR; I32 i; - register CONTEXT *cx; + register PERL_CONTEXT *cx; for (i = startingblock; i >= 0; i--) { cx = &cxstack[i]; switch (cx->cx_type) { @@ -935,7 +935,7 @@ dopoptoeval(I32 startingblock) { dTHR; I32 i; - register CONTEXT *cx; + register PERL_CONTEXT *cx; for (i = startingblock; i >= 0; i--) { cx = &cxstack[i]; switch (cx->cx_type) { @@ -954,7 +954,7 @@ dopoptoloop(I32 startingblock) { dTHR; I32 i; - register CONTEXT *cx; + register PERL_CONTEXT *cx; for (i = startingblock; i >= 0; i--) { cx = &cxstack[i]; switch (cx->cx_type) { @@ -986,7 +986,7 @@ void dounwind(I32 cxix) { dTHR; - register CONTEXT *cx; + register PERL_CONTEXT *cx; SV **newsp; I32 optype; @@ -1021,7 +1021,7 @@ die_where(char *message) dTHR; if (in_eval) { I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme; SV **newsp; @@ -1110,7 +1110,7 @@ PP(pp_caller) { djSP; register I32 cxix = dopoptosub(cxstack_ix); - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 dbcxix; I32 gimme; SV *sv; @@ -1271,7 +1271,7 @@ PP(pp_dbstate) { SV **sp; register CV *cv; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = G_ARRAY; I32 hasargs; GV *gv; @@ -1314,7 +1314,7 @@ PP(pp_scope) PP(pp_enteriter) { djSP; dMARK; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = GIMME_V; SV **svp; @@ -1346,7 +1346,7 @@ PP(pp_enteriter) PP(pp_enterloop) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = GIMME_V; ENTER; @@ -1362,7 +1362,7 @@ PP(pp_enterloop) PP(pp_leaveloop) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; struct block_loop cxloop; I32 gimme; SV **newsp; @@ -1404,7 +1404,7 @@ PP(pp_return) { djSP; dMARK; I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; struct block_sub cxsub; bool popsub2 = FALSE; I32 gimme; @@ -1480,7 +1480,7 @@ PP(pp_last) { djSP; I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; struct block_loop cxloop; struct block_sub cxsub; I32 pop2 = 0; @@ -1561,7 +1561,7 @@ PP(pp_last) PP(pp_next) { I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 oldsave; if (op->op_flags & OPf_SPECIAL) { @@ -1586,7 +1586,7 @@ PP(pp_next) PP(pp_redo) { I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 oldsave; if (op->op_flags & OPf_SPECIAL) { @@ -1663,7 +1663,7 @@ PP(pp_goto) djSP; OP *retop = 0; I32 ix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; #define GOTO_DEPTH 64 OP *enterops[GOTO_DEPTH]; char *label; @@ -1676,7 +1676,7 @@ PP(pp_goto) /* This egregious kludge implements goto &subroutine */ if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) { I32 cxix; - register CONTEXT *cx; + register PERL_CONTEXT *cx; CV* cv = (CV*)SvRV(sv); SV** mark; I32 items = 0; @@ -2175,7 +2175,7 @@ doeval(int gimme) if (yyparse() || error_count || !eval_root) { SV **newsp; I32 gimme; - CONTEXT *cx; + PERL_CONTEXT *cx; I32 optype; op = saveop; @@ -2246,7 +2246,7 @@ doeval(int gimme) PP(pp_require) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; SV *sv; char *name; char *tryname; @@ -2396,7 +2396,7 @@ PP(pp_dofile) PP(pp_entereval) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; dPOPss; I32 gimme = GIMME_V, was = sub_generation; char tmpbuf[TYPE_DIGITS(long) + 12]; @@ -2460,7 +2460,7 @@ PP(pp_leaveeval) SV **newsp; PMOP *newpm; I32 gimme; - register CONTEXT *cx; + register PERL_CONTEXT *cx; OP *retop; U8 save_flags = op -> op_flags; I32 optype; @@ -2552,7 +2552,7 @@ PP(pp_leaveeval) PP(pp_entertry) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = GIMME_V; ENTER; @@ -2576,7 +2576,7 @@ PP(pp_leavetry) SV **newsp; PMOP *newpm; I32 gimme; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 optype; POPBLOCK(cx,newpm); diff --git a/pp_hot.c b/pp_hot.c index 141aa36..b354540 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1211,7 +1211,7 @@ do_readline(void) PP(pp_enter) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = OP_GIMME(op, -1); if (gimme == -1) { @@ -1281,7 +1281,7 @@ PP(pp_helem) PP(pp_leave) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; register SV **mark; SV **newsp; PMOP *newpm; @@ -1337,7 +1337,7 @@ PP(pp_leave) PP(pp_iter) { djSP; - register CONTEXT *cx; + register PERL_CONTEXT *cx; SV* sv; AV* av; @@ -1579,7 +1579,7 @@ PP(pp_subst) sv_setpvn(dstr, m, s-m); curpm = pm; if (!c) { - register CONTEXT *cx; + register PERL_CONTEXT *cx; PUSHSUBST(cx); RETURNOP(cPMOP->op_pmreplroot); } @@ -1680,7 +1680,7 @@ PP(pp_leavesub) SV **newsp; PMOP *newpm; I32 gimme; - register CONTEXT *cx; + register PERL_CONTEXT *cx; struct block_sub cxsub; POPBLOCK(cx,newpm); @@ -1748,7 +1748,7 @@ PP(pp_entersub) GV *gv; HV *stash; register CV *cv; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme; bool hasargs = (op->op_flags & OPf_STACKED) != 0; diff --git a/pp_sys.c b/pp_sys.c index 3a87016..041539c 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -956,7 +956,7 @@ static OP * doform(CV *cv, GV *gv, OP *retop) { dTHR; - register CONTEXT *cx; + register PERL_CONTEXT *cx; I32 gimme = GIMME_V; AV* padlist = CvPADLIST(cv); SV** svp = AvARRAY(padlist); @@ -1024,7 +1024,7 @@ PP(pp_leavewrite) PerlIO *fp; SV **newsp; I32 gimme; - register CONTEXT *cx; + register PERL_CONTEXT *cx; DEBUG_f(PerlIO_printf(Perl_debug_log, "left=%ld, todo=%ld\n", (long)IoLINES_LEFT(io), (long)FmLINES(formtarget))); @@ -3737,8 +3737,12 @@ PP(pp_gnetent) I32 which = op->op_type; register char **elem; register SV *sv; -#ifndef DONT_DECLARE_STD +#ifdef NETDB_H_OMITS_GETNET struct netent *getnetbyname(const char *); + /* + * long is wrong for getnetbyadddr (e.g. on Alpha). POSIX.1g says + * in_addr_t but then such systems don't have broken netdb.h anyway. + */ struct netent *getnetbyaddr(long int, int); struct netent *getnetent(void); #endif diff --git a/proto.h b/proto.h index b5d60f6..b86ecd0 100644 --- a/proto.h +++ b/proto.h @@ -64,7 +64,7 @@ CV* cv_clone _((CV* proto)); SV* cv_const_sv _((CV* cv)); void cv_undef _((CV* cv)); #ifdef DEBUGGING -void cx_dump _((CONTEXT* cs)); +void cx_dump _((PERL_CONTEXT* cs)); #endif SV* filter_add _((filter_t funcp, SV* datasv)); void filter_del _((filter_t funcp)); diff --git a/scope.c b/scope.c index fe7cb2d..cc5c9c8 100644 --- a/scope.c +++ b/scope.c @@ -29,7 +29,7 @@ cxinc(void) { dTHR; cxstack_max = cxstack_max * 3 / 2; - Renew(cxstack, cxstack_max + 1, CONTEXT); /* XXX should fix CXINC macro */ + Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */ return cxstack_ix + 1; } @@ -683,7 +683,7 @@ leave_scope(I32 base) #ifdef DEBUGGING void -cx_dump(CONTEXT *cx) +cx_dump(PERL_CONTEXT *cx) { dTHR; PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), block_type[cx->cx_type]); diff --git a/thread.h b/thread.h index 2f81e35..d2455dc 100644 --- a/thread.h +++ b/thread.h @@ -204,7 +204,7 @@ struct thread { U8 Tlocalizing; COP * Tcurcop; - CONTEXT * Tcxstack; + PERL_CONTEXT * Tcxstack; I32 Tcxstack_ix; I32 Tcxstack_max;