From 203b655207725de81d2b67dda3d87fcb302692f5 Mon Sep 17 00:00:00 2001 From: qubka Date: Sat, 27 Sep 2025 18:05:48 +0100 Subject: [PATCH 1/3] fix: change default build type --- CMakeLists.txt | 4 ++-- external/plugify | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 576a3f0..f97f2d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,8 +31,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) #set(CMAKE_POSITION_INDEPENDENT_CODE ON) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|MinSizeRel|RelWithDebInfo|Release") - message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Debug.") - set(CMAKE_BUILD_TYPE Debug) + message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Release.") + set(CMAKE_BUILD_TYPE Release) endif() if(UNIX AND NOT APPLE) diff --git a/external/plugify b/external/plugify index a12add3..48e6e0a 160000 --- a/external/plugify +++ b/external/plugify @@ -1 +1 @@ -Subproject commit a12add30600a9c05fe54dba01472447d61c30b26 +Subproject commit 48e6e0ac974c2a44dffcfc327bc71871c5fae0c9 From c277e90ce491a166a801db95ba69b4153ab08761 Mon Sep 17 00:00:00 2001 From: qubka Date: Sat, 27 Sep 2025 18:05:54 +0100 Subject: [PATCH 2/3] fix: clang warnings --- src/module.cpp | 33 ++++++++++++++++----------------- src/module.hpp | 5 ++++- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/module.cpp b/src/module.cpp index 7f64cb8..093c815 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -11,8 +12,6 @@ #include #include -#include - #include "plugify/enum_object.hpp" #include "plugify/enum_value.hpp" @@ -1460,16 +1459,16 @@ namespace py3lm { template PyObject* CreatePyObjectList(const plg::vector& arrayArg) { - const auto size = static_cast(arrayArg.size()); + const auto size = arrayArg.size(); PyObject* const arrayObject = PyList_New(size); if (arrayObject) { - for (Py_ssize_t i = 0; i < size; ++i) { + for (size_t i = 0; i < size; ++i) { PyObject* const valueObject = CreatePyObject(arrayArg[i]); if (!valueObject) { Py_DECREF(arrayObject); return nullptr; } - PyList_SET_ITEM(arrayObject, i, valueObject); + PyList_SET_ITEM(arrayObject, static_cast(i), valueObject); } } return arrayObject; @@ -1482,16 +1481,16 @@ namespace py3lm { template PyObject* CreatePyEnumObjectList(const EnumObject& enumerator, const plg::vector& arrayArg) { - const auto size = static_cast(arrayArg.size()); + const auto size = arrayArg.size(); PyObject* const arrayObject = PyList_New(size); if (arrayObject) { - for (Py_ssize_t i = 0; i < size; ++i) { + for (size_t i = 0; i < size; ++i) { PyObject* const valueObject = CreatePyEnumObject(enumerator, arrayArg[i]); if (!valueObject) { Py_DECREF(arrayObject); return nullptr; } - PyList_SET_ITEM(arrayObject, i, valueObject); + PyList_SET_ITEM(arrayObject, static_cast(i), valueObject); } } return arrayObject; @@ -2952,8 +2951,8 @@ namespace py3lm { const auto& paramTypes = method->GetParamTypes(); const auto paramCount = paramTypes.size(); - const Py_ssize_t size = PyTuple_Size(args); - if (size != static_cast(paramCount)) { + const size_t size = static_cast(PyTuple_Size(args)); + if (size != paramCount) { const std::string error(std::format("Wrong number of parameters, {} when {} required.", size, paramCount)); PyErr_SetString(PyExc_TypeError, error.c_str()); ret.Set(nullptr); @@ -2971,14 +2970,14 @@ namespace py3lm { BeginExternalCall(retType.GetType(), a); } - for (Py_ssize_t i = 0; i < size; ++i) { + for (size_t i = 0; i < size; ++i) { const Property& paramType = paramTypes[i]; if (paramType.IsRef()) { ++refParamsCount; } using PushParamFunc = bool (*)(const Property&, PyObject*, ArgsScope&); PushParamFunc const pushParamFunc = paramType.IsRef() ? &PushObjectAsRefParam : &PushObjectAsParam; - const bool pushResult = pushParamFunc(paramType, PyTuple_GetItem(args, i), a); + const bool pushResult = pushParamFunc(paramType, PyTuple_GetItem(args, static_cast(i)), a); if (!pushResult) { // pushParamFunc set error ret.Set(nullptr); @@ -3002,7 +3001,7 @@ namespace py3lm { PyTuple_SET_ITEM(retTuple, k++, retObj); // retObj ref taken by tuple - for (Py_ssize_t i = 0, j = hasHiddenParam; i < size; ++i) { + for (size_t i = 0, j = hasHiddenParam; i < size; ++i) { const Property& paramType = paramTypes[i]; if (!paramType.IsRef()) { continue; @@ -4423,9 +4422,9 @@ namespace py3lm { } Python3LanguageModule g_py3lm; +} - extern "C" - PY3LM_EXPORT ILanguageModule* GetLanguageModule() { - return &g_py3lm; - } +extern "C" +PY3LM_EXPORT ILanguageModule* GetLanguageModule() { + return &py3lm::g_py3lm; } diff --git a/src/module.hpp b/src/module.hpp index fd5b587..aed7dc8 100644 --- a/src/module.hpp +++ b/src/module.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include using namespace plugify; @@ -205,3 +205,6 @@ namespace py3lm { PythonInternalEnumMap _internalEnumMap; }; } + +extern "C" PY3LM_EXPORT ILanguageModule* GetLanguageModule(); + From bc5280c576e104986d375ef4066caf513d3ad5ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:06:09 +0000 Subject: [PATCH 3/3] chore(main): release 2.0.7 --- .github/release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ version.txt | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/release-please-manifest.json b/.github/release-please-manifest.json index b83b80e..20a849c 100644 --- a/.github/release-please-manifest.json +++ b/.github/release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.6" + ".": "2.0.7" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b07c14..90eecd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.0.7](https://github.com/untrustedmodders/plugify-module-python3/compare/v2.0.6...v2.0.7) (2025-09-27) + + +### Bug Fixes + +* change default build type ([203b655](https://github.com/untrustedmodders/plugify-module-python3/commit/203b655207725de81d2b67dda3d87fcb302692f5)) +* clang warnings ([c277e90](https://github.com/untrustedmodders/plugify-module-python3/commit/c277e90ce491a166a801db95ba69b4153ab08761)) + ## [2.0.6](https://github.com/untrustedmodders/plugify-module-python3/compare/v2.0.5...v2.0.6) (2025-09-27) diff --git a/version.txt b/version.txt index 157e54f..f1547e6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.6 +2.0.7