From 49435c8aca5a53fb0d4ba7d4a1b306ca0f972ae7 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 19 Aug 2023 02:27:06 +0200 Subject: [PATCH] Activity-Lang: investigate / fix string conversion ...turns out that util::toString does not explicitly handle pointers differently, for very good reasons; this function must always work, always produce a simple and compact representation, and it must be possible to instantiate the template and take a function reference (which precludes adding an overload for pointers) --- src/lib/format-obj.hpp | 4 +++ src/vault/gear/activity-lang.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 42 +++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/lib/format-obj.hpp b/src/lib/format-obj.hpp index 31d951adf..aeb45ee77 100644 --- a/src/lib/format-obj.hpp +++ b/src/lib/format-obj.hpp @@ -170,6 +170,10 @@ namespace util { * a predictable display of printed unit-test results. * @remark while the actual parameter is passed by const-ref, * cv-qualifiactions and references are stripped from the type + * @note Deliberately there is no magic detection/support for pointers. + * This function _must not be overloaded_ (to avoid ambiguities + * in more elaborate template instantiations). If you want pointers + * to be indicated (with address), please use util::showPtr explicitly. */ template inline std::string diff --git a/src/vault/gear/activity-lang.cpp b/src/vault/gear/activity-lang.cpp index 418c7a7d2..5e8d2e16b 100644 --- a/src/vault/gear/activity-lang.cpp +++ b/src/vault/gear/activity-lang.cpp @@ -118,7 +118,7 @@ namespace gear { + util::toString(data_.feed.two) + "}"; case HOOK: - return util::toString(data_.callback.hook) + return util::showPtr (data_.callback.hook) + "(" + util::toString(data_.callback.arg) + ")"; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index abb0fea26..71bc97107 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -82196,16 +82196,46 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +