From 131653ab1f0ba32f4d8dbcad684504c1fbc685ab Mon Sep 17 00:00:00 2001 From: gambas Date: Tue, 18 Feb 2020 23:03:24 +0100 Subject: [PATCH] Converting a string to a pointer returns a pointer pointing at the beginning of the string. [INTERPRETER] * NEW: Converting a string to a pointer returns a pointer pointing at the beginning of the string. --- main/gbx/gbx_value.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/gbx/gbx_value.c b/main/gbx/gbx_value.c index 203e268d3..46ac1325a 100644 --- a/main/gbx/gbx_value.c +++ b/main/gbx/gbx_value.c @@ -362,8 +362,8 @@ void VALUE_convert(VALUE *value, TYPE type) /* g */ { &&__N, &&__g2b, &&__g2c, &&__g2h, &&__g2i, &&__g2l, &&__OK, &&__g2f, &&__g2d, &&__g2s, &&__g2s, &&__N, &&__2v, &&__N, &&__N, &&__N, }, /* f */ { &&__N, &&__f2b, &&__f2c, &&__f2h, &&__f2i, &&__f2l, &&__f2g, &&__OK, &&__f2d, &&__f2s, &&__f2s, &&__N, &&__2v, &&__N, &&__N, &&__N, }, /* d */ { &&__N, &&__d2b, &&__d2c, &&__d2h, &&__d2i, &&__d2l, &&__d2g, &&__d2f, &&__OK, &&__d2s, &&__d2s, &&__N, &&__2v, &&__N, &&__N, &&__N, }, - /* cs */ { &&__N, &&__s2b, &&__s2c, &&__s2h, &&__s2i, &&__s2l, &&__s2g, &&__s2f, &&__s2d, &&__OK, &&__OK, &&__N, &&__s2v, &&__N, &&__N, &&__N, }, - /* s */ { &&__N, &&__s2b, &&__s2c, &&__s2h, &&__s2i, &&__s2l, &&__s2g, &&__s2f, &&__s2d, &&__OK, &&__OK, &&__N, &&__s2v, &&__N, &&__N, &&__N, }, + /* cs */ { &&__N, &&__s2b, &&__s2c, &&__s2h, &&__s2i, &&__s2l, &&__s2g, &&__s2f, &&__s2d, &&__OK, &&__OK, &&__s2p, &&__s2v, &&__N, &&__N, &&__N, }, + /* s */ { &&__N, &&__s2b, &&__s2c, &&__s2h, &&__s2i, &&__s2l, &&__s2g, &&__s2f, &&__s2d, &&__OK, &&__OK, &&__s2p, &&__s2v, &&__N, &&__N, &&__N, }, /* p */ { &&__N, &&__p2b, &&__N, &&__N, &&__p2i, &&__p2l, &&__N, &&__N, &&__N, &&__p2s, &&__p2s, &&__OK, &&__2v, &&__N, &&__N, &&__N, }, /* v */ { &&__N, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__v2, &&__OK, &&__N, &&__v2, &&__v2, }, /* func */ { &&__N, &&__func, &&__func, &&__func, &&__func, &&__func, &&__func, &&__func, &&__func, &&__func, &&__func, &&__F2p, &&__func, &&__OK, &&__N, &&__func, }, @@ -756,6 +756,12 @@ __s2d: STRING_unref(&addr); return; + +__s2p: + + value->_pointer.value = value->_string.addr + value->_string.start; + value->type = T_POINTER; + return; __n2b: