[neon/forks/sip6/Neon/release] debian: Rebase enum_base_types.diff.
Dmitry Shachnev
null at kde.org
Sun Aug 17 07:48:50 BST 2025
Git commit abe4c54564ed01f7d027b4fa212706b7f4d2ff6d by Dmitry Shachnev.
Committed on 25/05/2025 at 20:16.
Pushed by carlosdem into branch 'Neon/release'.
Rebase enum_base_types.diff.
M +1 -1 debian/changelog
M +21 -46 debian/patches/enum_base_types.diff
https://invent.kde.org/neon/forks/sip6/-/commit/abe4c54564ed01f7d027b4fa212706b7f4d2ff6d
diff --git a/debian/changelog b/debian/changelog
index 7d202f0..3beaa69 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,7 @@
sip6 (6.11.1-1) UNRELEASED; urgency=medium
* New upstream release.
- * Refresh intersphinx_local.diff.
+ * Refresh patches for the new release.
* Bump dependencies on python3-packaging and python3-setuptools.
-- Dmitry Shachnev <mitya57 at debian.org> Thu, 22 May 2025 00:05:25 +0300
diff --git a/debian/patches/enum_base_types.diff b/debian/patches/enum_base_types.diff
index c9988d7..a4b7bf3 100644
--- a/debian/patches/enum_base_types.diff
+++ b/debian/patches/enum_base_types.diff
@@ -12,12 +12,12 @@ Resolves #75
---
docs/other_topics.rst | 18 ++++++------
docs/specification_files.rst | 5 +++-
- sipbuild/generator/outputs/code/code.py | 42 ++++++++++++++++++++++++----
+ sipbuild/generator/outputs/code/code.py | 35 +++++++++++++++++++++--
sipbuild/generator/parser/parser_manager.py | 6 ++--
sipbuild/generator/parser/rules.py | 32 ++++++++++++++++++---
sipbuild/generator/resolver/resolver.py | 43 +++++++++++++++++++++++++++--
sipbuild/generator/specification.py | 3 ++
- 7 files changed, 127 insertions(+), 22 deletions(-)
+ 7 files changed, 122 insertions(+), 20 deletions(-)
diff --git a/docs/other_topics.rst b/docs/other_topics.rst
index 9104d7f..f5f8928 100644
@@ -57,7 +57,7 @@ index 9104d7f..f5f8928 100644
.. _ref-object-ownership:
diff --git a/docs/specification_files.rst b/docs/specification_files.rst
-index dce839a..fd5b330 100644
+index 5ccb542..85946d3 100644
--- a/docs/specification_files.rst
+++ b/docs/specification_files.rst
@@ -203,10 +203,13 @@ file.
@@ -76,20 +76,10 @@ index dce839a..fd5b330 100644
*function* ::= *typed-name* **(** [*argument-list*] **)** [**noexcept**]
diff --git a/sipbuild/generator/outputs/code/code.py b/sipbuild/generator/outputs/code/code.py
-index 997e3c3..1530486 100644
+index bc84e07..3f9e452 100644
--- a/sipbuild/generator/outputs/code/code.py
+++ b/sipbuild/generator/outputs/code/code.py
-@@ -5353,6 +5353,9 @@ def _call_args(sf, spec, cpp_signature, py_signature):
- indirection = ''
- nr_derefs = len(arg.derefs)
-
-+ # The argument may be surrounded by something type-specific.
-+ prefix = suffix = ''
-+
- if arg.type in (ArgumentType.ASCII_STRING, ArgumentType.LATIN1_STRING, ArgumentType.UTF8_STRING, ArgumentType.SSTRING, ArgumentType.USTRING, ArgumentType.STRING, ArgumentType.WSTRING):
- if nr_derefs > (0 if arg.is_out else 1) and not arg.is_reference:
- indirection = '&'
-@@ -5371,6 +5374,10 @@ def _call_args(sf, spec, cpp_signature, py_signature):
+@@ -5379,6 +5379,10 @@ def _call_args(sf, spec, cpp_signature, py_signature):
if nr_derefs == 1:
indirection = '&'
@@ -100,22 +90,7 @@ index 997e3c3..1530486 100644
# See if we need to cast a Python void * to the correct C/C++ pointer
# type. Note that we assume that the arguments correspond and are just
# different types.
-@@ -5394,12 +5401,12 @@ def _call_args(sf, spec, cpp_signature, py_signature):
- else:
- sf.write(f'reinterpret_cast<{arg_cpp_type_name} *>({arg_name})')
- else:
-- sf.write(indirection)
-+ sf.write(prefix + indirection)
-
- if arg.array is ArrayArgument.ARRAY_SIZE:
- sf.write(f'({arg_cpp_type_name})')
-
-- sf.write(arg_name)
-+ sf.write(arg_name + suffix)
-
-
- def _get_named_value_decl(spec, scope, type, name):
-@@ -5452,6 +5459,8 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5460,6 +5464,8 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
saved_is_reference = arg.is_reference
saved_is_const = arg.is_const
@@ -124,7 +99,7 @@ index 997e3c3..1530486 100644
if arg.type in (ArgumentType.ASCII_STRING, ArgumentType.LATIN1_STRING, ArgumentType.UTF8_STRING, ArgumentType.SSTRING, ArgumentType.USTRING, ArgumentType.STRING, ArgumentType.WSTRING):
if not arg.is_reference:
if nr_derefs == 2:
-@@ -5465,6 +5474,10 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5473,6 +5479,10 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
else:
arg.derefs = []
@@ -135,7 +110,7 @@ index 997e3c3..1530486 100644
# Array sizes are always Py_ssize_t.
if arg.array is ArrayArgument.ARRAY_SIZE:
arg.type = ArgumentType.SSIZE
-@@ -5475,7 +5488,7 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5483,7 +5493,7 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
arg.is_const = False
modified_arg_cpp_type = fmt_argument_as_cpp_type(spec, arg,
@@ -144,7 +119,7 @@ index 997e3c3..1530486 100644
sf.write(f' {modified_arg_cpp_type} {arg_name}')
-@@ -5492,8 +5505,14 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5500,8 +5510,14 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
if arg.type in (ArgumentType.CLASS, ArgumentType.MAPPED) and (nr_derefs == 0 or arg.is_reference):
sf.write(f'&{arg_name}def')
else:
@@ -159,26 +134,26 @@ index 997e3c3..1530486 100644
sf.write(';\n')
# Some types have supporting variables.
-@@ -7496,9 +7515,16 @@ def _get_slot_arg(spec, overload, arg_nr):
+@@ -7504,9 +7520,16 @@ def _get_slot_arg(spec, overload, arg_nr):
arg = overload.py_signature.args[arg_nr]
- dereference = '*' if arg.type in (ArgumentType.CLASS, ArgumentType.MAPPED) and len(arg.derefs) == 0 else ''
+ prefix = suffix = ''
-+
+
+- return dereference + fmt_argument_as_name(spec, arg, arg_nr)
+ if arg.type in (ArgumentType.CLASS, ArgumentType.MAPPED):
+ if len(arg.derefs) == 0:
+ prefix = '*'
+ elif _arg_is_small_enum(arg):
+ prefix = 'static_cast<' + fmt_enum_as_cpp_type(arg.definition) + '>('
+ suffix = ')'
-
-- return dereference + fmt_argument_as_name(spec, arg, arg_nr)
++
+ return prefix + fmt_argument_as_name(spec, arg, arg_nr) + suffix
# A map of operators and their complements.
-@@ -8993,6 +9019,12 @@ def _optional_ptr(is_ptr, name):
+@@ -9001,6 +9024,12 @@ def _optional_ptr(is_ptr, name):
return name if is_ptr else 'SIP_NULLPTR'
@@ -192,7 +167,7 @@ index 997e3c3..1530486 100644
_SLOT_NAME_MAP = {
PySlot.ADD: 'operator+',
diff --git a/sipbuild/generator/parser/parser_manager.py b/sipbuild/generator/parser/parser_manager.py
-index 202c243..8bdc35f 100644
+index 1cc9cc9..bab644e 100644
--- a/sipbuild/generator/parser/parser_manager.py
+++ b/sipbuild/generator/parser/parser_manager.py
@@ -565,7 +565,8 @@ class ParserManager:
@@ -205,7 +180,7 @@ index 202c243..8bdc35f 100644
""" Create a new enum and add it to the current scope. """
if self.scope_access_specifier is AccessSpecifier.PRIVATE:
-@@ -616,7 +617,8 @@ class ParserManager:
+@@ -618,7 +619,8 @@ class ParserManager:
w_enum = WrappedEnum(base_type, fq_cpp_name, self.module_state.module,
cached_fq_cpp_name=cached_fq_cpp_name, is_scoped=is_scoped,
@@ -216,10 +191,10 @@ index 202c243..8bdc35f 100644
if self.scope_access_specifier is AccessSpecifier.PROTECTED:
if not self._protected_is_public:
diff --git a/sipbuild/generator/parser/rules.py b/sipbuild/generator/parser/rules.py
-index 85090e1..ca9e0e3 100644
+index 6fd99b7..3a45736 100644
--- a/sipbuild/generator/parser/rules.py
+++ b/sipbuild/generator/parser/rules.py
-@@ -2186,28 +2186,52 @@ _ENUM_MEMBER_ANNOTATIONS = (
+@@ -2211,28 +2211,52 @@ _ENUM_MEMBER_ANNOTATIONS = (
def p_enum_decl(p):
@@ -277,7 +252,7 @@ index 85090e1..ca9e0e3 100644
"""opt_enum_body : enum_body
| empty"""
diff --git a/sipbuild/generator/resolver/resolver.py b/sipbuild/generator/resolver/resolver.py
-index e4211f0..2d7dde2 100644
+index 7921a5e..9692ba5 100644
--- a/sipbuild/generator/resolver/resolver.py
+++ b/sipbuild/generator/resolver/resolver.py
@@ -196,8 +196,9 @@ def _resolve_module(spec, mod, error_log, final_checks, seen=None):
@@ -346,10 +321,10 @@ index e4211f0..2d7dde2 100644
""" Resolve the data types for the variables of a module. """
diff --git a/sipbuild/generator/specification.py b/sipbuild/generator/specification.py
-index 57376ba..d0c1ea2 100644
+index 79c9e3d..9daea9a 100644
--- a/sipbuild/generator/specification.py
+++ b/sipbuild/generator/specification.py
-@@ -1666,6 +1666,9 @@ class WrappedEnum:
+@@ -1670,6 +1670,9 @@ class WrappedEnum:
# The defining module.
module: Module
More information about the Neon-commits
mailing list