mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 05:28:34 +00:00
Fix MSVC warnings and errors
Signed-off-by: Vicent Marti <tanoku@gmail.com>
This commit is contained in:
parent
5dc2bee153
commit
6b1eab3976
@ -212,7 +212,7 @@ static int source_resize(git_odb_source *src)
|
||||
size_t write_offset, new_size;
|
||||
void *new_data;
|
||||
|
||||
write_offset = src->write_ptr - src->raw.data;
|
||||
write_offset = (size_t)((char *)src->write_ptr - (char *)src->raw.data);
|
||||
|
||||
new_size = src->raw.len * 2;
|
||||
if ((new_data = git__malloc(new_size)) == NULL)
|
||||
@ -223,7 +223,7 @@ static int source_resize(git_odb_source *src)
|
||||
|
||||
src->raw.data = new_data;
|
||||
src->raw.len = new_size;
|
||||
src->write_ptr = new_data + write_offset;
|
||||
src->write_ptr = (char *)new_data + write_offset;
|
||||
|
||||
return GIT_SUCCESS;
|
||||
}
|
||||
@ -249,7 +249,7 @@ int git__source_printf(git_odb_source *source, const char *format, ...)
|
||||
if (did_resize)
|
||||
vsnprintf(source->write_ptr, source->raw.len - source->written_bytes, format, arglist);
|
||||
|
||||
source->write_ptr += len;
|
||||
source->write_ptr = (char *)source->write_ptr + len;
|
||||
source->written_bytes += len;
|
||||
|
||||
return GIT_SUCCESS;
|
||||
@ -267,7 +267,7 @@ int git__source_write(git_odb_source *source, const void *bytes, size_t len)
|
||||
}
|
||||
|
||||
memcpy(source->write_ptr, bytes, len);
|
||||
source->write_ptr += len;
|
||||
source->write_ptr = (char *)source->write_ptr + len;
|
||||
source->written_bytes += len;
|
||||
|
||||
return GIT_SUCCESS;
|
||||
|
@ -229,6 +229,6 @@ int git_tag__writeback(git_tag *tag, git_odb_source *src)
|
||||
int git_tag__parse(git_tag *tag)
|
||||
{
|
||||
assert(tag && tag->object.source.open);
|
||||
return parse_tag_buffer(tag, tag->object.source.raw.data, tag->object.source.raw.data + tag->object.source.raw.len);
|
||||
return parse_tag_buffer(tag, tag->object.source.raw.data, (char *)tag->object.source.raw.data + tag->object.source.raw.len);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ static const int commit_sorting_time_reverse[][6] = {
|
||||
{4, 5, 2, 1, 3, 0}
|
||||
};
|
||||
|
||||
static const int commit_count = 6;
|
||||
#define commit_count 6
|
||||
static const int result_bytes = 24;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user