From 2d16373cb8d8c22b3ec99a6936b82821e99e64a5 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 12 Oct 2010 19:12:50 +0100 Subject: [PATCH] msvc: Fix an "conversion, possible loss of data" warning In particular, msvc complains thus: t0603-sort.c(23) : warning C4244: 'function' : conversion from \ 'time_t' to 'unsigned int', possible loss of data Note that msvc, by default, defines time_t as a 64-bit type, whereas srand() is expecting an (32-bit) unsigned int. In order to suppress the warning, we simply cast the return value of the time() function call to 'unsigned int'. Signed-off-by: Ramsay Jones --- tests/t0603-sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/t0603-sort.c b/tests/t0603-sort.c index 0735f982d..28292377a 100644 --- a/tests/t0603-sort.c +++ b/tests/t0603-sort.c @@ -20,7 +20,7 @@ void randomize_entries(git_index *index) unsigned int i, j; git_index_entry tmp; - srand(time(NULL)); + srand((unsigned int)time(NULL)); for (i = 0; i < index->entry_count; ++i) { j = rand() % index->entry_count;