* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
} f;
__attribute__ ((always_inline))
-inline unsigned int hash(off_t size, time_t mtime)
+static inline unsigned int hash(off_t size, time_t mtime)
{
return (size ^ mtime) & (NHASH - 1);
}
__attribute__ ((always_inline))
-inline int stcmp(struct stat *st1, struct stat *st2, int content_only)
+static inline int stcmp(struct stat *st1, struct stat *st2, int content_only)
{
if (content_only)
return st1->st_size != st2->st_size;
long long ndirs, nobjects, nregfiles, ncomp, nlinks, nsaved;
-void doexit(int i)
+static void doexit(int i)
{
if (verbose) {
fprintf(stderr, "\n\n");
exit(i);
}
-void usage(char *prog)
+static void usage(char *prog)
{
fprintf(stderr, "Usage: %s [-cnvhf] [-x pat] directories...\n", prog);
fprintf(stderr,
char iobuf1[NIOBUF], iobuf2[NIOBUF];
__attribute__ ((always_inline))
-inline size_t add2(size_t a, size_t b)
+static inline size_t add2(size_t a, size_t b)
{
size_t sum = a + b;
if (sum < a) {
}
__attribute__ ((always_inline))
-inline size_t add3(size_t a, size_t b, size_t c)
+static inline size_t add3(size_t a, size_t b, size_t c)
{
return add2(add2(a, b), c);
}
size_t alloc;
} dynstr;
-void growstr(dynstr * str, size_t newlen)
+static void growstr(dynstr * str, size_t newlen)
{
if (newlen < str->alloc)
return;
}
dev_t dev = 0;
-void rf(const char *name)
+static void rf(const char *name)
{
struct stat st, st2, st3;
const size_t namelen = strlen(name);
fd = open(name, O_RDONLY);
if (fd < 0)
return;
- if (st.st_size < sizeof(buf)) {
+ if ((size_t)st.st_size < sizeof(buf)) {
cksumsize = st.st_size;
memset(((char *)buf) + cksumsize, 0,
(sizeof(buf) - cksumsize) % sizeof(buf[0]));
((st.st_size + 4095) / 4096) * 4096;
if (verbose > 1)
fprintf(stderr,
- "\r%*s\r%s %s to %s, %s %ld\n",
+ "\r%*s\r%s %s to %s, %s %jd\n",
(int)(((namelen >
NAMELEN) ? 0 :
namelen) + 2),
: "Linked"), n1, n2,
(no_link ? "would save"
: "saved"),
- st.st_size);
+ (intmax_t)st.st_size);
}
close(fd);
return;