Commit b6ac07b5 by Russell Belfer

Trying to fix Win32 warnings

parent eb868b1e
......@@ -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
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 *);
......
......@@ -15,7 +15,7 @@ void test_stress_diff__cleanup(void)
#define ANOTHER_POEM \
"OH, glorious are the guarded heights\nWhere guardian souls abide—\nSelf-exiled from our gross delights—\nAbove, beyond, outside:\nAn ampler arc their spirit swings—\nCommands a juster view—\nWe have their word for all these things,\nNo doubt their words are true.\n\nYet we, the bond slaves of our day,\nWhom dirt and danger press—\nCo-heirs of insolence, delay,\nAnd leagued unfaithfulness—\nSuch is our need must seek indeed\nAnd, having found, engage\nThe men who merely do the work\nFor which they draw the wage.\n\nFrom forge and farm and mine and bench,\nDeck, altar, outpost lone—\nMill, school, battalion, counter, trench,\nRail, senate, sheepfold, throne—\nCreation's cry goes up on high\nFrom age to cheated age:\n\"Send us the men who do the work\n\"For which they draw the wage!\"\n"
static void test_with_many(size_t expected_new)
static void test_with_many(int expected_new)
{
git_index *index;
git_tree *tree, *new_tree;
......
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