diff options
Diffstat (limited to 'ext/Time')
-rw-r--r-- | ext/Time/HiRes/HiRes.xs | 3 | ||||
-rw-r--r-- | ext/Time/Piece/Piece.xs | 24 |
2 files changed, 20 insertions, 7 deletions
diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index dea852b05e..db0592aac2 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -270,6 +270,9 @@ alarm(fseconds,finterval=0) uinterval = finterval * 1000000; RETVAL = ualarm (useconds, uinterval); + OUTPUT: + RETVAL + #endif #ifdef HAS_GETTIMEOFDAY 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); + } |