diff --git a/Makefile b/Makefile index 2a15469..6c9d118 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,11 @@ INSTALL = install # # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). # +# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) +# do not support the 'size specifiers' introduced by C99, namely ll, hh, +# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). +# some C compilers supported these specifiers prior to C99 as an extension. +# #-include config.mak @@ -127,6 +132,9 @@ endif ifdef NO_STRCASESTR CFLAGS += -DNO_STRCASESTR endif +ifdef NO_C99_FORMAT + CFLAGS += -DNO_C99_FORMAT +endif ifdef NO_OPENSSL CFLAGS += -DNO_OPENSSL GIT_OPTIONS += NO_OPENSSL=1 diff --git a/cgit.c b/cgit.c index d6146e2..3b3f8d9 100644 --- a/cgit.c +++ b/cgit.c @@ -610,7 +610,7 @@ static void process_cached_repolist(const char *path) hash = hash_str(path); if (ctx.cfg.project_list) hash += hash_str(ctx.cfg.project_list); - cached_rc = xstrdup(fmt("%s/rc-%8x", ctx.cfg.cache_root, hash)); + cached_rc = xstrdup(fmt("%s/rc-%8lx", ctx.cfg.cache_root, hash)); if (stat(cached_rc, &st)) { /* Nothing is cached, we need to scan without forking. And diff --git a/ui-diff.c b/ui-diff.c index 0dcabe9..7ff7e46 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -92,7 +92,7 @@ static void print_fileinfo(struct fileinfo *info) info->old_path); html("
ofs | hex dump | ascii |
---|---|---|
%04x | ", ofs); + htmlf(" | |
%04lx | ", ofs);
for (idx = 0; idx < ROWLEN && ofs + idx < size; idx++)
htmlf("%*s%02x",
idx == 16 ? 4 : 1, "",
@@ -108,7 +108,7 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
html(")\n");
if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
- htmlf(" blob size (%dKB) exceeds display size limit (%dKB). ",
+ htmlf("blob size (%ldKB) exceeds display size limit (%dKB). ",
size / 1024, ctx.cfg.max_blob_size);
return;
}
|