Re: [PATCH] Sv_*set() doc's and extra const's for the SvPVX_const() tasks
[email protected] (Steve Peters) Sun, 8 May 2005 20:52:45 -0500
| Newsgroups | perl.perl5.porters,perl.ponie.dev |
|---|---|
| Message-ID | <[email protected]> |
--AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, May 08, 2005 at 08:49:17PM -0500, Steve Peters wrote: > The attached patch finishes up the previous task for cleaning up lvalue > assignments to Sv*X() macros and converting to the Sv*_set() macros.... Maybe it would be helpfule to attach the patch :-/ Steve Peters [email protected] --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="const_and_docs.patch" --- embed.fnc.old 2005-04-28 12:10:46.000000000 -0500 +++ embed.fnc 2005-05-06 19:21:34.000000000 -0500 @@ -357,7 +357,7 @@ Ap |bool |is_utf8_xdigit |const U8 *p Ap |bool |is_utf8_mark |const U8 *p p |OP* |jmaybe |OP* arg -p |I32 |keyword |char* d|I32 len +p |I32 |keyword |const char* d|I32 len Ap |void |leave_scope |I32 base p |void |lex_end p |void |lex_start |SV* line --- perl_keyword.pl.old 2005-02-14 11:52:06.000000000 -0600 +++ perl_keyword.pl 2005-05-06 19:22:07.000000000 -0500 @@ -52,7 +52,7 @@ */ I32 -Perl_keyword (pTHX_ char *name, I32 len) +Perl_keyword (pTHX_ const char *name, I32 len) { $switch unknown: --- sv.h.old 2005-04-28 06:50:19.000000000 -0500 +++ sv.h 2005-05-06 20:04:40.000000000 -0500 @@ -535,8 +535,32 @@ =for apidoc Am|HV*|SvSTASH|SV* sv Returns the stash of the SV. +=for apidoc Am|void|SvIV_set|SV* sv|IV val +Set the value of the IV pointer in sv to val. + +=for apidoc Am|void|SvNV_set|SV* sv|NV val +Set the value of the IV pointer in sv to val. + +=for apidoc Am|void|SvPV_set|SV* sv|char* val +Set the value of the PV pointer in sv to val. + +=for apidoc Am|void|SvUV_set|SV* sv|UV val +Set the value of the PV pointer in sv to val. + +=for apidoc Am|void|SvRV_set|SV* sv|SV* val +Set the value of the RV pointer in sv to val. + +=for apidoc Am|void|SvMAGIC_set|SV* sv|MAGIC* val +Set the value of the MAGIC pointer in sv to val. + +=for apidoc Am|void|SvSTASH_set|SV* sv|STASH* val +Set the value of the STASH pointer in sv to val. + =for apidoc Am|void|SvCUR_set|SV* sv|STRLEN len -Set the length of the string which is in the SV. See C<SvCUR>. +Set the current length of the string which is in the SV. See C<SvCUR>. + +=for apidoc Am|void|SvLEN_set|SV* sv|STRLEN len +Set the actual length of the string which is in the SV. =cut */ @@ -854,6 +878,8 @@ } \ } STMT_END +#define SvPVX_const(sv) (const char*)SvPVX(sv) + #define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare #define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful #define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous --- toke.c.old 2005-04-25 03:14:16.000000000 -0500 +++ toke.c 2005-05-08 20:35:32.378152592 -0500 @@ -5595,7 +5595,7 @@ */ I32 -Perl_keyword (pTHX_ char *name, I32 len) +Perl_keyword (pTHX_ const char *name, I32 len) { switch (len) { --AqsLC8rIMeq19msA--