diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2013-12-09 10:25:36 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2013-12-09 11:40:44 -0500 |
| commit | 5588f0736089ab00e12cb7ea7c8143ec666738e6 (patch) | |
| tree | 1f877c23d223d4dedabafb4bc6c793efe82f9fdc /src | |
| parent | 07c5dc84fd486b380d618319b4852591d355bd81 (diff) | |
| download | libgit2-5588f0736089ab00e12cb7ea7c8143ec666738e6.tar.gz | |
Clean up warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.h | 3 | ||||
| -rw-r--r-- | src/common.h | 2 | ||||
| -rw-r--r-- | src/merge.c | 4 | ||||
| -rw-r--r-- | src/revert.c | 10 | ||||
| -rw-r--r-- | src/win32/precompiled.h | 7 |
5 files changed, 12 insertions, 14 deletions
diff --git a/src/buffer.h b/src/buffer.h index 4ca9d4d94..c88af6fef 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -7,10 +7,11 @@ #ifndef INCLUDE_buffer_h__ #define INCLUDE_buffer_h__ +#include <stdarg.h> + #include "common.h" #include "git2/strarray.h" #include "git2/buffer.h" -#include <stdarg.h> /* typedef struct { * char *ptr; diff --git a/src/common.h b/src/common.h index 159d31b2e..a1888785e 100644 --- a/src/common.h +++ b/src/common.h @@ -42,6 +42,8 @@ # endif #define GIT_STDLIB_CALL +# include <arpa/inet.h> + #endif #include "git2/types.h" diff --git a/src/merge.c b/src/merge.c index ef138c284..45387d4ad 100644 --- a/src/merge.c +++ b/src/merge.c @@ -2306,8 +2306,8 @@ done: int git_merge__indexes(git_repository *repo, git_index *index_new) { - git_index *index_repo; - unsigned int index_repo_caps; + git_index *index_repo = NULL; + unsigned int index_repo_caps = 0; git_vector paths = GIT_VECTOR_INIT; size_t index_conflicts = 0, wd_conflicts = 0, conflicts, i; char *path; diff --git a/src/revert.c b/src/revert.c index 7ed04fee3..6cfd591b4 100644 --- a/src/revert.c +++ b/src/revert.c @@ -20,15 +20,12 @@ static int write_revert_head( git_repository *repo, - const git_commit *commit, const char *commit_oidstr) { git_filebuf file = GIT_FILEBUF_INIT; git_buf file_path = GIT_BUF_INIT; int error = 0; - assert(repo && commit); - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_REVERT_HEAD_FILE)) >= 0 && (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_REVERT_FILE_MODE)) >= 0 && (error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0) @@ -44,7 +41,6 @@ static int write_revert_head( static int write_merge_msg( git_repository *repo, - const git_commit *commit, const char *commit_oidstr, const char *commit_msgline) { @@ -52,8 +48,6 @@ static int write_merge_msg( git_buf file_path = GIT_BUF_INIT; int error = 0; - assert(repo && commit); - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_MERGE_MSG_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_REVERT_FILE_MODE)) < 0 || (error = git_filebuf_printf(&file, "Revert \"%s\"\n\nThis reverts commit %s.\n", @@ -198,8 +192,8 @@ int git_revert( if ((error = git_buf_printf(&their_label, "parent of %.7s... %s", commit_oidstr, commit_msg)) < 0 || (error = revert_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 || - (error = write_revert_head(repo, commit, commit_oidstr)) < 0 || - (error = write_merge_msg(repo, commit, commit_oidstr, commit_msg)) < 0 || + (error = write_revert_head(repo, commit_oidstr)) < 0 || + (error = write_merge_msg(repo, commit_oidstr, commit_msg)) < 0 || (error = git_repository_head(&our_ref, repo)) < 0 || (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 || (error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_tree_opts)) < 0 || diff --git a/src/win32/precompiled.h b/src/win32/precompiled.h index cbfe98812..33ce106d3 100644 --- a/src/win32/precompiled.h +++ b/src/win32/precompiled.h @@ -1,6 +1,3 @@ -#include "git2.h" -#include "common.h" - #include <assert.h> #include <errno.h> #include <limits.h> @@ -9,6 +6,7 @@ #include <string.h> #include <fcntl.h> #include <time.h> +#include <stdarg.h> #include <sys/types.h> #include <sys/stat.h> @@ -20,3 +18,6 @@ #ifdef GIT_THREADS #include "win32/pthread.h" #endif + +#include "git2.h" +#include "common.h" |
