]> git.proxmox.com Git - libgit2.git/commit
msvc: Fix an "conversion, possible loss of data" warning
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Tue, 12 Oct 2010 18:12:50 +0000 (19:12 +0100)
committerVicent Marti <tanoku@gmail.com>
Tue, 26 Oct 2010 21:59:09 +0000 (00:59 +0300)
commit2d16373cb8d8c22b3ec99a6936b82821e99e64a5
tree8ce9e705cb43f5c89583741d76b70e0dcb78339d
parente30056275c2a6d857d004d850658ccf3490a7876
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>
tests/t0603-sort.c