X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=psi.d%2Ftime.psi;h=13959da809a39360888a6bac356f7c7682027ce8;hb=77a446cbcdce6558c00066e5f13e43e8b1b18ff7;hp=ae16b0a71d0d7544daed3de3818b25dadbfe3431;hpb=756a2c4350162a9a7f930bdc0ec7718ff13ea48c;p=m6w6%2Fext-psi diff --git a/psi.d/time.psi b/psi.d/time.psi index ae16b0a..13959da 100644 --- a/psi.d/time.psi +++ b/psi.d/time.psi @@ -18,13 +18,13 @@ function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int { // extern char *asctime(struct tm *tm); function psi\asctime(array $tm = NULL) : string { - let tm = arrval($tm); + let tm = &arrval($tm); return to_string(asctime); } // extern char *asctime_r(struct tm *tm, char *buf); function psi\asctime_r(array $tm = NULL) : string { - let tm = arrval($tm); + let tm = &arrval($tm); let buf = calloc(32, psi\SIZEOF_CHAR); return to_string(asctime_r); } @@ -64,7 +64,7 @@ function psi\gmtime_r(int $ts) : array { // extern int nanosleep(struct timespec *rqts, struct timespec *rmts); function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int { - let rqts = arrval($rq); + let rqts = &arrval($rq); let rmts = calloc(1, psi\SIZEOF_STRUCT_TIMESPEC); return to_int(nanosleep); set $rm = to_array(*rmts, @@ -77,7 +77,7 @@ function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int { function psi\times(array &$tms = NULL) : int { let buf = calloc(1, psi\SIZEOF_STRUCT_TMS); return to_int(times); - set $tms = to_array(*buf, + set $tms = to_array(buf, to_int(tms_utime), to_int(tms_stime), to_int(tms_cutime),