Skip to content

Commit

Permalink
Fix comparison warnings in librank
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Ringle <[email protected]>
  • Loading branch information
EddieRingle committed Aug 16, 2010
1 parent 8b32302 commit 063df8d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions librank/librank.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ int main(int argc, char *argv[]) {
struct process_info *pi;

int i, j, error;
size_t k, l;

compfn = &sort_by_pss;
order = -1;
Expand Down Expand Up @@ -227,36 +228,36 @@ int main(int argc, char *argv[]) {
exit(EXIT_FAILURE);
}

for (i = 0; i < num_procs; i++) {
error = pm_process_create(ker, pids[i], &proc);
for (k = 0; k < num_procs; k++) {
error = pm_process_create(ker, pids[k], &proc);
if (error) {
fprintf(stderr, "warning: could not create process interface for %d\n", pids[i]);
fprintf(stderr, "warning: could not create process interface for %d\n", pids[k]);
continue;
}
pi = get_process(pids[i]);

pi = get_process(pids[k]);

error = pm_process_maps(proc, &maps, &num_maps);
if (error) {
fprintf(stderr, "Error listing maps for process %d.\n", proc->pid);
exit(EXIT_FAILURE);
}

for (j = 0; j < num_maps; j++) {
if (prefix && (strncmp(pm_map_name(maps[j]), prefix, prefix_len)))
for (l = 0; l < num_maps; l++) {
if (prefix && (strncmp(pm_map_name(maps[l]), prefix, prefix_len)))
continue;

li = get_library(pm_map_name(maps[j]));
li = get_library(pm_map_name(maps[l]));
if (!li)
continue;

mi = get_mapping(li, pi);
error = pm_map_usage(maps[j], &map_usage);

error = pm_map_usage(maps[l], &map_usage);
if (error) {
fprintf(stderr, "Error getting map memory usage of "
"map %s in process %d.\n",
pm_map_name(maps[j]), proc->pid);
pm_map_name(maps[l]), proc->pid);
exit(EXIT_FAILURE);
}
pm_memusage_add(&mi->usage, &map_usage);
Expand Down

0 comments on commit 063df8d

Please sign in to comment.