This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactoring to Sv*_set() macros - patch #5
[perl5.git] / ext / POSIX / POSIX.xs
index 25c4250..561dc30 100644 (file)
@@ -1402,7 +1402,7 @@ INIT:
            croak("sigset is not of type POSIX::SigSet");
        }
 
-       if ( items < 3 || SvTYPE(ST(2)) == SVt_NULL) {
+       if (items < 3 || ! SvOK(ST(2))) {
            oldsigset = NULL;
        } else if (sv_isa(ST(2), "POSIX::SigSet")) {
            IV tmp = SvIV((SV*)SvRV(ST(2)));
@@ -1476,7 +1476,7 @@ read(fd, buffer, nbytes)
         char *          buffer = sv_grow( sv_buffer, nbytes+1 );
     CLEANUP:
         if (RETVAL >= 0) {
-            SvCUR(sv_buffer) = RETVAL;
+            SvCUR_set(sv_buffer, RETVAL);
             SvPOK_only(sv_buffer);
             *SvEND(sv_buffer) = '\0';
             SvTAINTED_on(sv_buffer);
@@ -1652,7 +1652,7 @@ strxfrm(src)
               strxfrm(SvPVX(ST(0)), p, (size_t)dstlen);
               dstlen--;
           }
-          SvCUR(ST(0)) = dstlen;
+          SvCUR_set(ST(0), dstlen);
            SvPOK_only(ST(0));
        }