[hackers] [sbase] Use off_t in humansize() as it is more descriptive and applicable || sin
commit 2deb40290e3f8248846f8e5390b88b1a2f0dd5f2
Author: sin <sin_AT_2f30.org>
Date: Tue Apr 28 11:48:05 2015 +0100
Use off_t in humansize() as it is more descriptive and applicable
diff --git a/libutil/human.c b/libutil/human.c
index 91679bc..7e39ba5 100644
--- a/libutil/human.c
+++ b/libutil/human.c
_AT_@ -6,7 +6,7 @@
#include "../util.h"
char *
-humansize(uintmax_t n)
+humansize(off_t n)
{
static char buf[16];
const char postfixes[] = "BKMGTPE";
_AT_@ -17,7 +17,7 @@ humansize(uintmax_t n)
size /= 1024;
if (!i)
- snprintf(buf, sizeof(buf), "%ju", n);
+ snprintf(buf, sizeof(buf), "%ju", (uintmax_t)n);
else
snprintf(buf, sizeof(buf), "%.1f%c", size, postfixes[i]);
diff --git a/util.h b/util.h
index d9aead1..b0bf0f4 100644
--- a/util.h
+++ b/util.h
_AT_@ -3,7 +3,6 @@
#include <regex.h>
#include <stddef.h>
-#include <stdint.h>
#include <stdio.h>
#include "arg.h"
_AT_@ -67,7 +66,7 @@ int eregcomp(regex_t *, const char *, int);
void enmasse(int, char **, int (*)(const char *, const char *, int));
void fnck(const char *, const char *, int (*)(const char *, const char *, int), int);
mode_t getumask(void);
-char *humansize(uintmax_t);
+char *humansize(off_t);
mode_t parsemode(const char *, mode_t, mode_t);
void putword(FILE *, const char *);
#undef strtonum
Received on Wed Apr 29 2015 - 17:42:57 CEST
This archive was generated by hypermail 2.3.0
: Wed Apr 29 2015 - 17:48:11 CEST