From c4dd6db19b803e88121328ac9c614c1f921405e2 Mon Sep 17 00:00:00 2001 From: David Malone Date: Sun, 15 Feb 2004 22:48:25 +0000 Subject: [PATCH] Fix some WARNS: 1) Remove some unused variables. 2) Mark some things aas static or __unused. 3) Cast to make sure we're comparing the same types. --- usr.bin/gcore/aoutcore.c | 6 +++--- usr.bin/gcore/elfcore.c | 7 +++---- usr.bin/gcore/gcore.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c index dfb871840dea..fac3fb9b91eb 100644 --- a/usr.bin/gcore/aoutcore.c +++ b/usr.bin/gcore/aoutcore.c @@ -126,7 +126,7 @@ aoutident(int efd, pid_t pid, char *binfile) errx(1, "%d: process exiting", pid); if (ki->ki_flag & P_SYSTEM) /* Swapper or pagedaemon. */ errx(1, "%d: system process", pid); - if (exec.a_text != ptoa(ki->ki_tsize)) + if (exec.a_text != (unsigned long)ptoa(ki->ki_tsize)) errx(1, "The executable %s does not belong to" " process %d!\n" "Text segment size (in bytes): executable %ld," @@ -142,8 +142,8 @@ aoutident(int efd, pid_t pid, char *binfile) * core -- * Build the core file. */ -void -aoutcore(int efd, int fd, pid_t pid) +static void +aoutcore(int efd, int fd, pid_t pid __unused) { union { struct user user; diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c index bdfd9bb459dc..c6a161d19d08 100644 --- a/usr.bin/gcore/elfcore.c +++ b/usr.bin/gcore/elfcore.c @@ -80,11 +80,10 @@ static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *); static vm_map_entry_t readmap(pid_t); static int -elf_ident(int efd, pid_t pid, char *binfile) +elf_ident(int efd, pid_t pid __unused, char *binfile __unused) { Elf_Ehdr hdr; int cnt; - uid_t uid; cnt = read(efd, &hdr, sizeof(hdr)); if (cnt != sizeof(hdr)) @@ -97,8 +96,8 @@ elf_ident(int efd, pid_t pid, char *binfile) /* * Write an ELF coredump for the given pid to the given fd. */ -void -elf_coredump(int efd, int fd, pid_t pid) +static void +elf_coredump(int efd __unused, int fd, pid_t pid) { vm_map_entry_t map; struct sseg_closure seginfo; diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c index 4db514dec8d5..7005e834ff91 100644 --- a/usr.bin/gcore/gcore.c +++ b/usr.bin/gcore/gcore.c @@ -83,7 +83,7 @@ SET_DECLARE(dumpset, struct dumpers); int main(int argc, char *argv[]) { - int ch, cnt, efd, fd, sflag; + int ch, efd, fd, sflag; char *binfile, *corefile; char fname[MAXPATHLEN]; struct dumpers **d, *dumper;