Skip to content

Commit

Permalink
Switch to better name
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg committed Nov 22, 2022
1 parent ac21ed4 commit f64bc2c
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

PYBIND11_NAMESPACE_BEGIN(detail)

Expand Down
18 changes: 9 additions & 9 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@
#endif

#ifdef PYBIND11_COMPILER_MSVC
# define PYBIND11_DISABLE_WARNING_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
# define PYBIND11_WARNING_DISABLE_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
#else
# define PYBIND11_DISABLE_WARNING_MSVC(name)
# define PYBIND11_WARNING_DISABLE_MSVC(name)
#endif

#ifdef PYBIND11_COMPILER_CLANG
# define PYBIND11_DISABLE_WARNING_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
# define PYBIND11_WARNING_DISABLE_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
#else
# define PYBIND11_DISABLE_WARNING_CLANG(name)
# define PYBIND11_WARNING_DISABLE_CLANG(name)
#endif

#ifdef PYBIND11_COMPILER_GCC
# define PYBIND11_DISABLE_WARNING_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
# define PYBIND11_WARNING_DISABLE_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
#else
# define PYBIND11_DISABLE_WARNING_GCC(name)
# define PYBIND11_WARNING_DISABLE_GCC(name)
#endif

#ifdef PYBIND11_COMPILER_INTEL
# define PYBIND11_DISABLE_WARNING_INTEL(name) PYBIND11_PRAGMA(warning disable name)
# define PYBIND11_WARNING_DISABLE_INTEL(name) PYBIND11_PRAGMA(warning disable name)
#else
# define PYBIND11_DISABLE_WARNING_INTEL(name)
# define PYBIND11_WARNING_DISABLE_INTEL(name)
#endif

#define PYBIND11_NAMESPACE_BEGIN(name) \
Expand Down Expand Up @@ -204,7 +204,7 @@
/// Include Python header, disable linking to pythonX_d.lib on Windows in debug mode
#if defined(_MSC_VER)
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_MSVC(4505)
PYBIND11_WARNING_DISABLE_MSVC(4505)
// C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
# if defined(_DEBUG) && !defined(Py_DEBUG)
// Workaround for a VS 2022 issue.
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/detail/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

PYBIND11_NAMESPACE_BEGIN(detail)

Expand Down
6 changes: 3 additions & 3 deletions include/pybind11/eigen/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
https://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler
*/
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
PYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
// C5054: operator '&': deprecated between enumerations of different types
PYBIND11_DISABLE_WARNING_GCC("-Wmaybe-uninitialized")
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")

#include <Eigen/Core>
#include <Eigen/SparseCore>
Expand All @@ -34,7 +34,7 @@ static_assert(EIGEN_VERSION_AT_LEAST(3, 2, 7),

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

// Provide a convenience alias for easier pass-by-ref usage with fully dynamic strides:
using EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>;
Expand Down
10 changes: 5 additions & 5 deletions include/pybind11/eigen/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ static_assert(__GNUC__ > 5, "Eigen Tensor support in pybind11 requires GCC > 5.0

// Disable warnings for Eigen
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_MSVC(4554)
PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_DISABLE_WARNING_GCC("-Wmaybe-uninitialized")
PYBIND11_WARNING_DISABLE_MSVC(4554)
PYBIND11_WARNING_DISABLE_MSVC(4127)
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")

#include <unsupported/Eigen/CXX11/Tensor>

Expand All @@ -28,7 +28,7 @@ static_assert(EIGEN_VERSION_AT_LEAST(3, 3, 0),

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

PYBIND11_NAMESPACE_BEGIN(detail)

Expand Down Expand Up @@ -134,7 +134,7 @@ struct get_tensor_descriptor {
// We need to disable the type-limits warning for the inner loop when size = 0.

PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_GCC("-Wtype-limits")
PYBIND11_WARNING_DISABLE_GCC("-Wtype-limits")

template <typename T, int size>
std::vector<T> convert_dsizes_to_vector(const Eigen::DSizes<T, size> &arr) {
Expand Down
4 changes: 2 additions & 2 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static_assert(std::is_signed<Py_intptr_t>::value, "Py_intptr_t must be signed");

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

class array; // Forward declaration

Expand Down Expand Up @@ -1870,7 +1870,7 @@ struct vectorize_helper {

PYBIND11_WARNING_PUSH
#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
PYBIND11_DISABLE_WARNING_CLANG("-Wreturn-std-move")
PYBIND11_WARNING_DISABLE_CLANG("-Wreturn-std-move")
#endif

if (size == 0) {
Expand Down
8 changes: 4 additions & 4 deletions include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
No other GCC version generates this warning.
*/
#if defined(__GNUC__) && __GNUC__ == 7
PYBIND11_DISABLE_WARNING_GCC("-Wnoexcept-type")
PYBIND11_WARNING_DISABLE_GCC("-Wnoexcept-type")
#endif

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

PYBIND11_NAMESPACE_BEGIN(detail)

Expand Down Expand Up @@ -185,13 +185,13 @@ class cpp_function : public function {
PYBIND11_WARNING_PUSH

#if defined(__GNUG__) && __GNUC__ >= 6
PYBIND11_DISABLE_WARNING_GCC("-Wplacement-new")
PYBIND11_WARNING_DISABLE_GCC("-Wplacement-new")
#endif

new ((capture *) &rec->data) capture{std::forward<Func>(f)};

#if !PYBIND11_HAS_STD_LAUNDER
PYBIND11_DISABLE_WARNING_GCC("-Wstrict-aliasing")
PYBIND11_WARNING_DISABLE_GCC("-Wstrict-aliasing")
#endif

// UB without std::launder, but without breaking ABI and/or
Expand Down
4 changes: 2 additions & 2 deletions include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

/* A few forward declarations */
class handle;
Expand Down Expand Up @@ -887,7 +887,7 @@ object object_or_cast(T &&o);
inline handle object_or_cast(PyObject *ptr) { return ptr; }

PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_MSVC(4522) // warning C4522: multiple assignment operators specified
PYBIND11_WARNING_DISABLE_MSVC(4522) // warning C4522: multiple assignment operators specified
template <typename Policy>
class accessor : public object_api<accessor<Policy>> {
using key_type = typename Policy::key_type;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_builtin_casters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PYBIND11_NAMESPACE_END(pybind11)

TEST_SUBMODULE(builtin_casters, m) {
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

// test_simple_string
m.def("string_roundtrip", [](const char *s) { return s; });
Expand Down
2 changes: 1 addition & 1 deletion tests/test_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <utility>

PYBIND11_DISABLE_WARNING_MSVC(4324)
PYBIND11_WARNING_DISABLE_MSVC(4324)
// warning C4324: structure was padded due to alignment specifier

// test_brace_initialization
Expand Down
10 changes: 5 additions & 5 deletions tests/test_constants_and_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ int f1(int x) noexcept { return x + 1; }
int f2(int x) noexcept(true) { return x + 2; }
int f3(int x) noexcept(false) { return x + 3; }
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_GCC("-Wdeprecated")
PYBIND11_DISABLE_WARNING_CLANG("-Wdeprecated")
PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated")
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated")
// NOLINTNEXTLINE(modernize-use-noexcept)
int f4(int x) throw() { return x + 4; } // Deprecated equivalent to noexcept(true)
PYBIND11_WARNING_POP
Expand All @@ -66,8 +66,8 @@ struct C {
int m5(int x) noexcept(false) { return x - 5; }
int m6(int x) const noexcept(false) { return x - 6; }
PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_GCC("-Wdeprecated")
PYBIND11_DISABLE_WARNING_CLANG("-Wdeprecated")
PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated")
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated")
// NOLINTNEXTLINE(modernize-use-noexcept)
int m7(int x) throw() { return x - 7; }
// NOLINTNEXTLINE(modernize-use-noexcept)
Expand Down Expand Up @@ -122,7 +122,7 @@ TEST_SUBMODULE(constants_and_functions, m) {
m.def("f2", f2);

PYBIND11_WARNING_PUSH
PYBIND11_DISABLE_WARNING_INTEL(878) // incompatible exception specifications
PYBIND11_WARNING_DISABLE_INTEL(878) // incompatible exception specifications
m.def("f3", f3);
PYBIND11_WARNING_POP

Expand Down
2 changes: 1 addition & 1 deletion tests/test_eigen_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "constructor_stats.h"
#include "pybind11_tests.h"

PYBIND11_DISABLE_WARNING_MSVC(4996)
PYBIND11_WARNING_DISABLE_MSVC(4996)

#include <Eigen/Cholesky>

Expand Down
2 changes: 1 addition & 1 deletion tests/test_eigen_tensor.inl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

PYBIND11_NAMESPACE_BEGIN(PYBIND11_TEST_EIGEN_TENSOR_NAMESPACE)

PYBIND11_DISABLE_WARNING_MSVC(4127)
PYBIND11_WARNING_DISABLE_MSVC(4127)

template <typename M>
void reset_tensor(M &x) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_embed/catch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
PYBIND11_DISABLE_WARNING_MSVC(4996)
PYBIND11_WARNING_DISABLE_MSVC(4996)

// Catch uses _ internally, which breaks gettext style defines
#ifdef _
Expand Down
2 changes: 1 addition & 1 deletion tests/test_embed/test_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
PYBIND11_DISABLE_WARNING_MSVC(4996)
PYBIND11_WARNING_DISABLE_MSVC(4996)

#include <catch.hpp>
#include <cstdlib>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_kwargs_and_defaults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
PYBIND11_WARNING_PUSH

#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
PYBIND11_DISABLE_WARNING_CLANG("-Wreturn-std-move")
PYBIND11_WARNING_DISABLE_CLANG("-Wreturn-std-move")
#endif
return args;
PYBIND11_WARNING_POP
Expand Down
4 changes: 2 additions & 2 deletions tests/test_operator_overloading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ std::string abs(const Vector2 &) { return "abs(Vector2)"; }
// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).
#if defined(__APPLE__) && defined(__clang__)
# if (__clang_major__ >= 10)
PYBIND11_DISABLE_WARNING_CLANG("-Wself-assign-overloaded")
PYBIND11_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
# endif
#elif defined(__clang__)
# if (__clang_major__ >= 7)
PYBIND11_DISABLE_WARNING_CLANG("-Wself-assign-overloaded")
PYBIND11_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
# endif
#endif

Expand Down

0 comments on commit f64bc2c

Please sign in to comment.