On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote:
Extend the regex to cover also return type, pointers included.
This implies that the value returned by the function cannot be
a simple "int" anymore, but the custom return type.
Therefore remove poll_state->ret and instead use a per-function
custom "ret" field.

Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
Reviewed-by: Kevin Wolf <kw...@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>

---
  block/block-gen.h                  |  5 +----
  scripts/block-coroutine-wrapper.py | 19 +++++++++++--------
  2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/block/block-gen.h b/block/block-gen.h
index 08d977f493..89b7daaa1f 100644
--- a/block/block-gen.h
+++ b/block/block-gen.h

[..]

# Match wrappers declared with a co_wrapper mark
-func_decl_re = re.compile(r'^int\s*co_wrapper'
+func_decl_re = re.compile(r'^(?P<return_type>[a-zA-Z][a-zA-Z0-9_]* [*]?)'

hmm interesting. I'd just write \* to mean '*' symbol. Probably it's a tiny bit 
faster (and tiny bit shorter:)

--
Best regards,
Vladimir


Reply via email to