summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-09-21 09:34:03 -0700
committerVicent Martí <vicent@github.com>2013-09-21 09:34:03 -0700
commit92d19d16711c059c768063956abd31db346d2e7b (patch)
tree2110237444fb9e24463f159675734f1dd6f0a028 /src
parentdaef29ea3ed84c2ec558c46fa08077b5b55fe63d (diff)
parent66566516ce5171111ea4c5a8160adb4b0b0dc675 (diff)
downloadlibgit2-92d19d16711c059c768063956abd31db346d2e7b.tar.gz
Merge pull request #1840 from linquize/warning
Fix warning
Diffstat (limited to 'src')
-rw-r--r--src/attr_file.c2
-rw-r--r--src/buffer.c2
-rw-r--r--src/config_file.c4
-rw-r--r--src/diff.c3
-rw-r--r--src/index.c10
-rw-r--r--src/odb.c3
-rw-r--r--src/oid.c2
-rw-r--r--src/remote.c4
-rw-r--r--src/transports/winhttp.c4
9 files changed, 17 insertions, 17 deletions
diff --git a/src/attr_file.c b/src/attr_file.c
index 92702df98..4eb732436 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -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';
diff --git a/src/buffer.c b/src/buffer.c
index f8d47d928..1371607fe 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -154,7 +154,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)
diff --git a/src/config_file.c b/src/config_file.c
index d0910a26c..1a845d8ba 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -132,7 +132,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;
}
@@ -781,7 +781,7 @@ static int parse_section_header_ext(struct reader *reader, 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);
diff --git a/src/diff.c b/src/diff.c
index 4d9ace183..39facce60 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -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 */
}
diff --git a/src/index.c b/src/index.c
index 9b32222a7..b4f2a3b6b 100644
--- a/src/index.c
+++ b/src/index.c
@@ -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;
diff --git a/src/odb.c b/src/odb.c
index eef9748ca..b2c138aae 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -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);
@@ -623,7 +622,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;
diff --git a/src/oid.c b/src/oid.c
index a70b7e099..d56b6af24 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -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;
diff --git a/src/remote.c b/src/remote.c
index bfcb3eb65..1540f10d9 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -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;
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index 29d4ba619..592460f2a 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -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) {