Merge pull request #5143 from libgit2/ethomson/warnings

ci: build with ENABLE_WERROR on Windows
This commit is contained in:
Patrick Steinhardt
2019-07-05 11:56:16 +02:00
committed by GitHub
14 changed files with 28 additions and 28 deletions

View File

@@ -33,7 +33,7 @@ static void parse_opts(struct opts *o, int argc, char *argv[]);
int lg2_blame(git_repository *repo, int argc, char *argv[])
{
int line, break_on_null_hunk;
size_t i, rawsize;
git_off_t i, rawsize;
char spec[1024] = {0};
struct opts o = {0};
const char *rawdata;
@@ -91,7 +91,7 @@ int lg2_blame(git_repository *repo, int argc, char *argv[])
i = 0;
break_on_null_hunk = 0;
while (i < rawsize) {
const char *eol = memchr(rawdata + i, '\n', rawsize - i);
const char *eol = memchr(rawdata + i, '\n', (size_t)(rawsize - i));
char oid[10] = {0};
const git_blame_hunk *hunk = git_blame_get_hunk_byline(blame, line);

View File

@@ -17,9 +17,9 @@ static void print_progress(const progress_data *pd)
0;
int checkout_percent = pd->total_steps > 0
? (100 * pd->completed_steps) / pd->total_steps
? (int)((100 * pd->completed_steps) / pd->total_steps)
: 0;
int kbytes = pd->fetch_progress.received_bytes / 1024;
size_t kbytes = pd->fetch_progress.received_bytes / 1024;
if (pd->fetch_progress.total_objects &&
pd->fetch_progress.received_objects == pd->fetch_progress.total_objects) {
@@ -27,7 +27,7 @@ static void print_progress(const progress_data *pd)
pd->fetch_progress.indexed_deltas,
pd->fetch_progress.total_deltas);
} else {
printf("net %3d%% (%4d kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4" PRIuZ "/%4" PRIuZ ") %s\n",
printf("net %3d%% (%4"PRIuZ" kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4" PRIuZ "/%4" PRIuZ ") %s\n",
network_percent, kbytes,
pd->fetch_progress.received_objects, pd->fetch_progress.total_objects,
index_percent, pd->fetch_progress.indexed_objects, pd->fetch_progress.total_objects,

View File

@@ -54,7 +54,7 @@ static void opts_add_commit(describe_options *opts, const char *commit)
assert(opts != NULL);
sz = ++opts->commit_count * sizeof(opts->commits[0]);
opts->commits = xrealloc(opts->commits, sz);
opts->commits = xrealloc((void *) opts->commits, sz);
opts->commits[opts->commit_count - 1] = commit;
}

View File

@@ -624,7 +624,7 @@ static void revwalking(git_repository *repo)
static void index_walking(git_repository *repo)
{
git_index *index;
unsigned int i, ecount;
size_t i, ecount;
printf("\n*Index Walking*\n");

View File

@@ -11,7 +11,7 @@
# define read _read
# define close _close
#define ssize_t unsigned int
#define ssize_t int
#else
# include <unistd.h>
#endif

View File

@@ -57,7 +57,7 @@ static void opts_add_refish(merge_options *opts, const char *refish)
assert(opts != NULL);
sz = ++opts->heads_count * sizeof(opts->heads[0]);
opts->heads = xrealloc(opts->heads, sz);
opts->heads = xrealloc((void *) opts->heads, sz);
opts->heads[opts->heads_count - 1] = refish;
}
@@ -355,7 +355,7 @@ int lg2_merge(git_repository *repo, int argc, char **argv)
}
cleanup:
free(opts.heads);
free((char **)opts.heads);
free(opts.annotated);
return 0;

View File

@@ -17,7 +17,7 @@
int lg2_show_index(git_repository *repo, int argc, char** argv)
{
git_index *index;
unsigned int i, ecount;
size_t i, ecount;
char *dir = ".";
size_t dirlen;
char out[GIT_OID_HEXSZ+1];