develooper Front page | perl.perl5.porters | Postings from January 2008

RE: compile warnings w/ PM_SETRE and ReREFCNT_inc

Thread Previous | Thread Next
From:
Robin Barker
Date:
January 7, 2008 06:10
Subject:
RE: compile warnings w/ PM_SETRE and ReREFCNT_inc
Message ID:
46A0F33545E63740BC7563DE59CA9C6D0939AE@exchsvr2.npl.ad.local
This is my patch on this subject.

I split the PM_SETRE from the ReREFCNT_inc and I don't need the (void) cast. 

(ReREFCNT_dec has similar structure to _inc and no (void) cast in use.)



Robin



diff -ur ../perl-current/pp_ctl.c ./pp_ctl.c

--- ../perl-current/pp_ctl.c	2008-01-05 22:58:58.000000000 +0000

+++ ./pp_ctl.c

@@ -212,7 +212,8 @@

     if(old != rx) {

 	if(old)

 	    ReREFCNT_dec(old);

-	PM_SETRE(pm,ReREFCNT_inc(rx));

+        ReREFCNT_inc(rx);

+	PM_SETRE(pm,rx);

     }

 

     rxres_restore(&cx->sb_rxres, rx);

@@ -309,7 +310,7 @@

 	mg->mg_len = i;

     }

     if (old != rx)

-	(void)ReREFCNT_inc(rx);

+	ReREFCNT_inc(rx);

     cx->sb_rxtainted |= RX_MATCH_TAINTED(rx);

     rxres_save(&cx->sb_rxres, rx);

     RETURNOP(pm->op_pmstashstartu.op_pmreplstart);

@@ -3849,7 +3850,8 @@

 {

     dVAR;

     PMOP *matcher = (PMOP *) newPMOP(OP_MATCH, OPf_WANT_SCALAR | OPf_STACKED);

-    PM_SETRE(matcher, ReREFCNT_inc(re));

+    ReREFCNT_inc(re);

+    PM_SETRE(matcher, re);

     

     SAVEFREEOP((OP *) matcher);

     ENTER; SAVETMPS;



-------------------------------------------------------------------

This e-mail and any attachments may contain confidential and/or

privileged material; it is for the intended addressee(s) only.

If you are not a named addressee, you must not use, retain or

disclose such information.



NPL Management Ltd cannot guarantee that the e-mail or any

attachments are free from viruses.



NPL Management Ltd. Registered in England and Wales. No: 2937881

Registered Office: Serco House, 16 Bartley Wood Business Park,

                   Hook, Hampshire, United Kingdom  RG27 9UY

-------------------------------------------------------------------

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About