[neon/forks/sip6/Neon/release] debian/patches: Amend enum_base_types.diff to work with SIP v6.10.0.
Dmitry Shachnev
null at kde.org
Sun Aug 17 07:48:50 BST 2025
Git commit 5e10f4429ccbf5a04050646bf6ffb7b4928644d8 by Dmitry Shachnev.
Committed on 25/05/2025 at 17:06.
Pushed by carlosdem into branch 'Neon/release'.
Amend enum_base_types.diff to work with SIP v6.10.0.
M +35 -10 debian/patches/enum_base_types.diff
https://invent.kde.org/neon/forks/sip6/-/commit/5e10f4429ccbf5a04050646bf6ffb7b4928644d8
diff --git a/debian/patches/enum_base_types.diff b/debian/patches/enum_base_types.diff
index f242770..821d5a7 100644
--- a/debian/patches/enum_base_types.diff
+++ b/debian/patches/enum_base_types.diff
@@ -4,12 +4,12 @@ Subject: Support enum base types
---
docs/specification_files.rst | 5 +++-
- sipbuild/generator/outputs/code/code.py | 35 +++++++++++++++++++++--
+ sipbuild/generator/outputs/code/code.py | 42 +++++++++++++++++++++++----
sipbuild/generator/parser/parser_manager.py | 6 ++--
sipbuild/generator/parser/rules.py | 32 ++++++++++++++++++---
sipbuild/generator/resolver/resolver.py | 44 +++++++++++++++++++++++++++--
sipbuild/generator/specification.py | 3 ++
- 6 files changed, 113 insertions(+), 12 deletions(-)
+ 6 files changed, 118 insertions(+), 14 deletions(-)
diff --git a/docs/specification_files.rst b/docs/specification_files.rst
index dce839a..fd5b330 100644
@@ -31,10 +31,20 @@ 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..f243956 100644
+index 997e3c3..1530486 100644
--- a/sipbuild/generator/outputs/code/code.py
+++ b/sipbuild/generator/outputs/code/code.py
-@@ -5371,6 +5371,10 @@ def _call_args(sf, spec, cpp_signature, py_signature):
+@@ -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):
if nr_derefs == 1:
indirection = '&'
@@ -45,7 +55,22 @@ index 997e3c3..f243956 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.
-@@ -5452,6 +5456,8 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -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):
saved_is_reference = arg.is_reference
saved_is_const = arg.is_const
@@ -54,7 +79,7 @@ index 997e3c3..f243956 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 +5471,10 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5465,6 +5474,10 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
else:
arg.derefs = []
@@ -65,7 +90,7 @@ index 997e3c3..f243956 100644
# Array sizes are always Py_ssize_t.
if arg.array is ArrayArgument.ARRAY_SIZE:
arg.type = ArgumentType.SSIZE
-@@ -5475,7 +5485,7 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5475,7 +5488,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,
@@ -74,7 +99,7 @@ index 997e3c3..f243956 100644
sf.write(f' {modified_arg_cpp_type} {arg_name}')
-@@ -5492,8 +5502,14 @@ def _argument_variable(sf, spec, scope, arg, arg_nr):
+@@ -5492,8 +5505,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:
@@ -89,7 +114,7 @@ index 997e3c3..f243956 100644
sf.write(';\n')
# Some types have supporting variables.
-@@ -7496,9 +7512,16 @@ def _get_slot_arg(spec, overload, arg_nr):
+@@ -7496,9 +7515,16 @@ def _get_slot_arg(spec, overload, arg_nr):
arg = overload.py_signature.args[arg_nr]
@@ -108,7 +133,7 @@ index 997e3c3..f243956 100644
# A map of operators and their complements.
-@@ -8993,6 +9016,12 @@ def _optional_ptr(is_ptr, name):
+@@ -8993,6 +9019,12 @@ def _optional_ptr(is_ptr, name):
return name if is_ptr else 'SIP_NULLPTR'
More information about the Neon-commits
mailing list