From: Doug MacEachern Date: Tue, 12 Jun 2001 22:04:50 +0000 (-0700) Subject: Re: ext/ + -Wall X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f2ea79885dcd731e16cfe839c551021222566a9;p=p5sagit%2Fp5-mst-13.2.git Re: ext/ + -Wall Message-ID: Document ax and break up dXSARGS. p4raw-id: //depot/perl@10558 --- diff --git a/XSUB.h b/XSUB.h index 13c5ea9..acc0cde 100644 --- a/XSUB.h +++ b/XSUB.h @@ -18,6 +18,11 @@ Variable which is setup by C to designate the object in a C++ XSUB. This is always the proper type for the C++ object. See C and L. +=for apidoc Amn|I32|ax +Variable which is setup by C to indicate the stack base offset, +used by the C, C and C macros. The C macro +must be called prior to setup the C variable. + =for apidoc Amn|I32|items Variable which is setup by C to indicate the number of items on the stack. See L. @@ -33,10 +38,18 @@ Used to access elements on the XSUB's stack. Macro to declare an XSUB and its C parameter list. This is handled by C. +=for apidoc Ams||dAX +Sets up the C variable. +This is usually handled automatically by C by calling C. + +=for apidoc Ams||dITEMS +Sets up the C variable. +This is usually handled automatically by C by calling C. + =for apidoc Ams||dXSARGS -Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This -is usually handled automatically by C. Declares the C -variable to indicate the number of items on the stack. +Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. +Sets up the C and C variables by calling C and C. +This is usually handled automatically by C. =for apidoc Ams||dXSI32 Sets up the C variable for an XSUB which has aliases. This is usually @@ -56,10 +69,13 @@ handled automatically by C. /* gcc -Wall: if an xsub has no arguments and PPCODE is used * and none of ST, XSRETURN or XSprePUSH macros are used * then `ax' (setup by dXSARGS) is unused. */ +#define dAX I32 ax __attribute__((unused)) = MARK - PL_stack_base + 1 + +#define dITEMS I32 items = SP - MARK + #define dXSARGS \ dSP; dMARK; \ - I32 ax __attribute__((unused)) = mark - PL_stack_base + 1; \ - I32 items = sp - mark + dAX; dITEMS #define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \ ? PAD_SV(PL_op->op_targ) : sv_newmortal()) diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 84e2dc7..d67da13 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -182,6 +182,17 @@ must then use C to assign values to these new elements. =for hackers Found in file av.c +=item ax + +Variable which is setup by C to indicate the stack base offset, +used by the C, C and C macros. The C macro +must be called prior to setup the C variable. + + I32 ax + +=for hackers +Found in file XSUB.h + =item bytes_from_utf8 Converts a string C of length C from UTF8 into byte encoding. @@ -320,6 +331,26 @@ L. =for hackers Found in file op.c +=item dAX + +Sets up the C variable. +This is usually handled automatically by C by calling C. + + dAX; + +=for hackers +Found in file XSUB.h + +=item dITEMS + +Sets up the C variable. +This is usually handled automatically by C by calling C. + + dITEMS; + +=for hackers +Found in file XSUB.h + =item dMARK Declare a stack marker variable, C, for the XSUB. See C and @@ -351,9 +382,9 @@ Found in file pp.h =item dXSARGS -Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This -is usually handled automatically by C. Declares the C -variable to indicate the number of items on the stack. +Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. +Sets up the C and C variables by calling C and C. +This is usually handled automatically by C. dXSARGS; @@ -2430,19 +2461,19 @@ false, defined or undefined. Does not handle 'get' magic. =for hackers Found in file sv.h -=item SvTYPE - -Returns the type of the SV. See C. +=item svtype - svtype SvTYPE(SV* sv) +An enum of flags for Perl types. These are found in the file B +in the C enum. Test these flags with the C macro. =for hackers Found in file sv.h -=item svtype +=item SvTYPE -An enum of flags for Perl types. These are found in the file B -in the C enum. Test these flags with the C macro. +Returns the type of the SV. See C. + + svtype SvTYPE(SV* sv) =for hackers Found in file sv.h