summaryrefslogtreecommitdiff
path: root/ext/Time/Piece/Piece.xs
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2001-06-11 15:19:45 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-12 13:13:27 +0000
commitc6c619a96fa11b09bef26d0c724b6cfd0bdbb34b (patch)
tree00f4b8ab49ed4e56e2be3401170b6d1b6bca3e61 /ext/Time/Piece/Piece.xs
parent6676db263f08eab1c09a46739d7c3c0d2ea7f6df (diff)
downloadperl-c6c619a96fa11b09bef26d0c724b6cfd0bdbb34b.tar.gz
ext/ + -Wall
Message-ID: <Pine.LNX.4.21.0106112212261.24181-100000@mako.covalent.net> p4raw-id: //depot/perl@10534
Diffstat (limited to 'ext/Time/Piece/Piece.xs')
-rw-r--r--ext/Time/Piece/Piece.xs24
1 files changed, 17 insertions, 7 deletions
diff --git a/ext/Time/Piece/Piece.xs b/ext/Time/Piece/Piece.xs
index a639af5d60..bae2d4c7bf 100644
--- a/ext/Time/Piece/Piece.xs
+++ b/ext/Time/Piece/Piece.xs
@@ -25,11 +25,21 @@ __strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -
int wday
int yday
int isdst
+
+ PREINIT:
+ char *buf = NULL;
+
CODE:
- {
- char *buf = my_strftime(fmt, sec, min, hour, mday, mon, year, wday, yday, isdst);
- if (buf) {
- ST(0) = sv_2mortal(newSVpv(buf, 0));
- Safefree(buf);
- }
- }
+ #XXX: an sv_strftime() that can make use of the TARG would faster
+ buf = my_strftime(fmt, sec, min, hour, mday, mon, year, wday, yday, isdst);
+ if (buf) {
+ RETVAL = buf;
+ }
+
+ OUTPUT:
+ RETVAL
+
+ CLEANUP:
+ if (buf) {
+ Safefree(buf);
+ }