-
Reactor: Handle more implicit casting for Call() arguments · 51f08312Ben Clayton authored
Add cast() static method to the CToReactor trait specializations. Use this in CallHelper to automatically convert C to Reactor types. This was implicitly handled by (most) reactor types having a contructor that took the C type, but this does not work for more complex conversions, such as 'const char*' -> rr::Pointer<Byte>. This particular conversion is now automatically handled when using Call() to invoke a function with a 'const char*' parameter. This also allows developers to define custom cast functions by specializing rr::CToReactor for their own types. This change also swaps the naming of CToReactor and CToReactorT. CToReactor now has contains 'type' and 'cast', and the 'T' suffix is more in keeping with the C++ traits naming convention for aliasing the ::type. Bug: b/143479561 Change-Id: I81faae365b5cbe0e45055160cc0f5470cd4fb2de Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38028Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Tested-by:
Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
51f08312
×