Skip to content
Snippets Groups Projects
Commit 9d7b7dec authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

CxxUtils: Suppress cppcheck warning.

Suppress new warning from cppcheck 2.0.
parent b9ffea6f
No related branches found
No related tags found
No related merge requests found
// This file's extension implies that it's C, but it's really -*- C++ -*-. // This file's extension implies that it's C, but it's really -*- C++ -*-.
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
// $Id$
/** /**
* @file CxxUtils/ones.h * @file CxxUtils/ones.h
* @author scott snyder <snyder@bnl.gov> * @author scott snyder <snyder@bnl.gov>
...@@ -29,6 +26,7 @@ T ones (unsigned int n) ...@@ -29,6 +26,7 @@ T ones (unsigned int n)
{ {
if (n >= sizeof(T) * 8) if (n >= sizeof(T) * 8)
return ~static_cast<T>(0); return ~static_cast<T>(0);
// cppcheck-suppress shiftTooManyBits
return (static_cast<T>(1) << n) - 1; return (static_cast<T>(1) << n) - 1;
} }
......
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
/** /**
* @file CxxUtils/test/phihelper_test.cxx * @file CxxUtils/test/phihelper_test.cxx
...@@ -64,6 +64,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_wrap, T, test_types) ...@@ -64,6 +64,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_wrap, T, test_types)
BOOST_TEST(wrapToPi<T>(-40.1 * PI) == wrapToPi<T>(-10.1 * PI)); BOOST_TEST(wrapToPi<T>(-40.1 * PI) == wrapToPi<T>(-10.1 * PI));
} }
// cppcheck-suppress unknownMacro
BOOST_TEST_DECORATOR(TOLERANCE) BOOST_TEST_DECORATOR(TOLERANCE)
BOOST_AUTO_TEST_CASE_TEMPLATE(test_delta, T, test_types) BOOST_AUTO_TEST_CASE_TEMPLATE(test_delta, T, test_types)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment