diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d33f9..b3461ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,23 +15,23 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) if (MSVC) # I'm not too sure about fp:fast? The docs seem to say that it doesn't # invalidate non-finite floating point values, so it appears to be OK? - + # The following warnings have been disabled: - + # Warning C4464: relative paths in include # I should fix these, but I don't want them spamming up # the console before I do. - + # Warning C4100: unused function parameter # Fixing these would clutter up function definitions that # have a common template, e.g. int foo(int bar) would have # to be turned into int foo(int /*bar*/) whenever we don't # use the bar paramete. That's too ugly, so I'm removing this. - + # Warning C4127: conditional expression is constant # Triggered by external libraries and thus not something we # can do anything about. - + # Warning C4244: implicit conversion may lead to loss of data # Mostly size_t/int problems. Fixing them is going to take a # lot of time and I don't want them spamming up the console diff --git a/src/ballots.h b/src/ballots.h index 65dabb4..0d52a68 100644 --- a/src/ballots.h +++ b/src/ballots.h @@ -14,7 +14,7 @@ #include const size_t SIZE_T_NA = (size_t)-1; - +const double DOUBLE_NA = -1; // Ballot components. An ordering is just that, but it also includes ratings // (if so declared), so that loser-elimination/average-elimination can work, @@ -161,7 +161,7 @@ class ballot_group { } void replace_score(size_t candidate_number, double new_score) { - candscore this_cddt(SIZE_T_NA, SIZE_T_NA); + candscore this_cddt(SIZE_T_NA, DOUBLE_NA); bool found_candidate = false; for (candscore cs: contents) { if (cs.get_candidate_num() == candidate_number) { diff --git a/src/modes/barycentric.cc b/src/modes/barycentric.cc index d2344f4..6e92d32 100644 --- a/src/modes/barycentric.cc +++ b/src/modes/barycentric.cc @@ -7,6 +7,8 @@ #include "../spookyhash/SpookyV2.h" +typedef unsigned char u_char; // not supported by MSVC + // Turns a string of the type "ABC" into a ranked ballot corresponding // to A>B>C. ordering strict_ballot(std::string input) {