From 0e02efe313003557d9b73f9566aa0ffc32f99195 Mon Sep 17 00:00:00 2001 From: Phil Thompson Date: Wed, 4 Dec 2024 14:57:09 +0000 Subject: [PATCH] Snapshot regression Reverted changes to the `sip` module sources so that they build using MSVC. --- sipbuild/module/source/12/siplib.c | 17 ++++++++++------- sipbuild/module/source/13/sip_core.c | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/sipbuild/module/source/12/siplib.c b/sipbuild/module/source/12/siplib.c index 9edb6e59..409bba84 100644 --- a/sipbuild/module/source/12/siplib.c +++ b/sipbuild/module/source/12/siplib.c @@ -7776,21 +7776,23 @@ static void sip_api_abstract_method(const char *classname, const char *method) classname, method); } + /* * Report a deprecated class or method. */ int sip_api_deprecated(const char *classname, const char *method) { - return sip_api_deprecated_12_16( classname, method, NULL ); + return sip_api_deprecated_12_16(classname, method, NULL); } + /* - * Report a deprecated class or method with a given message. + * Report a deprecated class or method with an optional message. */ -int sip_api_deprecated_12_16(const char *classname, const char *method, const char *message) +int sip_api_deprecated_12_16(const char *classname, const char *method, + const char *message) { - const unsigned int bufsize = 100 + ( message ? strlen(message) : 0 ); - char buf[bufsize]; + char buf[100]; if (classname == NULL) PyOS_snprintf(buf, sizeof (buf), "%s() is deprecated", method); @@ -7798,10 +7800,11 @@ int sip_api_deprecated_12_16(const char *classname, const char *method, const ch PyOS_snprintf(buf, sizeof (buf), "%s constructor is deprecated", classname); else - PyOS_snprintf(buf, sizeof (buf), "%s.%s() is deprecated", classname, method); + PyOS_snprintf(buf, sizeof (buf), "%s.%s() is deprecated", classname, + method); if (message != NULL) - PyOS_snprintf(&buf[strlen(buf)], sizeof (buf), ": %s", message); + PyOS_snprintf(&buf[strlen(buf)], sizeof (buf), ": %s", message); return PyErr_WarnEx(PyExc_DeprecationWarning, buf, 1); } diff --git a/sipbuild/module/source/13/sip_core.c b/sipbuild/module/source/13/sip_core.c index 1a1f4d8a..f29485c9 100644 --- a/sipbuild/module/source/13/sip_core.c +++ b/sipbuild/module/source/13/sip_core.c @@ -6661,21 +6661,23 @@ static void sip_api_abstract_method(const char *classname, const char *method) classname, method); } + /* * Report a deprecated class or method. */ int sip_api_deprecated(const char *classname, const char *method) { - return sip_api_deprecated_13_9( classname, method, NULL ); + return sip_api_deprecated_13_9(classname, method, NULL); } + /* - * Report a deprecated class or method with a given message. + * Report a deprecated class or method with an optional message. */ -int sip_api_deprecated_13_9(const char *classname, const char *method, const char *message) +int sip_api_deprecated_13_9(const char *classname, const char *method, + const char *message) { - const unsigned int bufsize = 100 + ( message ? strlen(message) : 0 ); - char buf[bufsize]; + char buf[100]; if (classname == NULL) PyOS_snprintf(buf, sizeof (buf), "%s() is deprecated", method); @@ -6683,10 +6685,11 @@ int sip_api_deprecated_13_9(const char *classname, const char *method, const cha PyOS_snprintf(buf, sizeof (buf), "%s constructor is deprecated", classname); else - PyOS_snprintf(buf, sizeof (buf), "%s.%s() is deprecated", classname, method ); + PyOS_snprintf(buf, sizeof (buf), "%s.%s() is deprecated", classname, + method ); if (message != NULL) - PyOS_snprintf(&buf[strlen(buf)], sizeof (buf), ": %s", message); + PyOS_snprintf(&buf[strlen(buf)], sizeof (buf), ": %s", message); return PyErr_WarnEx(PyExc_DeprecationWarning, buf, 1); }