summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-15 23:17:02 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-15 23:17:02 +0100
commitd3d348849d1e04f91e458937b2aba39c00de63af (patch)
treea0047853d605841c279608b3e98ad555131ae1f4 /ext/Socket
parentf584eb2d9f7ac11f83863d38a4f1f95cd9775aa2 (diff)
downloadperl-d3d348849d1e04f91e458937b2aba39c00de63af.tar.gz
Replace sv_2mortal(newSVpvn(...)) with newSVpvn_flags(..., SVs_TEMP)
Diffstat (limited to 'ext/Socket')
-rw-r--r--ext/Socket/Makefile.PL2
-rw-r--r--ext/Socket/Socket.pm2
-rw-r--r--ext/Socket/Socket.xs12
3 files changed, 8 insertions, 8 deletions
diff --git a/ext/Socket/Makefile.PL b/ext/Socket/Makefile.PL
index 0389b70118..d95d916b72 100644
--- a/ext/Socket/Makefile.PL
+++ b/ext/Socket/Makefile.PL
@@ -65,7 +65,7 @@ foreach qw (MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS);
push @names,
{name => $_, type => "SV",
pre=>"struct in_addr ip_address; ip_address.s_addr = htonl($_);",
- value => "sv_2mortal(newSVpvn((char *)&ip_address,sizeof ip_address ))",}
+ value => "newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP)",}
foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST);
WriteConstants(
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 1a0b7c3448..ac7866a91c 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -1,7 +1,7 @@
package Socket;
our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = "1.84";
+$VERSION = "1.85";
=head1 NAME
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 16b893b3c8..339b771847 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -276,7 +276,7 @@ inet_ntoa(ip_address_sv)
((addr.s_addr >> 16) & 0xFF),
((addr.s_addr >> 8) & 0xFF),
( addr.s_addr & 0xFF));
- ST(0) = sv_2mortal(newSVpvn(addr_str, strlen(addr_str)));
+ ST(0) = newSVpvn_flags(addr_str, strlen(addr_str), SVs_TEMP);
Safefree(addr_str);
}
@@ -347,7 +347,7 @@ pack_sockaddr_un(pathname)
} else {
addr_len = sizeof sun_ad;
}
- ST(0) = sv_2mortal(newSVpvn((char *)&sun_ad, addr_len));
+ ST(0) = newSVpvn_flags((char *)&sun_ad, addr_len, SVs_TEMP);
#else
ST(0) = (SV *) not_here("pack_sockaddr_un");
#endif
@@ -392,7 +392,7 @@ unpack_sockaddr_un(sun_sv)
&& addr_len < sizeof addr.sun_path; addr_len++);
}
- ST(0) = sv_2mortal(newSVpvn(addr.sun_path, addr_len));
+ ST(0) = newSVpvn_flags(addr.sun_path, addr_len, SVs_TEMP);
#else
ST(0) = (SV *) not_here("unpack_sockaddr_un");
#endif
@@ -425,7 +425,7 @@ pack_sockaddr_in(port, ip_address_sv)
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_addr = htonl(addr.s_addr);
- ST(0) = sv_2mortal(newSVpvn((char *)&sin, sizeof sin));
+ ST(0) = newSVpvn_flags((char *)&sin, sizeof (sin), SVs_TEMP);
}
void
@@ -455,7 +455,7 @@ unpack_sockaddr_in(sin_sv)
EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv((IV) port)));
- PUSHs(sv_2mortal(newSVpvn((char *)&ip_address, sizeof ip_address)));
+ PUSHs(newSVpvn_flags((char *)&ip_address, sizeof(ip_address), SVs_TEMP));
}
void
@@ -481,7 +481,7 @@ inet_ntop(af, ip_address_sv)
Copy( ip_address, &addr, sizeof addr, char );
inet_ntop(af, &addr, str, INET6_ADDRSTRLEN);
- ST(0) = sv_2mortal(newSVpv(str, strlen(str)));
+ ST(0) = newSVpvn_flags(str, strlen(str), SVs_TEMP);
#else
ST(0) = (SV *)not_here("inet_ntop");
#endif