summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-04-14 23:11:06 +0200
committerVicent Marti <vicent@github.com>2014-04-14 23:11:06 +0200
commit289e31cd24f80fa8ed77e40eeb9295964256cb6a (patch)
tree534661a3997ea60424127b5af4767ac162fd36a5
parent06d772d8d45e3e2830614a62a51910547afb6666 (diff)
parentefaa342cbb62069510a3787da433e6b5b935fcde (diff)
downloadlibgit2-289e31cd24f80fa8ed77e40eeb9295964256cb6a.tar.gz
Merge pull request #2264 from jacquesg/fix-warnings
Correct C90 warnings
-rw-r--r--src/global.c3
-rw-r--r--tests/repo/open.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/global.c b/src/global.c
index 8c8f55a90..c26b4b311 100644
--- a/src/global.c
+++ b/src/global.c
@@ -183,6 +183,7 @@ int git_threads_init(void)
void git_threads_shutdown(void)
{
+ void *ptr = NULL;
pthread_once_t new_once = PTHREAD_ONCE_INIT;
if (git_atomic_dec(&git__n_inits) > 0) return;
@@ -190,7 +191,7 @@ void git_threads_shutdown(void)
/* Shut down any subsystems that have global state */
git__shutdown();
- void *ptr = pthread_getspecific(_tls_key);
+ ptr = pthread_getspecific(_tls_key);
pthread_setspecific(_tls_key, NULL);
git__free(ptr);
diff --git a/tests/repo/open.c b/tests/repo/open.c
index f7420bd3a..190adff1c 100644
--- a/tests/repo/open.c
+++ b/tests/repo/open.c
@@ -102,14 +102,13 @@ void test_repo_open__gitlinked(void)
void test_repo_open__from_git_new_workdir(void)
{
+#ifndef GIT_WIN32
/* The git-new-workdir script that ships with git sets up a bunch of
* symlinks to create a second workdir that shares the object db with
* another checkout. Libgit2 can open a repo that has been configured
* this way.
*/
- cl_git_sandbox_init("empty_standard_repo");
-#ifndef GIT_WIN32
git_repository *repo2;
git_buf link_tgt = GIT_BUF_INIT, link = GIT_BUF_INIT, body = GIT_BUF_INIT;
const char **scan;
@@ -122,6 +121,8 @@ void test_repo_open__from_git_new_workdir(void)
"HEAD", NULL
};
+ cl_git_sandbox_init("empty_standard_repo");
+
cl_git_pass(p_mkdir("alternate", 0777));
cl_git_pass(p_mkdir("alternate/.git", 0777));