diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 749dda535..39b35170e 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -85,12 +85,6 @@ LDS_RELOC= ${LDS_PATH}/elf_${MACHINE_ARCH}_minix.xr LDS_SHARED_LIB= ${LDS_PATH}/elf_${MACHINE_ARCH}_minix.xsc LDS_N= ${LDS_PATH}/elf_${MACHINE_ARCH}_minix.xbn -# LSC In the current state there is too much to be done -# Some package have been identified by directly adding NOGCCERROR -# To their Makefiles -NOGCCERROR?= yes -NOCLANGERROR?= yes - AFLAGS+= -D__ASSEMBLY__ CFLAGS+= -fno-builtin diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 5ff979268..ac31697bf 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -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) { diff --git a/usr.bin/toproto/toproto.c b/usr.bin/toproto/toproto.c index df7aa305d..1d9113954 100644 --- a/usr.bin/toproto/toproto.c +++ b/usr.bin/toproto/toproto.c @@ -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