Skip to content

Conversation

@willvale
Copy link
Contributor

More type/casting fixes, this time for external function arguments and return values.

  • Adds support for uint/float/bool push/pop of function args.
  • Adds missing int32->uint32 numeric_cast.
  • Adds missing boolean output (toStr and string size)
  • Fixed toStr(string) which only worked for strings of one character.
  • Added test case roundtripping values of the supported types to the host.

willvale and others added 17 commits November 8, 2025 00:27
value as present.
Replace unchecked access to _value with checked access for the various
operators.
And define ptrdiff_t using decltype so it works for 32b and 64b arch.
This might be better with a high-level flag as well?
(Template wasn't being instantiated in my build environment, d'oh)
Support uint32, bool and float in function_base::push/pop
Support int32 -> uint32 cast
Allow bool output.
Fix toStr(char*) for strings longer than 1.
Add toStr(bool)
Added ExternalFunctionTypes.ink/cpp, which test a roundtrip of different types to the host.
Updated CMakeLists.txt.
Allow type conversion on redefine if the casting matrix says the types
have a common base.
Allow bool->float conversion.
Support uint32, bool and float in function_base::push/pop
Support int32 -> uint32 cast
Allow bool output.
Fix toStr(char*) for strings longer than 1.
Add toStr(bool)
Added ExternalFunctionTypes.ink/cpp, which test a roundtrip of different types to the host.
Updated CMakeLists.txt.
@willvale
Copy link
Contributor Author

This is a bit messy, there are only 3 relevant commits but I couldn't get it to rebase against master cleanly.

@JBenda
Copy link
Owner

JBenda commented Dec 18, 2025

Great find of cross-synergy. I did not think of this when implementing the new type system.

Thanks 👍

@JBenda JBenda merged commit ea71901 into JBenda:master Dec 18, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants