Update for C++17 and fix MSVC warnings (#1694)

* Update MSVC arguments
* Fix json allocator
* Fix simulation diamond
* Bump gtest
* Remove empty varargs in unit tests
* Replace test case with test suite
* Remove deprecation warning in optional
* Remove need for NOMIXMAX to be defined in wpilib headers
This commit is contained in:
Thad House
2019-05-31 13:43:32 -07:00
committed by Peter Johnson
parent fb1239a2ad
commit 221011494d
99 changed files with 534 additions and 398 deletions

View File

@@ -50,7 +50,7 @@ protected:
SmallVectorBase() = delete;
SmallVectorBase(void *FirstEl, size_t Capacity)
: BeginX(FirstEl), Capacity(Capacity) {}
: BeginX(FirstEl), Capacity(static_cast<unsigned>(Capacity)) {}
/// This is an implementation of the grow() method which only works
/// on POD-like data types and is out of line to reduce code duplication.
@@ -75,7 +75,7 @@ public:
/// which will only be overwritten.
void set_size(size_t Size) {
assert(Size <= capacity());
this->Size = Size;
this->Size = static_cast<unsigned>(Size);
}
};
@@ -252,7 +252,7 @@ void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
// Always grow, even from zero.
size_t NewCapacity = size_t(NextPowerOf2(this->capacity() + 2));
NewCapacity = std::min(std::max(NewCapacity, MinSize), size_t(UINT32_MAX));
NewCapacity = (std::min)((std::max)(NewCapacity, MinSize), size_t(UINT32_MAX));
T *NewElts = static_cast<T*>(wpi::safe_malloc(NewCapacity*sizeof(T)));
// Move the elements over.
@@ -266,7 +266,7 @@ void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
free(this->begin());
this->BeginX = NewElts;
this->Capacity = NewCapacity;
this->Capacity = static_cast<unsigned>(NewCapacity);
}