#else
-STATIC void vmg_mg_magical(SV *sv) {
+static void vmg_mg_magical(SV *sv) {
const MAGIC *mg;
SvMAGICAL_off(sv);
SVOP target;
} vmg_trampoline;
-STATIC void vmg_trampoline_init(vmg_trampoline *t, OP *(*cb)(pTHX)) {
+static void vmg_trampoline_init(vmg_trampoline *t, OP *(*cb)(pTHX)) {
t->temp.op_type = OP_STUB;
t->temp.op_ppaddr = 0;
t->temp.op_next = (OP *) &t->target;
t->target.op_sv = NULL;
}
-STATIC OP *vmg_trampoline_bump(pTHX_ vmg_trampoline *t, SV *sv, OP *o) {
+static OP *vmg_trampoline_bump(pTHX_ vmg_trampoline *t, SV *sv, OP *o) {
#define vmg_trampoline_bump(T, S, O) vmg_trampoline_bump(aTHX_ (T), (S), (O))
t->temp = *o;
t->temp.op_next = (OP *) &t->target;
/* --- Cleaner version of sv_magicext() ------------------------------------ */
-STATIC MAGIC *vmg_sv_magicext(pTHX_ SV *sv, SV *obj, const MGVTBL *vtbl, const void *ptr, I32 len) {
+static MAGIC *vmg_sv_magicext(pTHX_ SV *sv, SV *obj, const MGVTBL *vtbl, const void *ptr, I32 len) {
#define vmg_sv_magicext(S, O, V, P, L) vmg_sv_magicext(aTHX_ (S), (O), (V), (P), (L))
MAGIC *mg;
/* --- Safe version of call_sv() ------------------------------------------- */
-STATIC I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, int (*cleanup)(pTHX_ void *), void *ud) {
+static I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, int (*cleanup)(pTHX_ void *), void *ud) {
#define vmg_call_sv(S, F, C, U) vmg_call_sv(aTHX_ (S), (F), (C), (U))
I32 ret, cxix;
PERL_CONTEXT saved_cx;
OPc_MAX
} opclass;
-STATIC const char *const vmg_opclassnames[] = {
+static const char *const vmg_opclassnames[] = {
"B::NULL",
"B::OP",
"B::UNOP",
NULL
};
-STATIC opclass vmg_opclass(const OP *o) {
+static opclass vmg_opclass(const OP *o) {
#if 0
if (!o)
return OPc_NULL;
/* --- Error messages ------------------------------------------------------ */
-STATIC const char vmg_invalid_wiz[] = "Invalid wizard object";
-STATIC const char vmg_wrongargnum[] = "Wrong number of arguments";
-STATIC const char vmg_argstorefailed[] = "Error while storing arguments";
+static const char vmg_invalid_wiz[] = "Invalid wizard object";
+static const char vmg_wrongargnum[] = "Wrong number of arguments";
+static const char vmg_argstorefailed[] = "Error while storing arguments";
/* --- Context-safe global data -------------------------------------------- */
U32 refcount;
} vmg_vtable;
-STATIC vmg_vtable *vmg_vtable_alloc(pTHX) {
+static vmg_vtable *vmg_vtable_alloc(pTHX) {
#define vmg_vtable_alloc() vmg_vtable_alloc(aTHX)
vmg_vtable *t;
#define vmg_vtable_vtbl(T) (T)->vtbl
-STATIC perl_mutex vmg_vtable_refcount_mutex;
+static perl_mutex vmg_vtable_refcount_mutex;
-STATIC vmg_vtable *vmg_vtable_dup(pTHX_ vmg_vtable *t) {
+static vmg_vtable *vmg_vtable_dup(pTHX_ vmg_vtable *t) {
#define vmg_vtable_dup(T) vmg_vtable_dup(aTHX_ (T))
VMG_LOCK(&vmg_vtable_refcount_mutex);
++t->refcount;
return t;
}
-STATIC void vmg_vtable_free(pTHX_ vmg_vtable *t) {
+static void vmg_vtable_free(pTHX_ vmg_vtable *t) {
#define vmg_vtable_free(T) vmg_vtable_free(aTHX_ (T))
U32 refcount;
typedef MGVTBL vmg_vtable;
-STATIC vmg_vtable *vmg_vtable_alloc(pTHX) {
+static vmg_vtable *vmg_vtable_alloc(pTHX) {
#define vmg_vtable_alloc() vmg_vtable_alloc(aTHX)
vmg_vtable *t;
#endif /* VMG_UVAR */
} vmg_wizard;
-STATIC void vmg_op_info_init(pTHX_ unsigned int opinfo);
+static void vmg_op_info_init(pTHX_ unsigned int opinfo);
-STATIC vmg_wizard *vmg_wizard_alloc(pTHX_ UV opinfo) {
+static vmg_wizard *vmg_wizard_alloc(pTHX_ UV opinfo) {
#define vmg_wizard_alloc(O) vmg_wizard_alloc(aTHX_ (O))
vmg_wizard *w;
return w;
}
-STATIC void vmg_wizard_free(pTHX_ vmg_wizard *w) {
+static void vmg_wizard_free(pTHX_ vmg_wizard *w) {
#define vmg_wizard_free(W) vmg_wizard_free(aTHX_ (W))
if (!w)
return;
z->cb_ ## N = (w->cb_ ## N) ? SvREFCNT_inc(sv_dup(w->cb_ ## N, params)) \
: NULL;
-STATIC const vmg_wizard *vmg_wizard_dup(pTHX_ const vmg_wizard *w, CLONE_PARAMS *params) {
+static const vmg_wizard *vmg_wizard_dup(pTHX_ const vmg_wizard *w, CLONE_PARAMS *params) {
#define vmg_wizard_dup(W, P) vmg_wizard_dup(aTHX_ (W), (P))
vmg_wizard *z;
/* --- Wizard SV objects --------------------------------------------------- */
-STATIC int vmg_wizard_sv_free(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_wizard_sv_free(pTHX_ SV *sv, MAGIC *mg) {
vmg_wizard_free((vmg_wizard *) mg->mg_ptr);
return 0;
#if VMG_THREADSAFE
-STATIC int vmg_wizard_sv_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
+static int vmg_wizard_sv_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
mg->mg_ptr = (char *) vmg_wizard_dup((const vmg_wizard *) mg->mg_ptr, params);
return 0;
#endif /* VMG_THREADSAFE */
-STATIC MGVTBL vmg_wizard_sv_vtbl = {
+static MGVTBL vmg_wizard_sv_vtbl = {
NULL, /* get */
NULL, /* set */
NULL, /* len */
#endif /* MGf_LOCAL */
};
-STATIC SV *vmg_wizard_sv_new(pTHX_ const vmg_wizard *w) {
+static SV *vmg_wizard_sv_new(pTHX_ const vmg_wizard *w) {
#define vmg_wizard_sv_new(W) vmg_wizard_sv_new(aTHX_ (W))
SV *wiz;
#define vmg_sv_has_wizard_type(S) (SvTYPE(S) >= SVt_PVMG)
-STATIC const vmg_wizard *vmg_wizard_from_sv_nocheck(const SV *wiz) {
+static const vmg_wizard *vmg_wizard_from_sv_nocheck(const SV *wiz) {
MAGIC *mg;
for (mg = SvMAGIC(wiz); mg; mg = mg->mg_moremagic) {
#define vmg_wizard_from_sv(W) (vmg_sv_has_wizard_type(W) ? vmg_wizard_from_sv_nocheck(W) : NULL)
-STATIC const vmg_wizard *vmg_wizard_from_mg(const MAGIC *mg) {
+static const vmg_wizard *vmg_wizard_from_mg(const MAGIC *mg) {
if (mg->mg_type == PERL_MAGIC_ext && mg->mg_len == HEf_SVKEY) {
SV *sv = (SV *) mg->mg_ptr;
/* --- User-level functions implementation --------------------------------- */
-STATIC const MAGIC *vmg_find(const SV *sv, const vmg_wizard *w) {
+static const MAGIC *vmg_find(const SV *sv, const vmg_wizard *w) {
const MAGIC *mg;
IV wid;
/* ... Construct private data .............................................. */
-STATIC SV *vmg_data_new(pTHX_ SV *ctor, SV *sv, SV **args, I32 items) {
+static SV *vmg_data_new(pTHX_ SV *ctor, SV *sv, SV **args, I32 items) {
#define vmg_data_new(C, S, A, I) vmg_data_new(aTHX_ (C), (S), (A), (I))
I32 i;
SV *nsv;
return nsv;
}
-STATIC SV *vmg_data_get(pTHX_ SV *sv, const vmg_wizard *w) {
+static SV *vmg_data_get(pTHX_ SV *sv, const vmg_wizard *w) {
#define vmg_data_get(S, W) vmg_data_get(aTHX_ (S), (W))
const MAGIC *mg = vmg_find(sv, w);
#if VMG_UVAR
-STATIC I32 vmg_svt_val(pTHX_ IV, SV *);
+static I32 vmg_svt_val(pTHX_ IV, SV *);
typedef struct {
struct ufuncs new_uf;
#endif /* VMG_UVAR */
-STATIC void vmg_mg_del(pTHX_ SV *sv, MAGIC *prevmagic, MAGIC *mg, MAGIC *moremagic) {
+static void vmg_mg_del(pTHX_ SV *sv, MAGIC *prevmagic, MAGIC *mg, MAGIC *moremagic) {
#define vmg_mg_del(S, P, M, N) vmg_mg_del(aTHX_ (S), (P), (M), (N))
dMY_CXT;
}
}
-STATIC int vmg_magic_chain_free(pTHX_ MAGIC *mg, MAGIC *skip) {
+static int vmg_magic_chain_free(pTHX_ MAGIC *mg, MAGIC *skip) {
#define vmg_magic_chain_free(M, S) vmg_magic_chain_free(aTHX_ (M), (S))
int skipped = 0;
return skipped;
}
-STATIC UV vmg_cast(pTHX_ SV *sv, const vmg_wizard *w, const SV *wiz, SV **args, I32 items) {
+static UV vmg_cast(pTHX_ SV *sv, const vmg_wizard *w, const SV *wiz, SV **args, I32 items) {
#define vmg_cast(S, W, WIZ, A, I) vmg_cast(aTHX_ (S), (W), (WIZ), (A), (I))
MAGIC *mg;
MGVTBL *t;
return 1;
}
-STATIC UV vmg_dispell(pTHX_ SV *sv, const vmg_wizard *w) {
+static UV vmg_dispell(pTHX_ SV *sv, const vmg_wizard *w) {
#define vmg_dispell(S, W) vmg_dispell(aTHX_ (S), (W))
#if VMG_UVAR
U32 uvars = 0;
#define VMG_OP_INFO_OBJECT 2
#if VMG_THREADSAFE
-STATIC perl_mutex vmg_op_name_init_mutex;
+static perl_mutex vmg_op_name_init_mutex;
#endif
-STATIC U32 vmg_op_name_init = 0;
-STATIC unsigned char vmg_op_name_len[MAXO] = { 0 };
+static U32 vmg_op_name_init = 0;
+static unsigned char vmg_op_name_len[MAXO] = { 0 };
-STATIC void vmg_op_info_init(pTHX_ unsigned int opinfo) {
+static void vmg_op_info_init(pTHX_ unsigned int opinfo) {
#define vmg_op_info_init(W) vmg_op_info_init(aTHX_ (W))
switch (opinfo) {
case VMG_OP_INFO_NAME:
}
}
-STATIC SV *vmg_op_info(pTHX_ unsigned int opinfo) {
+static SV *vmg_op_info(pTHX_ unsigned int opinfo) {
#define vmg_op_info(W) vmg_op_info(aTHX_ (W))
if (!PL_op)
return &PL_sv_undef;
#define VMG_CB_CALL_OPINFO (VMG_OP_INFO_NAME|VMG_OP_INFO_OBJECT) /* 1|2 */
#define VMG_CB_CALL_GUARD 4
-STATIC int vmg_dispell_guard_oncroak(pTHX_ void *ud) {
+static int vmg_dispell_guard_oncroak(pTHX_ void *ud) {
dMY_CXT;
MY_CXT.depth--;
return 1;
}
-STATIC int vmg_dispell_guard_free(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_dispell_guard_free(pTHX_ SV *sv, MAGIC *mg) {
vmg_magic_chain_free((MAGIC *) mg->mg_ptr, NULL);
return 0;
#if VMG_THREADSAFE
-STATIC int vmg_dispell_guard_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
+static int vmg_dispell_guard_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
/* The freed magic tokens aren't cloned by perl because it cannot reach them
* (they have been detached from their parent SV when they were enqueued).
* Hence there's nothing to purge in the new thread. */
#endif /* VMG_THREADSAFE */
-STATIC MGVTBL vmg_dispell_guard_vtbl = {
+static MGVTBL vmg_dispell_guard_vtbl = {
NULL, /* get */
NULL, /* set */
NULL, /* len */
#endif /* MGf_LOCAL */
};
-STATIC SV *vmg_dispell_guard_new(pTHX_ MAGIC *root) {
+static SV *vmg_dispell_guard_new(pTHX_ MAGIC *root) {
#define vmg_dispell_guard_new(R) vmg_dispell_guard_new(aTHX_ (R))
SV *guard;
return guard;
}
-STATIC int vmg_cb_call(pTHX_ SV *cb, unsigned int flags, SV *sv, ...) {
+static int vmg_cb_call(pTHX_ SV *cb, unsigned int flags, SV *sv, ...) {
va_list ap;
int ret = 0;
unsigned int i, args, opinfo;
/* ... Default no-op magic callback ........................................ */
-STATIC int vmg_svt_default_noop(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_svt_default_noop(pTHX_ SV *sv, MAGIC *mg) {
return 0;
}
/* ... get magic ........................................................... */
-STATIC int vmg_svt_get(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_svt_get(pTHX_ SV *sv, MAGIC *mg) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
return vmg_cb_call1(w->cb_get, w->opinfo, sv, mg->mg_obj);
/* ... set magic ........................................................... */
-STATIC int vmg_svt_set(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_svt_set(pTHX_ SV *sv, MAGIC *mg) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
return vmg_cb_call1(w->cb_set, w->opinfo, sv, mg->mg_obj);
/* ... len magic ........................................................... */
-STATIC U32 vmg_sv_len(pTHX_ SV *sv) {
+static U32 vmg_sv_len(pTHX_ SV *sv) {
#define vmg_sv_len(S) vmg_sv_len(aTHX_ (S))
STRLEN len;
#if VMG_HAS_PERL(5, 9, 3)
return DO_UTF8(sv) ? utf8_length(s, s + len) : len;
}
-STATIC U32 vmg_svt_len(pTHX_ SV *sv, MAGIC *mg) {
+static U32 vmg_svt_len(pTHX_ SV *sv, MAGIC *mg) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
unsigned int opinfo = w->opinfo;
U32 len, ret;
return ret;
}
-STATIC U32 vmg_svt_len_noop(pTHX_ SV *sv, MAGIC *mg) {
+static U32 vmg_svt_len_noop(pTHX_ SV *sv, MAGIC *mg) {
U32 len = 0;
svtype t = SvTYPE(sv);
/* ... clear magic ......................................................... */
-STATIC int vmg_svt_clear(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_svt_clear(pTHX_ SV *sv, MAGIC *mg) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
unsigned int flags = w->opinfo;
#if VMG_PROPAGATE_ERRSV_NEEDS_TRAMPOLINE
-STATIC OP *vmg_pp_propagate_errsv(pTHX) {
+static OP *vmg_pp_propagate_errsv(pTHX) {
SVOP *o = cSVOPx(PL_op);
if (o->op_sv) {
#endif /* VMG_PROPAGATE_ERRSV_NEEDS_TRAMPOLINE */
-STATIC int vmg_propagate_errsv_free(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_propagate_errsv_free(pTHX_ SV *sv, MAGIC *mg) {
if (mg->mg_obj)
sv_setsv(ERRSV, mg->mg_obj);
/* perl is already kind enough to handle the cloning of the mg_obj member,
hence we don't need to define a dup magic callback. */
-STATIC MGVTBL vmg_propagate_errsv_vtbl = {
+static MGVTBL vmg_propagate_errsv_vtbl = {
0, /* get */
0, /* set */
0, /* len */
I32 base;
} vmg_svt_free_cleanup_ud;
-STATIC int vmg_svt_free_cleanup(pTHX_ void *ud_) {
+static int vmg_svt_free_cleanup(pTHX_ void *ud_) {
vmg_svt_free_cleanup_ud *ud = VOID2(vmg_svt_free_cleanup_ud *, ud_);
if (ud->in_eval) {
}
}
-STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
+static int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
vmg_svt_free_cleanup_ud ud;
const vmg_wizard *w;
int ret = 0;
/* ... copy magic .......................................................... */
-STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, VMG_SVT_COPY_KEYLEN_TYPE keylen) {
+static int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, VMG_SVT_COPY_KEYLEN_TYPE keylen) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
SV *keysv;
int ret;
return ret;
}
-STATIC int vmg_svt_copy_noop(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, VMG_SVT_COPY_KEYLEN_TYPE keylen) {
+static int vmg_svt_copy_noop(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, VMG_SVT_COPY_KEYLEN_TYPE keylen) {
return 0;
}
/* ... dup magic ........................................................... */
#if 0
-STATIC int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) {
+static int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) {
return 0;
}
#define vmg_svt_dup_noop vmg_svt_dup
#if MGf_LOCAL
-STATIC int vmg_svt_local(pTHX_ SV *nsv, MAGIC *mg) {
+static int vmg_svt_local(pTHX_ SV *nsv, MAGIC *mg) {
const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg);
return vmg_cb_call1(w->cb_local, w->opinfo, nsv, mg->mg_obj);
#if VMG_UVAR
-STATIC OP *vmg_pp_reset_rmg(pTHX) {
+static OP *vmg_pp_reset_rmg(pTHX) {
SVOP *o = cSVOPx(PL_op);
SvRMAGICAL_on(o->op_sv);
return NORMAL;
}
-STATIC I32 vmg_svt_val(pTHX_ IV action, SV *sv) {
+static I32 vmg_svt_val(pTHX_ IV action, SV *sv) {
vmg_uvar_ud *ud;
MAGIC *mg, *umg, *moremagic;
SV *key = NULL, *newkey = NULL;