From d3998267e85db8e04868e104815edfd7563b9f71 Mon Sep 17 00:00:00 2001 From: Cake Xu Date: Fri, 22 Sep 2023 18:21:46 +0800 Subject: [PATCH] Fix 2 errors for the document: (#1968) 1. Depending on the context the "bar" should be "foo" because foo is a structure while bar is just a string. 2. The module_object's name is wrong. --- docs/writingmodules.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/writingmodules.rst b/docs/writingmodules.rst index dc6c0c416a..ac68306b73 100644 --- a/docs/writingmodules.rst +++ b/docs/writingmodules.rst @@ -755,7 +755,7 @@ And the value for ``qux`` like this: Do you remember that the ``module_object`` argument for ``module_load`` was a pointer to a ``YR_OBJECT``? Do you remember that this ``YR_OBJECT`` is a -structure just like ``bar`` is? Well, you could also set the values for ``bar`` +structure just like ``foo`` is? Well, you could also set the values for ``bar`` and ``qux`` like this: .. code-block:: c @@ -873,7 +873,7 @@ following example: void* module_data, size_t module_data_size) { - module->data = yr_malloc(sizeof(MY_DATA)); + module_object->data = yr_malloc(sizeof(MY_DATA)); ((MY_DATA*) module_object->data)->some_integer = 0; return ERROR_SUCCESS;