fix a few more minix specific warnings

Change-Id: I1c6e2bcb4d948098d642543d7b2711284ee55c72
This commit is contained in:
Ben Gras 2013-08-26 16:43:05 +00:00 committed by Gerrit Code Review
parent 1fbbfa06c2
commit 0a4fc7b024
2 changed files with 14 additions and 13 deletions

View File

@ -230,12 +230,12 @@ static int print_memory(void)
{
FILE *fp;
unsigned int pagesize;
unsigned long total, free, largest, cached;
unsigned long total, freemem, largest, cached;
if ((fp = fopen("meminfo", "r")) == NULL)
return 0;
if (fscanf(fp, "%u %lu %lu %lu %lu", &pagesize, &total, &free,
if (fscanf(fp, "%u %lu %lu %lu %lu", &pagesize, &total, &freemem,
&largest, &cached) != 5) {
fclose(fp);
return 0;
@ -245,7 +245,7 @@ static int print_memory(void)
printf("main memory: %ldK total, %ldK free, %ldK contig free, "
"%ldK cached\n",
(pagesize * total)/1024, (pagesize * free)/1024,
(pagesize * total)/1024, (pagesize * freemem)/1024,
(pagesize * largest)/1024, (pagesize * cached)/1024);
return 1;
@ -290,7 +290,8 @@ struct tp {
static int cmp_procs(const void *v1, const void *v2)
{
struct tp *p1 = (struct tp *) v1, *p2 = (struct tp *) v2;
struct tp *p1 = (struct tp *) __UNCONST(v1),
*p2 = (struct tp *) __UNCONST(v2);
int p1blocked, p2blocked;
if(order == ORDER_MEMORY) {

View File

@ -290,18 +290,18 @@ static char * parse_mode(int mode){
}
static int
dump_entry(FILE * out, int index, const char *base_dir)
dump_entry(FILE * out, int mindex, const char *base_dir)
{
int space;
int i;
struct entry *entry = &entries[index];
struct entry *entry = &entries[mindex];
if (entry->type == ENTRY_DIR) {
for (space = 0; space < entries[index].depth; space++) {
for (space = 0; space < entries[mindex].depth; space++) {
fprintf(out, " ");
}
if (entries[index].depth > 0) {
if (entries[mindex].depth > 0) {
fprintf(out, "%s ", entry->filename);
}
fprintf(out, "d%s", parse_mode(entry->mode));
@ -313,12 +313,12 @@ dump_entry(FILE * out, int index, const char *base_dir)
dump_entry(out, i, base_dir);
}
}
for (space = 0; space < entries[index].depth; space++) {
for (space = 0; space < entries[mindex].depth; space++) {
fprintf(out, " ");
}
fprintf(out, "$\n");
} else if (entry->type == ENTRY_FILE) {
for (space = 0; space < entries[index].depth; space++) {
for (space = 0; space < entries[mindex].depth; space++) {
fprintf(out, " ");
}
/* hack skipping the first . in the path */
@ -326,7 +326,7 @@ dump_entry(FILE * out, int index, const char *base_dir)
parse_mode(entry->mode), entry->uid, entry->gid, base_dir,
&entry->path[1]);
} else if (entry->type == ENTRY_LINK) {
for (space = 0; space < entries[index].depth; space++) {
for (space = 0; space < entries[mindex].depth; space++) {
fprintf(out, " ");
}
/* hack skipping the first . in the path */
@ -335,7 +335,7 @@ dump_entry(FILE * out, int index, const char *base_dir)
} else {
/* missing "b" and "c" for block and char device? */
fprintf(out, "# ");
for (space = 1; space < entries[index].depth; space++) {
for (space = 1; space < entries[mindex].depth; space++) {
fprintf(out, " ");
}
fprintf(out, "%i %s\n", entry->type, entry->path);
@ -360,7 +360,7 @@ dump_proto(FILE * out, const char *base_dir)
}
static void
print_usage()
print_usage(void)
{
printf("Usage: toproto [OPTION]...\n");
printf