From owner-svn-src-all@freebsd.org Mon May 21 09:32:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F10A9EEAFAA; Mon, 21 May 2018 09:32:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0C7F764EC; Mon, 21 May 2018 09:32:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8202623271; Mon, 21 May 2018 09:32:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4L9WqGB053940; Mon, 21 May 2018 09:32:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4L9WqJZ053939; Mon, 21 May 2018 09:32:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805210932.w4L9WqJZ053939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 21 May 2018 09:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333973 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 09:32:53 -0000 Author: eadler Date: Mon May 21 09:32:52 2018 New Revision: 333973 URL: https://svnweb.freebsd.org/changeset/base/333973 Log: top(1): clean up some "const" related warnings This leaves at WARNS=6: 35 warnings in top.c 88 warnings in machine.c all of which are either "incompatible-pointer-types-discards-qualifiers" or "cast-qual" Modified: head/usr.bin/top/commands.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Mon May 21 09:25:21 2018 (r333972) +++ head/usr.bin/top/commands.c Mon May 21 09:32:52 2018 (r333973) @@ -177,8 +177,8 @@ int *intp; static struct errs errs[ERRMAX]; static int errcnt; -static char *err_toomany = " too many errors occurred"; -static char *err_listem = +static char err_toomany[] = " too many errors occurred"; +static char err_listem[] = " Many errors occurred. Press `e' to display the list of errors."; /* These macros get used to reset and log the errors */ @@ -364,6 +364,11 @@ show_errors() } } +static char no_proc_specified[] = " no processes specified"; +static char invalid_signal_number[] = " invalid_signal_number"; +static char bad_signal_name[] = " bad signal name"; +static char bad_pri_value[] = " bad priority value"; + /* * kill_procs(str) - send signals to processes, much like the "kill" * command does; invoked in response to 'k'. @@ -392,7 +397,7 @@ kill_procs(char *str) /* explicit signal specified */ if ((nptr = next_field(str)) == NULL) { - return(" kill: no processes specified"); + return(no_proc_specified); } if (isdigit(str[1])) @@ -400,7 +405,7 @@ kill_procs(char *str) scanint(str + 1, &signum); if (signum <= 0 || signum >= NSIG) { - return(" invalid signal number"); + return(invalid_signal_number); } } else @@ -418,7 +423,7 @@ kill_procs(char *str) /* was it ever found */ if (sigp->name == NULL) { - return(" bad signal name"); + return(bad_signal_name); } } /* put the new pointer in place */ @@ -487,13 +492,13 @@ renice_procs(char *str) /* check for validity */ if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX) { - return(" bad priority value"); + return(bad_pri_value); } /* move to the first process number */ if ((str = next_field(str)) == NULL) { - return(" no processes specified"); + return(no_proc_specified); } /* loop thru the process numbers, renicing each one */