Commit 66566516 by Linquize

Fix warning

parent ef6389ad
......@@ -219,7 +219,7 @@ GIT_EXTERN(unsigned int) git_index_caps(const git_index *index);
* @param caps A combination of GIT_INDEXCAP values
* @return 0 on success, -1 on failure
*/
GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps);
GIT_EXTERN(int) git_index_set_caps(git_index *index, int caps);
/**
* Update the contents of an existing index object in memory
......
......@@ -39,7 +39,7 @@ int git_attr_file__new(
attrs->key = git_pool_malloc(attrs->pool, (uint32_t)len + 3);
GITERR_CHECK_ALLOC(attrs->key);
attrs->key[0] = '0' + from;
attrs->key[0] = '0' + (char)from;
attrs->key[1] = '#';
memcpy(&attrs->key[2], path, len);
attrs->key[len + 2] = '\0';
......
......@@ -137,7 +137,7 @@ int git_buf_puts(git_buf *buf, const char *string)
return git_buf_put(buf, string, strlen(string));
}
static const char b64str[64] =
static const char b64str[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int git_buf_put_base64(git_buf *buf, const char *data, size_t len)
......
......@@ -125,7 +125,7 @@ int git_config_file_normalize_section(char *start, char *end)
if (end && scan >= end)
break;
if (isalnum(*scan))
*scan = tolower(*scan);
*scan = (char)tolower(*scan);
else if (*scan != '-' || scan == start)
return GIT_EINVALIDSPEC;
}
......@@ -737,7 +737,7 @@ static int parse_section_header_ext(diskfile_backend *cfg, const char *line, con
break;
}
git_buf_putc(&buf, c);
git_buf_putc(&buf, (char)c);
} while ((c = line[rpos++]) != ']');
*section_name = git_buf_detach(&buf);
......
......@@ -440,7 +440,8 @@ static int diff_list_apply_options(
/* If not given explicit `opts`, check `diff.xyz` configs */
if (!opts) {
diff->opts.context_lines = config_int(cfg, "diff.context", 3);
int context = config_int(cfg, "diff.context", 3);
diff->opts.context_lines = context >= 0 ? (uint16_t)context : 3;
/* add other defaults here */
}
......
......@@ -408,9 +408,9 @@ static int create_index_error(int error, const char *msg)
return error;
}
int git_index_set_caps(git_index *index, unsigned int caps)
int git_index_set_caps(git_index *index, int caps)
{
int old_ignore_case;
unsigned int old_ignore_case;
assert(index);
......@@ -438,7 +438,7 @@ int git_index_set_caps(git_index *index, unsigned int caps)
}
if (old_ignore_case != index->ignore_case) {
git_index__set_ignore_case(index, index->ignore_case);
git_index__set_ignore_case(index, (bool)index->ignore_case);
}
return 0;
......@@ -2092,7 +2092,7 @@ int git_index_add_all(
/* check if path actually matches */
if (!git_pathspec__match(
&ps.pathspec, wd->path, no_fnmatch, ignorecase, &match, NULL))
&ps.pathspec, wd->path, no_fnmatch, (bool)ignorecase, &match, NULL))
continue;
/* skip ignored items that are not already in the index */
......@@ -2184,7 +2184,7 @@ static int index_apply_to_all(
/* check if path actually matches */
if (!git_pathspec__match(
&ps.pathspec, entry->path, false, index->ignore_case,
&ps.pathspec, entry->path, false, (bool)index->ignore_case,
&match, NULL))
continue;
......
......@@ -168,7 +168,6 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
error = -1;
goto done;
return -1;
}
error = git_hash_final(out, &ctx);
......@@ -621,7 +620,7 @@ int git_odb_exists(git_odb *db, const git_oid *id)
git_odb_backend *b = internal->backend;
if (b->exists != NULL)
found = b->exists(b, id);
found = (bool)b->exists(b, id);
}
return (int)found;
......
......@@ -211,7 +211,7 @@ int git_oid_strcmp(const git_oid *oid_a, const char *str)
for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_RAWSZ; ++a) {
if ((hexval = git__fromhex(*str++)) < 0)
return -1;
strval = hexval << 4;
strval = (unsigned char)(hexval << 4);
if (*str) {
if ((hexval = git__fromhex(*str++)) < 0)
return -1;
......
......@@ -362,7 +362,7 @@ cleanup:
static int update_config_refspec(const git_remote *remote, git_config *config, int direction)
{
git_buf name = GIT_BUF_INIT;
int push;
unsigned int push;
const char *dir;
size_t i;
int error = 0;
......@@ -1549,7 +1549,7 @@ int git_remote_add_push(git_remote *remote, const char *refspec)
return add_refspec(remote, refspec, false);
}
static int copy_refspecs(git_strarray *array, git_remote *remote, int push)
static int copy_refspecs(git_strarray *array, git_remote *remote, unsigned int push)
{
size_t i;
git_vector refspecs;
......
......@@ -195,7 +195,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
}
/* Set proxy if necessary */
if (git_remote__get_http_proxy(t->owner->owner, t->use_ssl, &proxy_url) < 0)
if (git_remote__get_http_proxy(t->owner->owner, !!t->use_ssl, &proxy_url) < 0)
goto on_error;
if (proxy_url) {
......@@ -939,7 +939,7 @@ static int winhttp_connect(
t->connection = WinHttpConnect(
t->session,
host,
port,
(INTERNET_PORT)port,
0);
if (!t->connection) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment