File tree 5 files changed +6
-6
lines changed 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ if(MSVC)
81
81
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
82
82
endif ()
83
83
elseif ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" )
84
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra" )
84
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion " )
85
85
endif ()
86
86
87
87
Original file line number Diff line number Diff line change 13
13
14
14
double my_func (int x, float y, double z) {
15
15
std::cout << " my_func(x:int=" << x << " , y:float=" << y << " , z:float=" << z << " )" << std::endl;
16
- return x*y*z;
16
+ return ( float ) x*y*z;
17
17
}
18
18
19
19
std::complex<double > my_func3 (std::complex<double > c) {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ void test_function2(EMyEnumeration k) {
38
38
39
39
float test_function3 (int i) {
40
40
std::cout << " test_function(" << i << " )" << std::endl;
41
- return i / 2 .f ;
41
+ return ( float ) i / 2 .f ;
42
42
}
43
43
44
44
py::bytes return_bytes () {
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ struct internals {
262
262
std::unordered_map<const void *, void *> registered_instances; // void * -> PyObject*
263
263
std::unordered_set<std::pair<const PyObject *, const char *>, overload_hash> inactive_overload_cache;
264
264
#if defined(WITH_THREAD)
265
- long tstate = 0 ;
265
+ decltype (PyThread_create_key()) tstate = 0; // Usually an int but a long on Cygwin64 with Python 3.x
266
266
PyInterpreterState *istate = nullptr ;
267
267
#endif
268
268
};
Original file line number Diff line number Diff line change @@ -1115,7 +1115,7 @@ class gil_scoped_release {
1115
1115
gil_scoped_release (bool disassoc = false ) : disassoc(disassoc) {
1116
1116
tstate = PyEval_SaveThread ();
1117
1117
if (disassoc) {
1118
- int key = detail::get_internals ().tstate ;
1118
+ auto key = detail::get_internals ().tstate ;
1119
1119
#if PY_MAJOR_VERSION < 3
1120
1120
PyThread_delete_key_value (key);
1121
1121
#else
@@ -1128,7 +1128,7 @@ class gil_scoped_release {
1128
1128
return ;
1129
1129
PyEval_RestoreThread (tstate);
1130
1130
if (disassoc) {
1131
- int key = detail::get_internals ().tstate ;
1131
+ auto key = detail::get_internals ().tstate ;
1132
1132
#if PY_MAJOR_VERSION < 3
1133
1133
PyThread_delete_key_value (key);
1134
1134
#endif
You can’t perform that action at this time.
0 commit comments