summaryrefslogtreecommitdiffstats
path: root/bin/ls/print.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-08-16 16:09:24 +0000
committerkrw <krw@openbsd.org>2016-08-16 16:09:24 +0000
commit4442fdb76b12f63502bed7662eb4f521b9516472 (patch)
tree7b4b657b8ef4ea37f6f2cb5f30b6d65880708c6f /bin/ls/print.c
parentAvoid a compiler warning about use of uninitialized l.beg emitted (diff)
downloadwireguard-openbsd-4442fdb76b12f63502bed7662eb4f521b9516472.tar.xz
wireguard-openbsd-4442fdb76b12f63502bed7662eb4f521b9516472.zip
Bring types of variables used with struct stat into the modern world.
Replace a couple of u_long paramaters with int as they were only passed int values and the function re-cast them to (int) anyway. Weird. ok tedu@
Diffstat (limited to 'bin/ls/print.c')
-rw-r--r--bin/ls/print.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index c96f9b4d34a..6810e92a169 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.36 2016/08/15 16:57:53 krw Exp $ */
+/* $OpenBSD: print.c,v 1.37 2016/08/16 16:09:24 krw Exp $ */
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/*
@@ -52,11 +52,11 @@
#include "ls.h"
#include "extern.h"
-static int printaname(FTSENT *, u_long, u_long);
+static int printaname(FTSENT *, int, int);
static void printlink(FTSENT *);
static void printsize(int, off_t);
static void printtime(time_t);
-static int printtype(u_int);
+static int printtype(mode_t);
static int compute_columns(DISPLAY *, int *);
#define IS_NOPRINT(p) ((p)->fts_number == NO_PRINT)
@@ -219,7 +219,7 @@ printcol(DISPLAY *dp)
* return # of characters printed, no trailing characters.
*/
static int
-printaname(FTSENT *p, u_long inodefield, u_long sizefield)
+printaname(FTSENT *p, int inodefield, int sizefield)
{
struct stat *sp;
int chcnt;
@@ -227,10 +227,10 @@ printaname(FTSENT *p, u_long inodefield, u_long sizefield)
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
- chcnt += printf("%*llu ", (int)inodefield,
+ chcnt += printf("%*llu ", inodefield,
(unsigned long long)sp->st_ino);
if (f_size)
- chcnt += printf("%*lld ", (int)sizefield,
+ chcnt += printf("%*lld ", sizefield,
howmany((long long)sp->st_blocks, blocksize));
chcnt += mbsprint(p->fts_name, 1);
if (f_type || (f_typedir && S_ISDIR(sp->st_mode)))
@@ -323,7 +323,7 @@ printstream(DISPLAY *dp)
}
static int
-printtype(u_int mode)
+printtype(mode_t mode)
{
switch (mode & S_IFMT) {
case S_IFDIR: