aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Grehan <grehan@FreeBSD.org>2004-01-22 07:23:36 +0000
committerPeter Grehan <grehan@FreeBSD.org>2004-01-22 07:23:36 +0000
commit5cfe0423e65c346d83d1f90d5e3fd6b1cb2e310c (patch)
tree376d48213587a799597a88ac216bca01388a3cb4
parent53cd4099fb837b9083922b5c3ec44ec26d2bfe3a (diff)
downloadsrc-5cfe0423e65c346d83d1f90d5e3fd6b1cb2e310c.tar.gz
src-5cfe0423e65c346d83d1f90d5e3fd6b1cb2e310c.zip
Userland signed char fixes for PPC build. Problems were using a char
return for getopt() and comparing to -1, ditto with fgetc() and EOF, and using the kg_nice value from <sys/user.h> Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: obrien, bde (a while back) Tested lightly on: ppc, i386, make universe
Notes
Notes: svn path=/head/; revision=124830
-rw-r--r--sbin/atm/fore_dnld/fore_dnld.c3
-rw-r--r--sbin/camcontrol/modeedit.c10
-rw-r--r--sbin/devfs/devfs.c2
-rw-r--r--sbin/devfs/rule.c2
-rw-r--r--sbin/mdmfs/mdmfs.c3
-rw-r--r--sbin/quotacheck/quotacheck.c4
-rw-r--r--usr.bin/locale/locale.c2
-rw-r--r--usr.bin/uuencode/uuencode.c2
-rw-r--r--usr.sbin/edquota/edquota.c4
-rw-r--r--usr.sbin/getfmac/getfmac.c4
-rw-r--r--usr.sbin/getpmac/getpmac.c4
-rw-r--r--usr.sbin/mixer/mixer.c2
-rw-r--r--usr.sbin/quotaon/quotaon.c4
-rw-r--r--usr.sbin/repquota/repquota.c4
-rw-r--r--usr.sbin/sa/main.c3
-rw-r--r--usr.sbin/watch/watch.c4
16 files changed, 29 insertions, 28 deletions
diff --git a/sbin/atm/fore_dnld/fore_dnld.c b/sbin/atm/fore_dnld/fore_dnld.c
index bc3cde94eb78..263b2f7bdf0c 100644
--- a/sbin/atm/fore_dnld/fore_dnld.c
+++ b/sbin/atm/fore_dnld/fore_dnld.c
@@ -903,8 +903,7 @@ main(int argc, char *argv[])
u_char *ram; /* pointer to RAM */
Mon960 *Mon; /* Uart */
Aali *aap;
- char c;
- int i, err;
+ int c, i, err;
int binary = 0; /* Send binary file */
caddr_t buf; /* Ioctl buffer */
char bus_dev[80]; /* Bus device to mmap on */
diff --git a/sbin/camcontrol/modeedit.c b/sbin/camcontrol/modeedit.c
index 1702f1990e72..3fb9587e206a 100644
--- a/sbin/camcontrol/modeedit.c
+++ b/sbin/camcontrol/modeedit.c
@@ -362,6 +362,7 @@ load_format(const char *pagedb_path, int page)
int found;
int lineno;
enum { LOCATE, PAGENAME, PAGEDEF } state;
+ int ch;
char c;
#define SETSTATE_LOCATE do { \
@@ -397,19 +398,20 @@ load_format(const char *pagedb_path, int page)
lineno = 0;
found = 0;
SETSTATE_LOCATE;
- while ((c = fgetc(pagedb)) != EOF) {
+ while ((ch = fgetc(pagedb)) != EOF) {
/* Keep a line count to make error messages more useful. */
UPDATE_LINENO;
/* Skip over comments anywhere in the mode database. */
- if (c == '#') {
+ if (ch == '#') {
do {
- c = fgetc(pagedb);
- } while (c != '\n' && c != EOF);
+ ch = fgetc(pagedb);
+ } while (ch != '\n' && ch != EOF);
UPDATE_LINENO;
continue;
}
+ c = ch;
/* Strip out newline characters. */
if (c == '\n')
diff --git a/sbin/devfs/devfs.c b/sbin/devfs/devfs.c
index 92d1c0f3a323..f531f7521cb1 100644
--- a/sbin/devfs/devfs.c
+++ b/sbin/devfs/devfs.c
@@ -59,7 +59,7 @@ main(int ac, char **av)
{
const char *mountpt;
struct cmd *c;
- char ch;
+ int ch;
mountpt = NULL;
while ((ch = getopt(ac, av, "m:")) != -1)
diff --git a/sbin/devfs/rule.c b/sbin/devfs/rule.c
index f1fd908753e3..b179c9e2fb1e 100644
--- a/sbin/devfs/rule.c
+++ b/sbin/devfs/rule.c
@@ -82,7 +82,7 @@ int
rule_main(int ac, char **av)
{
struct cmd *c;
- char ch;
+ int ch;
setprogname("devfs rule");
optreset = optind = 1;
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c
index db143ccd7986..ff4d41dbafab 100644
--- a/sbin/mdmfs/mdmfs.c
+++ b/sbin/mdmfs/mdmfs.c
@@ -91,7 +91,8 @@ main(int argc, char **argv)
bool have_mdtype;
bool detach, softdep, autounit;
char *mtpoint, *unitstr;
- char ch, *p;
+ char *p;
+ int ch;
void *set;
/* Misc. initialization. */
diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c
index a5cce23f11bc..710338813836 100644
--- a/sbin/quotacheck/quotacheck.c
+++ b/sbin/quotacheck/quotacheck.c
@@ -150,9 +150,9 @@ main(argc, argv)
struct passwd *pw;
struct group *gr;
struct quotaname *auxdata;
- int i, argnum, maxrun, errs;
+ int i, argnum, maxrun, errs, ch;
long done = 0;
- char ch, *name;
+ char *name;
errs = maxrun = 0;
while ((ch = getopt(argc, argv, "aguvl:")) != -1) {
diff --git a/usr.bin/locale/locale.c b/usr.bin/locale/locale.c
index b88cce94bcf2..9a1e437e0789 100644
--- a/usr.bin/locale/locale.c
+++ b/usr.bin/locale/locale.c
@@ -211,7 +211,7 @@ struct _kwinfo {
int
main(int argc, char *argv[])
{
- char ch;
+ int ch;
int tmp;
while ((ch = getopt(argc, argv, "ackm")) != -1) {
diff --git a/usr.bin/uuencode/uuencode.c b/usr.bin/uuencode/uuencode.c
index 9a05248148cd..e4d83b446b16 100644
--- a/usr.bin/uuencode/uuencode.c
+++ b/usr.bin/uuencode/uuencode.c
@@ -77,7 +77,7 @@ main(int argc, char *argv[])
{
struct stat sb;
int base64;
- char ch;
+ int ch;
char *outfile;
base64 = 0;
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index fb1be0e07e59..a03087707419 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -107,8 +107,8 @@ main(int argc, char **argv)
int i, quotatype, range, tmpfd;
uid_t startuid, enduid;
u_int32_t *limp;
- char *protoname, *cp, *oldoptarg, ch;
- int eflag = 0, tflag = 0, pflag = 0;
+ char *protoname, *cp, *oldoptarg;
+ int eflag = 0, tflag = 0, pflag = 0, ch;
char *fspath = NULL;
char buf[30];
diff --git a/usr.sbin/getfmac/getfmac.c b/usr.sbin/getfmac/getfmac.c
index 9c3dc6d08483..351f43ece84d 100644
--- a/usr.sbin/getfmac/getfmac.c
+++ b/usr.sbin/getfmac/getfmac.c
@@ -58,9 +58,9 @@ usage(void)
int
main(int argc, char *argv[])
{
- char ch, *labellist, *string;
+ char *labellist, *string;
mac_t label;
- int hflag;
+ int ch, hflag;
int error, i;
labellist = NULL;
diff --git a/usr.sbin/getpmac/getpmac.c b/usr.sbin/getpmac/getpmac.c
index 61398608058e..ee289e8028d4 100644
--- a/usr.sbin/getpmac/getpmac.c
+++ b/usr.sbin/getpmac/getpmac.c
@@ -57,10 +57,10 @@ usage(void)
int
main(int argc, char *argv[])
{
- char ch, *labellist, *string;
+ char *labellist, *string;
mac_t label;
pid_t pid;
- int error, pid_set;
+ int ch, error, pid_set;
pid_set = 0;
pid = 0;
diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c
index f06abb38f39b..7abac464e33c 100644
--- a/usr.sbin/mixer/mixer.c
+++ b/usr.sbin/mixer/mixer.c
@@ -93,7 +93,7 @@ main(int argc, char *argv[])
int l = 0, r = 0, t = 0;
char lstr[5], rstr[5];
int n = 0, lrel = 0, rrel = 0;
- char ch;
+ int ch;
char *name;
diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c
index 3d54a27c5408..3ade757de132 100644
--- a/usr.sbin/quotaon/quotaon.c
+++ b/usr.sbin/quotaon/quotaon.c
@@ -80,9 +80,9 @@ int
main(int argc, char **argv)
{
register struct fstab *fs;
- char ch, *qfnp, *whoami;
+ char *qfnp, *whoami;
long argnum, done = 0;
- int i, offmode = 0, errs = 0;
+ int ch, i, offmode = 0, errs = 0;
whoami = rindex(*argv, '/') + 1;
if (whoami == (char *)1)
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index 5930a8a11f2b..7c0e22dd177f 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -110,9 +110,9 @@ main(int argc, char **argv)
register struct fstab *fs;
register struct passwd *pw;
register struct group *gr;
- int gflag = 0, uflag = 0, errs = 0;
+ int ch, gflag = 0, uflag = 0, errs = 0;
long i, argnum, done = 0;
- char ch, *qfnp;
+ char *qfnp;
while ((ch = getopt(argc, argv, "agnuv")) != -1) {
switch(ch) {
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c
index 2fde380a5395..fe7de23f770a 100644
--- a/usr.sbin/sa/main.c
+++ b/usr.sbin/sa/main.c
@@ -81,9 +81,8 @@ cmpf_t sa_cmp = cmp_usrsys;
int
main(int argc, char **argv)
{
- char ch;
char pathacct[] = _PATH_ACCT;
- int error = 0;
+ int ch, error = 0;
dfltargv[0] = pathacct;
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index eef44b037381..bca50967299a 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -283,9 +283,9 @@ ask_dev(char *dbuf, const char *msg)
int
main(int ac, char *av[])
{
- int res, rv, nread;
+ int ch, res, rv, nread;
size_t b_size = MIN_SIZE;
- char ch, *buf, chb[READB_LEN];
+ char *buf, chb[READB_LEN];
fd_set fd_s;
(void) setlocale(LC_TIME, "");