• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得cocoaqtpythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

external/busybox


Commit MetaInfo

Revisionb1908e4209a4da0ce17a437823d2fbf01f7defea (tree)
Time2020-04-14 08:42:51
AuthorDenys Vlasenko <vda.linux@goog...>
CommiterMauro Rossi

Log Message

top: do unsigned rather than signed division in do_stats()

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Change Summary

Incremental Difference

--- a/procps/top.c
+++ b/procps/top.c
@@ -168,7 +168,7 @@ struct globals {
168168 #else
169169 cmp_funcp sort_function[SORT_DEPTH];
170170 struct save_hist *prev_hist;
171- int prev_hist_count;
171+ unsigned prev_hist_count;
172172 jiffy_counts_t cur_jif, prev_jif;
173173 /* int hist_iterations; */
174174 unsigned total_pcpu;
@@ -177,7 +177,7 @@ struct globals {
177177 #if ENABLE_FEATURE_TOP_SMP_CPU
178178 /* Per CPU samples: current and last */
179179 jiffy_counts_t *cpu_jif, *cpu_prev_jif;
180- int num_cpus;
180+ unsigned num_cpus;
181181 #endif
182182 #if ENABLE_FEATURE_USE_TERMIOS
183183 char kbd_input[KEYCODE_BUFFER_SIZE];
@@ -343,7 +343,8 @@ static void do_stats(void)
343343 {
344344 top_status_t *cur;
345345 pid_t pid;
346- int i, last_i, n;
346+ int n;
347+ unsigned i, last_i;
347348 struct save_hist *new_hist;
348349
349350 get_jiffy_counts();