From 6368b35c1fa457f9fd5c684420ce84966c23ba80 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Tue, 7 Feb 2023 00:25:46 +1100 Subject: [PATCH] Update types.md --- types.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types.md b/types.md index 2bbd286..04bf4c2 100644 --- a/types.md +++ b/types.md @@ -100,13 +100,13 @@ var number: t = 0; //what if it had been false? Sometimes, you may need to pass data through Toy that Toy can't normally handle. This data is called "opaque" data, and is passed around by reference rather than value. Anything can be passed in as opaque data, as long as it's represented as a void pointer in C. ```c -Literal opaque = TO_OPAQUE_LITERAL(&data, 0); +Literal opaque = TOY_TO_OPAQUE_LITERAL(&data, 0); //... -void* dataPtr = AS_OPAQUE(opaque); +void* dataPtr = TOY_AS_OPAQUE(opaque); -int tag = OPAQUE_TAG(opaque); //for identifying the data in the host +int tag = TOY_GET_OPAQUE_TAG(opaque); //for identifying the data in the host ``` Managing and cleaning up opaque data is a task left entirely to the host program - you can do this with the opaque literal's tag.