Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more compiler warnings #204

Merged
merged 4 commits into from
Feb 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeModules/CompilerSettings.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# GCC
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=c++11 -W -Wall -Wextra -Wpedantic -Wno-missing-field-initializers -Wno-unused-parameter)
add_definitions(-std=c++11 -W -Wall -Wextra -Wpedantic -Wno-unused-parameter)
if(FCL_TREAT_WARNINGS_AS_ERRORS)
add_definitions(-Werror)
endif()
endif()

# Clang
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-std=c++11 -W -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual -Wno-deprecated-register)
add_definitions(-std=c++11 -W -Wall -Wextra -Wno-unused-parameter)
if(FCL_TREAT_WARNINGS_AS_ERRORS)
add_definitions(-Werror)
endif()
Expand All @@ -20,7 +20,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
message(FATAL_ERROR "AppleClang version must be at least 6.1!")
endif()
add_definitions(-std=c++11 -W -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual -Wno-deprecated-register)
add_definitions(-std=c++11 -W -Wall -Wextra -Wno-unused-parameter)
if(FCL_TREAT_WARNINGS_AS_ERRORS)
add_definitions(-Werror)
endif()
Expand Down
4 changes: 2 additions & 2 deletions include/fcl/math/bv/OBB-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ template <typename S>
bool obbDisjoint(const Matrix3<S>& B, const Vector3<S>& T,
const Vector3<S>& a, const Vector3<S>& b)
{
register S t, s;
S t, s;
const S reps = 1e-6;

Matrix3<S> Bf = B.cwiseAbs();
Expand Down Expand Up @@ -521,7 +521,7 @@ bool obbDisjoint(
const Vector3<S>& a,
const Vector3<S>& b)
{
register S t, s;
S t, s;
const S reps = 1e-6;

Matrix3<S> Bf = tf.linear().cwiseAbs();
Expand Down
14 changes: 7 additions & 7 deletions include/fcl/math/motion/taylor_model/taylor_model-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ template <typename S>
TaylorModel<S>& TaylorModel<S>::operator *= (const TaylorModel<S>& other)
{
assert(other.time_interval_ == time_interval_);
register S c0, c1, c2, c3;
register S c0b = other.coeffs_[0], c1b = other.coeffs_[1], c2b = other.coeffs_[2], c3b = other.coeffs_[3];
S c0, c1, c2, c3;
S c0b = other.coeffs_[0], c1b = other.coeffs_[1], c2b = other.coeffs_[2], c3b = other.coeffs_[3];

const Interval<S>& rb = other.r_;

Expand All @@ -286,7 +286,7 @@ TaylorModel<S>& TaylorModel<S>::operator *= (const TaylorModel<S>& other)
c3 = coeffs_[0] * c3b + coeffs_[1] * c2b + coeffs_[2] * c1b + coeffs_[3] * c0b;

Interval<S> remainder(r_ * rb);
register S tempVal = coeffs_[1] * c3b + coeffs_[2] * c2b + coeffs_[3] * c1b;
S tempVal = coeffs_[1] * c3b + coeffs_[2] * c2b + coeffs_[3] * c1b;
remainder += time_interval_->t4_ * tempVal;

tempVal = coeffs_[2] * c3b + coeffs_[3] * c2b;
Expand Down Expand Up @@ -368,12 +368,12 @@ Interval<S> TaylorModel<S>::getTightBound(S t0, S t1) const

if(coeffs_[3] == 0)
{
register S a = -coeffs_[1] / (2 * coeffs_[2]);
S a = -coeffs_[1] / (2 * coeffs_[2]);
Interval<S> polybounds;
if(a <= t1 && a >= t0)
{
S AQ = coeffs_[0] + a * (coeffs_[1] + a * coeffs_[2]);
register S t = t0;
S t = t0;
S LQ = coeffs_[0] + t * (coeffs_[1] + t * coeffs_[2]);
t = t1;
S RQ = coeffs_[0] + t * (coeffs_[1] + t * coeffs_[2]);
Expand All @@ -392,7 +392,7 @@ Interval<S> TaylorModel<S>::getTightBound(S t0, S t1) const
}
else
{
register S t = t0;
S t = t0;
S LQ = coeffs_[0] + t * (coeffs_[1] + t * coeffs_[2]);
t = t1;
S RQ = coeffs_[0] + t * (coeffs_[1] + t * coeffs_[2]);
Expand All @@ -405,7 +405,7 @@ Interval<S> TaylorModel<S>::getTightBound(S t0, S t1) const
}
else
{
register S t = t0;
S t = t0;
S LQ = coeffs_[0] + t * (coeffs_[1] + t * (coeffs_[2] + t * coeffs_[3]));
t = t1;
S RQ = coeffs_[0] + t * (coeffs_[1] + t * (coeffs_[2] + t * coeffs_[3]));
Expand Down
2 changes: 1 addition & 1 deletion include/fcl/narrowphase/distance-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ typename NarrowPhaseSolver::S distance(
collide(o1, tf1, o2, tf2, nsolver, collision_request, collision_result);
assert(collision_result.isCollision());

std::size_t index = -1;
std::size_t index = static_cast<std::size_t>(-1);
S max_pen_depth = std::numeric_limits<S>::min();
for (auto i = 0u; i < collision_result.numContacts(); ++i)
{
Expand Down