diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-11-30 23:45:20 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-11-30 23:45:20 +0000 |
commit | 1409bc0658469580630ba458c85fe9cc3cb2d78c (patch) | |
tree | eaf39f998048f62cc727d4d46df22cad5e2e29e6 /scope.c | |
parent | 747e2fae43204b65ccf806e75ededd01638e4351 (diff) | |
download | perl-1409bc0658469580630ba458c85fe9cc3cb2d78c.tar.gz |
Refactor all of the code of the form
SSCHECK(3);
SSPUSHINT(i);
SSPUSHPTR(ptr);
SSPUSHINT(type);
into a static function S_save_pushi32ptr().
p4raw-id: //depot/perl@34959
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 44 |
1 files changed, 21 insertions, 23 deletions
@@ -348,29 +348,36 @@ Perl_save_item(pTHX_ register SV *item) } void -Perl_save_int(pTHX_ int *intp) +Perl_save_bool(pTHX_ bool *boolp) { dVAR; - PERL_ARGS_ASSERT_SAVE_INT; + PERL_ARGS_ASSERT_SAVE_BOOL; SSCHECK(3); - SSPUSHINT(*intp); - SSPUSHPTR(intp); - SSPUSHINT(SAVEt_INT); + SSPUSHBOOL(*boolp); + SSPUSHPTR(boolp); + SSPUSHINT(SAVEt_BOOL); +} + +static void +S_save_pushi32ptr(pTHX_ const I32 i, void *const ptr, const int type) +{ + dVAR; + SSCHECK(3); + SSPUSHINT(i); + SSPUSHPTR(ptr); + SSPUSHINT(type); } void -Perl_save_bool(pTHX_ bool *boolp) +Perl_save_int(pTHX_ int *intp) { dVAR; - PERL_ARGS_ASSERT_SAVE_BOOL; + PERL_ARGS_ASSERT_SAVE_INT; - SSCHECK(3); - SSPUSHBOOL(*boolp); - SSPUSHPTR(boolp); - SSPUSHINT(SAVEt_BOOL); + save_pushi32ptr(*intp, intp, SAVEt_INT); } void @@ -380,10 +387,7 @@ Perl_save_I8(pTHX_ I8 *bytep) PERL_ARGS_ASSERT_SAVE_I8; - SSCHECK(3); - SSPUSHINT(*bytep); - SSPUSHPTR(bytep); - SSPUSHINT(SAVEt_I8); + save_pushi32ptr(*bytep, bytep, SAVEt_I8); } void @@ -393,10 +397,7 @@ Perl_save_I16(pTHX_ I16 *intp) PERL_ARGS_ASSERT_SAVE_I16; - SSCHECK(3); - SSPUSHINT(*intp); - SSPUSHPTR(intp); - SSPUSHINT(SAVEt_I16); + save_pushi32ptr(*intp, intp, SAVEt_I16); } void @@ -406,10 +407,7 @@ Perl_save_I32(pTHX_ I32 *intp) PERL_ARGS_ASSERT_SAVE_I32; - SSCHECK(3); - SSPUSHINT(*intp); - SSPUSHPTR(intp); - SSPUSHINT(SAVEt_I32); + save_pushi32ptr(*intp, intp, SAVEt_I32); } /* Cannot use save_sptr() to store a char* since the SV** cast will |