From 4f8389e7668b3f5790cf302159be07fba629130b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 21 Jul 2012 11:16:57 +0000 Subject: [PATCH] [INTERPRETER] * NEW: You can convert a pointer to a static structure now. It is useful when an extern function has a 'struct XXX **' argument. git-svn-id: svn://localhost/gambas/trunk@4974 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_value.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/main/gbx/gbx_value.c b/main/gbx/gbx_value.c index 095237efa..97b610f5d 100644 --- a/main/gbx/gbx_value.c +++ b/main/gbx/gbx_value.c @@ -754,10 +754,22 @@ __OBJECT: { if (value->type == T_NULL) { - OBJECT_null(value, (CLASS *)type); /* marche aussi pour type = T_OBJECT */ + OBJECT_null(value, (CLASS *)type); // Also works if type == T_OBJECT goto __TYPE; } + if (value->type == T_POINTER) + { + class = (CLASS *)type; + + if (CLASS_is_struct(class)) + { + value->_object.object = CSTRUCT_create_static(STRUCT_CONST, class, value->_pointer.value); + goto __TYPE; + } + + } + if (value->type == T_VARIANT) goto __v2;