summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-05-18 06:08:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-05-18 06:08:48 -0700
commita7916fbac400497b6ac35da8a689a3c2cb68141d (patch)
tree2a80ef3fcdc35977cf51d37f7d6b2f25498ba778
parentdbff4c5e634e23e3c957260ef8d7ddf59d81dbdb (diff)
downloadtxr-a7916fbac400497b6ac35da8a689a3c2cb68141d.tar.gz
txr-a7916fbac400497b6ac35da8a689a3c2cb68141d.tar.bz2
txr-a7916fbac400497b6ac35da8a689a3c2cb68141d.zip
C++ fixes related to recent Unicode work.
* lib.c (chk_wrealloc): convert needs to be a coerce. * parser.l (grammar): Use yyg instead of yyscanner; the latter is the same pointer but of void * type.
-rw-r--r--lib.c2
-rw-r--r--parser.l6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index f40831c2..42facb48 100644
--- a/lib.c
+++ b/lib.c
@@ -2796,7 +2796,7 @@ wchar_t *chk_wrealloc(wchar_t *old, size_t nwchar)
size_t size = nwchar * sizeof (wchar_t);
if (size < nwchar)
uw_throw(error_s, lit("string size overflow"));
- return coerce(wchar_t *, chk_realloc(convert(mem_t *, old),
+ return coerce(wchar_t *, chk_realloc(coerce(mem_t *, old),
sizeof (wchar_t) * nwchar));
}
diff --git a/parser.l b/parser.l
index 774ade24..6ec112ac 100644
--- a/parser.l
+++ b/parser.l
@@ -436,7 +436,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
|| yy_top_state(yyscanner) == QWLIT)
yy_pop_state(yyscanner);
- yylval->lexeme = unicode_ident(yyscanner, yytext);
+ yylval->lexeme = unicode_ident(yyg, yytext);
return SYMTOK;
}
@@ -449,7 +449,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
|| yy_top_state(yyscanner) == QWLIT)
yy_pop_state(yyscanner);
- yylval->lexeme = unicode_ident(yyscanner, yytext);
+ yylval->lexeme = unicode_ident(yyg, yytext);
return SYMTOK;
}
@@ -463,7 +463,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
yyerrorf(yyg, lit("bad token: ~a"),
string_own(utf8_dup_from(yytext)),
nao);
- yylval->lexeme = unicode_ident(yyscanner, yytext);
+ yylval->lexeme = unicode_ident(yyg, yytext);
return SYMTOK;
}