summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-08-22 14:45:10 -0700
committerRussell Belfer <rb@github.com>2013-08-22 14:45:10 -0700
commitb6ac07b51771641f3ae994c17f361fbd8bec36ef (patch)
tree88fb61ce2e4503621c6746e919343c05d5d7e311 /src
parenteb868b1e98d7cea8796f9b92be04843a7f819e5e (diff)
downloadlibgit2-b6ac07b51771641f3ae994c17f361fbd8bec36ef.tar.gz
Trying to fix Win32 warnings
Diffstat (limited to 'src')
-rw-r--r--src/cc-compat.h8
-rw-r--r--src/diff_tform.c6
-rw-r--r--src/sortedcache.c2
-rw-r--r--src/win32/pthread.h12
4 files changed, 17 insertions, 11 deletions
diff --git a/src/cc-compat.h b/src/cc-compat.h
index a5e4ce17e..37f1ea81e 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -54,8 +54,12 @@
#if defined (_MSC_VER)
typedef unsigned char bool;
-# define true 1
-# define false 0
+# ifndef true
+# define true 1
+# endif
+# ifndef false
+# define false 0
+# endif
#else
# include <stdbool.h>
#endif
diff --git a/src/diff_tform.c b/src/diff_tform.c
index ba35d3c14..6b8cf446e 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -859,9 +859,9 @@ find_best_matches:
}
/* write new mapping */
- tgt2src[t].idx = s;
+ tgt2src[t].idx = (uint32_t)s;
tgt2src[t].similarity = (uint32_t)similarity;
- src2tgt[s].idx = t;
+ src2tgt[s].idx = (uint32_t)t;
src2tgt[s].similarity = (uint32_t)similarity;
}
@@ -869,7 +869,7 @@ find_best_matches:
if (tgt2src_copy != NULL &&
tgt2src_copy[t].similarity < (uint32_t)similarity)
{
- tgt2src_copy[t].idx = s;
+ tgt2src_copy[t].idx = (uint32_t)s;
tgt2src_copy[t].similarity = (uint32_t)similarity;
}
diff --git a/src/sortedcache.c b/src/sortedcache.c
index 16dd6a7a1..33171c48d 100644
--- a/src/sortedcache.c
+++ b/src/sortedcache.c
@@ -271,7 +271,7 @@ int git_sortedcache_upsert(void **out, git_sortedcache *sc, const char *key)
itemlen = sc->item_path_offset + keylen + 1;
itemlen = (itemlen + 7) & ~7;
- if ((item = git_pool_mallocz(&sc->pool, itemlen)) == NULL) {
+ if ((item = git_pool_mallocz(&sc->pool, (uint32_t)itemlen)) == NULL) {
/* don't use GITERR_CHECK_ALLOC b/c of lock */
error = -1;
goto done;
diff --git a/src/win32/pthread.h b/src/win32/pthread.h
index 54e5286a6..50d836247 100644
--- a/src/win32/pthread.h
+++ b/src/win32/pthread.h
@@ -30,15 +30,16 @@ typedef SRWLOCK pthread_rwlock_t;
#define PTHREAD_RWLOCK_INITIALIZER SRWLOCK_INIT
int pthread_create(
- pthread_t *GIT_RESTRICT,
- const pthread_attr_t *GIT_RESTRICT,
+ pthread_t *GIT_RESTRICT thread,
+ const pthread_attr_t *GIT_RESTRICT attr,
void *(*start_routine)(void*),
- void *__restrict);
+ void *GIT_RESTRICT arg);
int pthread_join(pthread_t, void **);
int pthread_mutex_init(
- pthread_mutex_t *GIT_RESTRICT, const pthread_mutexattr_t *GIT_RESTRICT);
+ pthread_mutex_t *GIT_RESTRICT mutex,
+ const pthread_mutexattr_t *GIT_RESTRICT mutexattr);
int pthread_mutex_destroy(pthread_mutex_t *);
int pthread_mutex_lock(pthread_mutex_t *);
int pthread_mutex_unlock(pthread_mutex_t *);
@@ -52,7 +53,8 @@ int pthread_cond_signal(pthread_cond_t *);
int pthread_num_processors_np(void);
int pthread_rwlock_init(
- pthread_rwlock_t *GIT_RESTRICT, const pthread_rwlockattr_t *GIT_RESTRICT);
+ pthread_rwlock_t *GIT_RESTRICT lock,
+ const pthread_rwlockattr_t *GIT_RESTRICT attr);
int pthread_rwlock_rdlock(pthread_rwlock_t *);
int pthread_rwlock_rdunlock(pthread_rwlock_t *);
int pthread_rwlock_wrlock(pthread_rwlock_t *);