From cca1a90d1ce2f1662a45e1b7f565f47fa34d29cd Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Tue, 5 Dec 2017 13:18:41 -0800 Subject: [PATCH] Fix __exit__ binding to wrong method, and enable the GCC warnings that could catch this kind of thing (unused static function). --- korlib/CMakeLists.txt | 4 ++++ korlib/texture.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/korlib/CMakeLists.txt b/korlib/CMakeLists.txt index ce3e66f..a00a011 100644 --- a/korlib/CMakeLists.txt +++ b/korlib/CMakeLists.txt @@ -12,6 +12,10 @@ find_package(OpenGL REQUIRED) find_package(string_theory REQUIRED) find_package(Vorbis REQUIRED) +if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") + set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter ${CMAKE_CXX_FLAGS}") +endif() + # Da files set(korlib_HEADERS buffer.h diff --git a/korlib/texture.cpp b/korlib/texture.cpp index 63d3975..0fe6615 100644 --- a/korlib/texture.cpp +++ b/korlib/texture.cpp @@ -368,7 +368,7 @@ static PyObject* pyGLTexture_store_in_mipmap(pyGLTexture* self, PyObject* args) static PyMethodDef pyGLTexture_Methods[] = { { _pycs("__enter__"), (PyCFunction)pyGLTexture__enter__, METH_NOARGS, NULL }, - { _pycs("__exit__"), (PyCFunction)pyGLTexture__enter__, METH_VARARGS, NULL }, + { _pycs("__exit__"), (PyCFunction)pyGLTexture__exit__, METH_VARARGS, NULL }, { _pycs("generate_mipmap"), (PyCFunction)pyGLTexture_generate_mipmap, METH_NOARGS, NULL }, { _pycs("get_level_data"), (PyCFunction)pyGLTexture_get_level_data, METH_KEYWORDS | METH_VARARGS, NULL },