diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-03-07 04:20:22 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-03-07 04:20:22 +0100 |
commit | 75e56a3db9c1415dac1a3d83a12f694930897a8c (patch) | |
tree | 0ab5fe0a7a3312e64bfb3a0d44fda40142318f2b | |
parent | 86107d6dc7b6a182e01fb8296cb4e1680963184d (diff) | |
download | busybox-w32-75e56a3db9c1415dac1a3d83a12f694930897a8c.tar.gz busybox-w32-75e56a3db9c1415dac1a3d83a12f694930897a8c.tar.bz2 busybox-w32-75e56a3db9c1415dac1a3d83a12f694930897a8c.zip |
top: do unsigned rather than signed division in do_stats()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | procps/top.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/procps/top.c b/procps/top.c index 9bb3eed29..fc056621b 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -180,7 +180,7 @@ struct globals { | |||
180 | #else | 180 | #else |
181 | cmp_funcp sort_function[SORT_DEPTH]; | 181 | cmp_funcp sort_function[SORT_DEPTH]; |
182 | struct save_hist *prev_hist; | 182 | struct save_hist *prev_hist; |
183 | int prev_hist_count; | 183 | unsigned prev_hist_count; |
184 | jiffy_counts_t cur_jif, prev_jif; | 184 | jiffy_counts_t cur_jif, prev_jif; |
185 | /* int hist_iterations; */ | 185 | /* int hist_iterations; */ |
186 | unsigned total_pcpu; | 186 | unsigned total_pcpu; |
@@ -189,7 +189,7 @@ struct globals { | |||
189 | #if ENABLE_FEATURE_TOP_SMP_CPU | 189 | #if ENABLE_FEATURE_TOP_SMP_CPU |
190 | /* Per CPU samples: current and last */ | 190 | /* Per CPU samples: current and last */ |
191 | jiffy_counts_t *cpu_jif, *cpu_prev_jif; | 191 | jiffy_counts_t *cpu_jif, *cpu_prev_jif; |
192 | int num_cpus; | 192 | unsigned num_cpus; |
193 | #endif | 193 | #endif |
194 | #if ENABLE_FEATURE_TOP_INTERACTIVE | 194 | #if ENABLE_FEATURE_TOP_INTERACTIVE |
195 | char kbd_input[KEYCODE_BUFFER_SIZE]; | 195 | char kbd_input[KEYCODE_BUFFER_SIZE]; |
@@ -355,7 +355,8 @@ static void do_stats(void) | |||
355 | { | 355 | { |
356 | top_status_t *cur; | 356 | top_status_t *cur; |
357 | pid_t pid; | 357 | pid_t pid; |
358 | int i, last_i, n; | 358 | int n; |
359 | unsigned i, last_i; | ||
359 | struct save_hist *new_hist; | 360 | struct save_hist *new_hist; |
360 | 361 | ||
361 | get_jiffy_counts(); | 362 | get_jiffy_counts(); |