Commit 1ec1de6d by Russell Belfer

Fix warnings about type conversion on win32

parent df16fbcf
...@@ -102,13 +102,13 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat ...@@ -102,13 +102,13 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
char *link_data; char *link_data;
ssize_t read_len; ssize_t read_len;
link_data = git__malloc(size); link_data = git__malloc((size_t)size);
if (!link_data) { if (!link_data) {
error = GIT_ENOMEM; error = GIT_ENOMEM;
goto cleanup; goto cleanup;
} }
read_len = p_readlink(full_path.ptr, link_data, size); read_len = p_readlink(full_path.ptr, link_data, (size_t)size);
if (read_len != (ssize_t)size) { if (read_len != (ssize_t)size) {
error = git__throw(GIT_EOSERR, "Failed to create blob. Can't read symlink"); error = git__throw(GIT_EOSERR, "Failed to create blob. Can't read symlink");
...@@ -116,7 +116,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat ...@@ -116,7 +116,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
goto cleanup; goto cleanup;
} }
stream->write(stream, link_data, size); stream->write(stream, link_data, (size_t)size);
free(link_data); free(link_data);
} else { } else {
......
...@@ -164,11 +164,11 @@ int git_odb__hashlink(git_oid *out, const char *path) ...@@ -164,11 +164,11 @@ int git_odb__hashlink(git_oid *out, const char *path)
char *link_data; char *link_data;
ssize_t read_len; ssize_t read_len;
link_data = git__malloc(size); link_data = git__malloc((size_t)size);
if (link_data == NULL) if (link_data == NULL)
return GIT_ENOMEM; return GIT_ENOMEM;
read_len = p_readlink(path, link_data, size + 1); read_len = p_readlink(path, link_data, (size_t)(size + 1));
if (read_len != (ssize_t)size) if (read_len != (ssize_t)size)
return git__throw(GIT_EOSERR, "Failed to read symlink data"); return git__throw(GIT_EOSERR, "Failed to read symlink data");
......
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