1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

specifying int instead of just unsigned is better style

This commit is contained in:
deraadt 2007-10-15 02:16:35 +00:00
parent 2416ccb7fc
commit db93f2f190
12 changed files with 35 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: var.c,v 1.33 2007/08/02 11:05:54 fgsch Exp $ */
/* $OpenBSD: var.c,v 1.34 2007/10/15 02:16:35 deraadt Exp $ */
#include "sh.h"
#include <time.h>
@ -159,7 +159,7 @@ global(const char *n)
struct block *l = e->loc;
struct tbl *vp;
int c;
unsigned h;
unsigned int h;
bool array;
int val;
@ -240,7 +240,7 @@ local(const char *n, bool copy)
{
struct block *l = e->loc;
struct tbl *vp;
unsigned h;
unsigned int h;
bool array;
int val;
@ -842,7 +842,7 @@ makenv(void)
(vp->flag&(ISSET|EXPORT)) == (ISSET|EXPORT)) {
struct block *l2;
struct tbl *vp2;
unsigned h = hash(vp->name);
unsigned int h = hash(vp->name);
/* unexport any redefined instances */
for (l2 = l->next; l2 != NULL; l2 = l2->next) {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: disklabel.c,v 1.118 2007/06/25 22:53:45 deraadt Exp $ */
/* $OpenBSD: disklabel.c,v 1.119 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993
@ -39,7 +39,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.118 2007/06/25 22:53:45 deraadt Exp $";
static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.119 2007/10/15 02:16:35 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -1490,7 +1490,7 @@ getasciilabel(FILE *f, struct disklabel *lp)
continue;
}
if ('a' <= *cp && *cp <= 'z' && cp[1] == '\0') {
unsigned part = *cp - 'a';
unsigned int part = *cp - 'a';
if (part >= lp->d_npartitions) {
if (part >= MAXPARTITIONS) {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pfctl.c,v 1.269 2007/10/13 16:35:18 deraadt Exp $ */
/* $OpenBSD: pfctl.c,v 1.270 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@ -953,7 +953,7 @@ pfctl_show_src_nodes(int dev, int opts)
struct pfioc_src_nodes psn;
struct pf_src_node *p;
char *inbuf = NULL, *newinbuf = NULL;
unsigned len = 0;
unsigned int len = 0;
int i;
memset(&psn, 0, sizeof(psn));
@ -998,7 +998,7 @@ pfctl_show_states(int dev, const char *iface, int opts)
struct pfioc_states ps;
struct pfsync_state *p;
char *inbuf = NULL, *newinbuf = NULL;
unsigned len = 0;
unsigned int len = 0;
int i, dotitle = (opts & PF_OPT_SHOWALL);
memset(&ps, 0, sizeof(ps));

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pfctl_altq.c,v 1.92 2007/05/27 05:15:17 claudio Exp $ */
/* $OpenBSD: pfctl_altq.c,v 1.93 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2002
@ -138,8 +138,8 @@ qname_to_qid(const char *qname)
}
void
print_altq(const struct pf_altq *a, unsigned level, struct node_queue_bw *bw,
struct node_queue_opt *qopts)
print_altq(const struct pf_altq *a, unsigned int level,
struct node_queue_bw *bw, struct node_queue_opt *qopts)
{
if (a->qname[0] != 0) {
print_queue(a, level, bw, 1, qopts);
@ -175,10 +175,11 @@ print_altq(const struct pf_altq *a, unsigned level, struct node_queue_bw *bw,
}
void
print_queue(const struct pf_altq *a, unsigned level, struct node_queue_bw *bw,
int print_interface, struct node_queue_opt *qopts)
print_queue(const struct pf_altq *a, unsigned int level,
struct node_queue_bw *bw, int print_interface,
struct node_queue_opt *qopts)
{
unsigned i;
unsigned int i;
printf("queue ");
for (i = 0; i < level; ++i)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pfctl_parser.c,v 1.234 2006/10/31 23:46:24 mcbride Exp $ */
/* $OpenBSD: pfctl_parser.c,v 1.235 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@ -491,7 +491,7 @@ print_status(struct pf_status *s, int opts)
running = s->running ? "Enabled" : "Disabled";
if (s->since) {
unsigned sec, min, hrs, day = runtime;
unsigned int sec, min, hrs, day = runtime;
sec = day % 60;
day /= 60;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pfctl_qstats.c,v 1.30 2004/04/27 21:47:32 kjc Exp $ */
/* $OpenBSD: pfctl_qstats.c,v 1.31 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) Henning Brauer <henning@openbsd.org>
@ -233,8 +233,8 @@ pfctl_find_altq_node(struct pf_altq_node *root, const char *qname,
}
void
pfctl_print_altq_node(int dev, const struct pf_altq_node *node, unsigned level,
int opts)
pfctl_print_altq_node(int dev, const struct pf_altq_node *node,
unsigned int level, int opts)
{
const struct pf_altq_node *child;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tset.c,v 1.31 2007/09/14 14:29:20 chl Exp $ */
/* $OpenBSD: tset.c,v 1.32 2007/10/15 02:16:35 deraadt Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@ -961,9 +961,9 @@ set_tabs(void)
*/
#ifdef TERMIOS
static void
report(const char *name, int which, unsigned def)
report(const char *name, int which, unsigned int def)
{
unsigned older, newer;
unsigned int older, newer;
char *p;
newer = mode.c_cc[which];

View File

@ -1,4 +1,4 @@
/* $OpenBSD: bgpctl.c,v 1.127 2007/09/11 17:08:49 henning Exp $ */
/* $OpenBSD: bgpctl.c,v 1.128 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@ -724,7 +724,7 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
unsigned sec, min, hrs, day, week;
unsigned int sec, min, hrs, day, week;
buf = tfbuf[idx++];
if (idx == TF_BUFS)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dvmrpctl.c,v 1.3 2007/05/30 02:21:08 henning Exp $ */
/* $OpenBSD: dvmrpctl.c,v 1.4 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -444,7 +444,7 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
unsigned sec, min, hrs, day, week;
unsigned int sec, min, hrs, day, week;
if (t == 0)
return ("Stopped");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospf6ctl.c,v 1.4 2007/10/14 01:28:06 deraadt Exp $ */
/* $OpenBSD: ospf6ctl.c,v 1.5 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -457,7 +457,7 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
unsigned sec, min, hrs, day, week;
unsigned int sec, min, hrs, day, week;
if (t == 0)
return ("00:00:00");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfctl.c,v 1.40 2007/10/14 01:28:08 deraadt Exp $ */
/* $OpenBSD: ospfctl.c,v 1.41 2007/10/15 02:16:35 deraadt Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -478,7 +478,7 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
unsigned sec, min, hrs, day, week;
unsigned int sec, min, hrs, day, week;
if (t == 0)
return ("00:00:00");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ripctl.c,v 1.4 2007/09/11 17:29:05 henning Exp $
/* $OpenBSD: ripctl.c,v 1.5 2007/10/15 02:16:35 deraadt Exp $
*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -239,7 +239,7 @@ fmt_timeframe_core(time_t t)
char *buf;
static char tfbuf[TF_BUFS][TF_LEN]; /* ring buffer */
static int idx = 0;
unsigned sec, min, hrs, day, week;
unsigned int sec, min, hrs, day, week;
if (t == 0)
return ("Stopped");