diff options
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/sysdep.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1d48a6ff155..82ff4123b18 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-06-02 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]: | ||
| 4 | Convert pctcpu and pctmem to Lisp float properly. | ||
| 5 | Let the compiler fold better, as 100.0/0x8000 is exact. | ||
| 6 | |||
| 1 | 2012-06-02 Andreas Schwab <schwab@linux-m68k.org> | 7 | 2012-06-02 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 8 | ||
| 3 | * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of | 9 | * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of |
diff --git a/src/sysdep.c b/src/sysdep.c index a82f802a785..bf87fa2ff0b 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -3107,8 +3107,8 @@ system_process_attributes (Lisp_Object pid) | |||
| 3107 | attrs = Fcons (Fcons (Qrss, make_fixnum_or_float (pinfo.pr_rssize)), attrs); | 3107 | attrs = Fcons (Fcons (Qrss, make_fixnum_or_float (pinfo.pr_rssize)), attrs); |
| 3108 | 3108 | ||
| 3109 | /* pr_pctcpu and pr_pctmem are encoded as a fixed point 16 bit number in [0 ... 1]. */ | 3109 | /* pr_pctcpu and pr_pctmem are encoded as a fixed point 16 bit number in [0 ... 1]. */ |
| 3110 | attrs = Fcons (Fcons (Qpcpu, (pinfo.pr_pctcpu * 100.0) / (double)0x8000), attrs); | 3110 | attrs = Fcons (Fcons (Qpcpu, make_float (100.0 / 0x8000 * pinfo.pr_pctcpu)), attrs); |
| 3111 | attrs = Fcons (Fcons (Qpmem, (pinfo.pr_pctmem * 100.0) / (double)0x8000), attrs); | 3111 | attrs = Fcons (Fcons (Qpmem, make_float (100.0 / 0x8000 * pinfo.pr_pctmem)), attrs); |
| 3112 | 3112 | ||
| 3113 | decoded_cmd | 3113 | decoded_cmd |
| 3114 | = code_convert_string_norecord (make_unibyte_string (pinfo.pr_fname, | 3114 | = code_convert_string_norecord (make_unibyte_string (pinfo.pr_fname, |