diff options
| author | Kim F. Storm | 2006-08-25 23:33:30 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-08-25 23:33:30 +0000 |
| commit | 799734b06388430cca13e5933fa57d782b7b1435 (patch) | |
| tree | 6256fc610a3c6986dc203011515950069369dd59 /src | |
| parent | a9f2aeaeed9c9135c27e5abce0051b30d1467089 (diff) | |
| download | emacs-799734b06388430cca13e5933fa57d782b7b1435.tar.gz emacs-799734b06388430cca13e5933fa57d782b7b1435.zip | |
(Fcurrent_time, Fget_internal_run_time): Simplify; use list3.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/editfns.c b/src/editfns.c index 8ac61f3d006..c43528c4863 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1435,14 +1435,11 @@ resolution finer than a second. */) | |||
| 1435 | () | 1435 | () |
| 1436 | { | 1436 | { |
| 1437 | EMACS_TIME t; | 1437 | EMACS_TIME t; |
| 1438 | Lisp_Object result[3]; | ||
| 1439 | 1438 | ||
| 1440 | EMACS_GET_TIME (t); | 1439 | EMACS_GET_TIME (t); |
| 1441 | XSETINT (result[0], (EMACS_SECS (t) >> 16) & 0xffff); | 1440 | return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), |
| 1442 | XSETINT (result[1], (EMACS_SECS (t) >> 0) & 0xffff); | 1441 | make_number ((EMACS_SECS (t) >> 0) & 0xffff), |
| 1443 | XSETINT (result[2], EMACS_USECS (t)); | 1442 | make_number (EMACS_USECS (t))); |
| 1444 | |||
| 1445 | return Flist (3, result); | ||
| 1446 | } | 1443 | } |
| 1447 | 1444 | ||
| 1448 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, | 1445 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, |
| @@ -1460,7 +1457,6 @@ systems that do not provide resolution finer than a second. */) | |||
| 1460 | { | 1457 | { |
| 1461 | #ifdef HAVE_GETRUSAGE | 1458 | #ifdef HAVE_GETRUSAGE |
| 1462 | struct rusage usage; | 1459 | struct rusage usage; |
| 1463 | Lisp_Object result[3]; | ||
| 1464 | int secs, usecs; | 1460 | int secs, usecs; |
| 1465 | 1461 | ||
| 1466 | if (getrusage (RUSAGE_SELF, &usage) < 0) | 1462 | if (getrusage (RUSAGE_SELF, &usage) < 0) |
| @@ -1476,11 +1472,9 @@ systems that do not provide resolution finer than a second. */) | |||
| 1476 | secs++; | 1472 | secs++; |
| 1477 | } | 1473 | } |
| 1478 | 1474 | ||
| 1479 | XSETINT (result[0], (secs >> 16) & 0xffff); | 1475 | return list3 (make_number ((secs >> 16) & 0xffff), |
| 1480 | XSETINT (result[1], (secs >> 0) & 0xffff); | 1476 | make_number ((secs >> 0) & 0xffff), |
| 1481 | XSETINT (result[2], usecs); | 1477 | make_number (usecs)); |
| 1482 | |||
| 1483 | return Flist (3, result); | ||
| 1484 | #else | 1478 | #else |
| 1485 | return Fcurrent_time (); | 1479 | return Fcurrent_time (); |
| 1486 | #endif | 1480 | #endif |