Commit 2d16373c by Ramsay Jones Committed by Vicent Marti

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 <ramsay@ramsay1.demon.co.uk>
parent e3005627
......@@ -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;
......
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