Fix build error on Linux for INT_MIN (#10)

* Fix compiler warnings and turn on warnings as errors

* Fix build error on Linux for INT_MIN
This commit is contained in:
James Cook 2017-06-20 08:17:23 -07:00 committed by Jacob Dufault
parent 8dd751a70f
commit 0876886c60

View File

@ -10,6 +10,7 @@
#include <doctest/doctest.h> #include <doctest/doctest.h>
#include <iostream> #include <iostream>
#include <limits>
#include <sstream> #include <sstream>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
@ -385,7 +386,7 @@ Project::Entry Project::FindCompilationEntryForFile(const std::string& filename)
// We couldn't find the file. Try to infer it. // We couldn't find the file. Try to infer it.
// TODO: Cache inferred file in a separate array (using a lock or similar) // TODO: Cache inferred file in a separate array (using a lock or similar)
Entry* best_entry = nullptr; Entry* best_entry = nullptr;
int best_score = INT_MIN; int best_score = std::numeric_limits<int>::min();
for (Entry& entry : entries) { for (Entry& entry : entries) {
int score = ComputeGuessScore(filename, entry.filename); int score = ComputeGuessScore(filename, entry.filename);
if (score > best_score) { if (score > best_score) {