summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-10-23 10:20:01 +0000
committermarkm <markm@FreeBSD.org>2002-10-23 10:20:01 +0000
commit373ead374cdc46cee73248a81026a66eae878932 (patch)
tree294123a82fe2f72f4babd8ad5d4a1f0b206cdccd /bin
parent77d4d24de82f01ae296c40de72da7f7481a85574 (diff)
downloadFreeBSD-src-373ead374cdc46cee73248a81026a66eae878932.zip
FreeBSD-src-373ead374cdc46cee73248a81026a66eae878932.tar.gz
Constify, staticify, rationalise types and fix other related warnings.
Diffstat (limited to 'bin')
-rw-r--r--bin/ls/print.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index ed87323..ab0a43f 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$");
#include "extern.h"
static int printaname(FTSENT *, u_long, u_long);
-static void printlink(FTSENT *);
+static void printlink(const FTSENT *);
static void printtime(time_t);
static int printtype(u_int);
static void printsize(size_t, off_t);
@@ -95,7 +95,7 @@ typedef enum {
} unit_t;
static unit_t unit_adjust(double *);
-static int unitp[] = {NONE, KILO, MEGA, GIGA, TERA, PETA};
+static unit_t unitp[] = {NONE, KILO, MEGA, GIGA, TERA, PETA};
#ifdef COLORLS
/* Most of these are taken from <sys/stat.h> */
@@ -522,7 +522,7 @@ parsecolors(const char *cs)
{
int i;
int j;
- int len;
+ size_t len;
char c[2];
short legacy_warn = 0;
@@ -579,7 +579,7 @@ colorquit(int sig)
#endif /* COLORLS */
static void
-printlink(FTSENT *p)
+printlink(const FTSENT *p)
{
int lnklen;
char name[MAXPATHLEN + 1];
@@ -624,18 +624,18 @@ printsize(size_t width, off_t bytes)
* especially on huge disks.
*
*/
-unit_t
+static unit_t
unit_adjust(double *val)
{
double abval;
unit_t unit;
- unsigned int unit_sz;
+ u_int unit_sz;
abval = fabs(*val);
- unit_sz = abval ? ilogb(abval) / 10 : 0;
+ unit_sz = abval ? (u_int)ilogb(abval) / 10 : 0;
- if (unit_sz >= UNIT_MAX) {
+ if (unit_sz >= (u_int)UNIT_MAX) {
unit = NONE;
} else {
unit = unitp[unit_sz];
OpenPOWER on IntegriCloud