msvc.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. diff --git a/SimTKcommon/BigMatrix/include/SimTKcommon/internal/VectorIterator.h b/SimTKcommon/BigMatrix/include/SimTKcommon/internal/VectorIterator.h
  2. index 79c07e61e..b454fcefc 100644
  3. --- a/SimTKcommon/BigMatrix/include/SimTKcommon/internal/VectorIterator.h
  4. +++ b/SimTKcommon/BigMatrix/include/SimTKcommon/internal/VectorIterator.h
  5. @@ -73,14 +73,14 @@ class VectorIterator {
  6. same vector as the source iterator. **/
  7. VectorIterator& operator=(const VectorIterator& source) = default;
  8. - ELT& operator*() {
  9. + /** Dereference the iterator to access the element it points to. Note
  10. + that although the iterator may be const, it can still point to a
  11. + mutable element. **/
  12. + ELT& operator*() const {
  13. assert (index >= 0 && index < vectorp->size());
  14. return (*vectorp)[(int)index];
  15. }
  16. - ELT& operator[](ptrdiff_t i) {
  17. - assert (i >= 0 && i < vectorp->size());
  18. - return (*vectorp)[(int)i];
  19. - }
  20. +
  21. VectorIterator& operator++() {
  22. assert (index < vectorp->size());
  23. ++index;
  24. diff --git a/SimTKcommon/Polynomial/src/cpoly.cpp b/SimTKcommon/Polynomial/src/cpoly.cpp
  25. index 3b3b6f78d..d97b78c5a 100644
  26. --- a/SimTKcommon/Polynomial/src/cpoly.cpp
  27. +++ b/SimTKcommon/Polynomial/src/cpoly.cpp
  28. @@ -602,7 +602,7 @@ T CPoly<T>::scale( const int nn, const T pt[], const T eta, const T infin, const
  29. if( infin / sc > max ) sc = 1;
  30. }
  31. l = (int)( log( sc ) / log(base ) + 0.5 );
  32. - fn_val = pow( base , l );
  33. + fn_val = T(std::pow( base , l )); // extraneous cast required by VS 16.8.2
  34. return fn_val;
  35. }
  36. diff --git a/SimTKcommon/Polynomial/src/rpoly.cpp b/SimTKcommon/Polynomial/src/rpoly.cpp
  37. index 10a399194..05afde29f 100644
  38. --- a/SimTKcommon/Polynomial/src/rpoly.cpp
  39. +++ b/SimTKcommon/Polynomial/src/rpoly.cpp
  40. @@ -143,7 +143,7 @@ int RPoly<T>::findRoots(T *op, int degree, T *zeror, T *zeroi)
  41. sc = smalno;
  42. }
  43. l = (int)(log(sc)/log(base) + 0.5);
  44. - factor = pow(base*(T) 1.0,l);
  45. + factor = T(std::pow( base, l )); // extraneous cast required by VS 16.8.2
  46. if (factor != 1.0) {
  47. for (i=0;i<=n;i++)
  48. p[i] = factor*p[i]; /* Scale polynomial. */