]> git.proxmox.com Git - libgit2.git/commitdiff
msvc: Fix an "conversion, loss of data" compiler warning
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Tue, 1 Jun 2010 18:30:29 +0000 (19:30 +0100)
committerAndreas Ericsson <ae@op5.se>
Wed, 2 Jun 2010 09:18:55 +0000 (11:18 +0200)
In particular, the compiler issues the following warning:

    src/revwalk.c(61) : warning C4244: '=' : conversion from \
        'unsigned int' to 'unsigned char', possible loss of data

In order to suppress the warning, we change the type of the
sorting "enum" field of the git_revpool structure to be consistent
with the sort_mode parameter of the gitrp_sorting() function.

Note that if the size of the git_revpool structure is an issue,
then we could change the type of the sort_mode parameter instead.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <ae@op5.se>
src/revwalk.h

index 8929a79acf82b9414cc37bb9f464c9d0bcb384d8..f7c4cf4a40255c3b0ca8d8981121e329478a92dd 100644 (file)
@@ -14,7 +14,7 @@ struct git_revpool {
        git_revpool_table *commits;
 
        unsigned walking:1;
-       unsigned char sorting;
+       unsigned int sorting;
 };
 
 void gitrp__prepare_walk(git_revpool *pool);