Revert ntohl()/printf format to Junio's git

This commits reverts printf format strings to the
original version from Juion's git.  This is a
preparation for the mingw specific fix that follows
in the next commit.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
Steffen Prohaska
2007-11-17 19:16:53 +01:00
parent 31023be999
commit 43664aa169
10 changed files with 11 additions and 11 deletions

View File

@@ -509,7 +509,7 @@ static int get_pack(int xd[2], char **pack_lockfile)
if (read_pack_header(fd[0], &header))
die("protocol error: bad pack header");
snprintf(hdr_arg, sizeof(hdr_arg), "--pack_header=%lu,%lu",
snprintf(hdr_arg, sizeof(hdr_arg), "--pack_header=%u,%u",
ntohl(header.hdr_version), ntohl(header.hdr_entries));
if (ntohl(header.hdr_entries) < unpack_limit)
do_keep = 0;

View File

@@ -208,7 +208,7 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce)
if (!show_stage) {
fputs(tag, stdout);
} else {
printf("%s%06lo %s %d\t",
printf("%s%06o %s %d\t",
tag,
ntohl(ce->ce_mode),
abbrev ? find_unique_abbrev(ce->sha1,abbrev)

View File

@@ -318,7 +318,7 @@ static void unpack_all(void)
if (ntohl(hdr->hdr_signature) != PACK_SIGNATURE)
die("bad pack file");
if (!pack_version_ok(hdr->hdr_version))
die("unknown pack file version %lu", ntohl(hdr->hdr_version));
die("unknown pack file version %d", ntohl(hdr->hdr_version));
use(sizeof(struct pack_header));
if (!quiet)

View File

@@ -143,7 +143,7 @@ static void parse_pack_header(void)
if (hdr->hdr_signature != htonl(PACK_SIGNATURE))
die("pack signature mismatch");
if (!pack_version_ok(hdr->hdr_version))
die("pack version %lu unsupported", ntohl(hdr->hdr_version));
die("pack version %d unsupported", ntohl(hdr->hdr_version));
nr_objects = ntohl(hdr->hdr_entries);
use(sizeof(struct pack_header));

View File

@@ -48,7 +48,7 @@ static int merge_entry(int pos, const char *path)
break;
found++;
strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
sprintf(ownbuf[stage], "%lo", ntohl(ce->ce_mode));
sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
arguments[stage] = hexbuf[stage];
arguments[stage + 4] = ownbuf[stage];
} while (++pos < active_nr);

View File

@@ -152,7 +152,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
case 0: /* Special case: unmerged file in index */
return MODE_CHANGED | DATA_CHANGED | TYPE_CHANGED;
default:
die("internal error: ce_mode is %lo", ntohl(ce->ce_mode));
die("internal error: ce_mode is %o", ntohl(ce->ce_mode));
}
if (ce->ce_mtime.sec != htonl(st->st_mtime))
changed |= MTIME_CHANGED;

View File

@@ -352,7 +352,7 @@ static const char *unpack(void)
hdr_err = parse_pack_header(&hdr);
if (hdr_err)
return hdr_err;
snprintf(hdr_arg, sizeof(hdr_arg), "--pack_header=%lu,%lu",
snprintf(hdr_arg, sizeof(hdr_arg), "--pack_header=%u,%u",
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));
if (ntohl(hdr.hdr_entries) < unpack_limit) {

View File

@@ -670,13 +670,13 @@ static int open_packed_git_1(struct packed_git *p)
if (hdr.hdr_signature != htonl(PACK_SIGNATURE))
return error("file %s is not a GIT packfile", p->pack_name);
if (!pack_version_ok(hdr.hdr_version))
return error("packfile %s is version %lu and not supported"
return error("packfile %s is version %u and not supported"
" (try upgrading GIT to a newer version)",
p->pack_name, ntohl(hdr.hdr_version));
/* Verify the pack matches its index. */
if (p->num_objects != ntohl(hdr.hdr_entries))
return error("packfile %s claims to have %lu objects"
return error("packfile %s claims to have %u objects"
" while index indicates %u objects",
p->pack_name, ntohl(hdr.hdr_entries),
p->num_objects);

View File

@@ -68,7 +68,7 @@ int main(int argc, char **argv)
ntohl(off64[1]);
off64_nr++;
}
printf("%" PRIuMAX " %s (%08lx)\n", (uintmax_t) offset,
printf("%" PRIuMAX " %s (%08x)\n", (uintmax_t) offset,
sha1_to_hex(entries[i].sha1),
ntohl(entries[i].crc));
}

View File

@@ -638,7 +638,7 @@ static void show_stage_entry(FILE *o,
if (!ce)
fprintf(o, "%s (missing)\n", label);
else
fprintf(o, "%s%06lo %s %d\t%s\n",
fprintf(o, "%s%06o %s %d\t%s\n",
label,
ntohl(ce->ce_mode),
sha1_to_hex(ce->sha1),