From 2df60e50339282d0b45720b48f4f4a5ac17167a5 Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 29 Nov 2000 15:22:06 +0000 Subject: [PATCH] Use the new TgtTranslateBuf function git-svn-id: svn://svn.cc65.org/cc65/trunk@493 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/pseudo.c | 14 ++++++++++---- src/cc65/litpool.c | 5 +---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index cbc23b721..14568ad22 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -293,14 +293,20 @@ static void DoAlign (void) static void DoASCIIZ (void) /* Define text with a zero terminator */ { + unsigned Len; + while (1) { + /* Must have a string constant */ if (Tok != TOK_STRCON) { ErrorSkip (ERR_STRCON_EXPECTED); return; } + + /* Get the length of the string constant */ + Len = strlen (SVal); + /* Translate into target charset and emit */ - TgtTranslateStr (SVal); - EmitData ((unsigned char*) SVal, strlen (SVal)); + EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len); NextTok (); if (Tok == TOK_COMMA) { NextTok (); @@ -335,8 +341,8 @@ static void DoByte (void) while (1) { if (Tok == TOK_STRCON) { /* A string, translate into target charset and emit */ - TgtTranslateStr (SVal); - EmitData ((unsigned char*) SVal, strlen (SVal)); + unsigned Len = strlen (SVal); + EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len); NextTok (); } else { EmitByte (Expression ()); diff --git a/src/cc65/litpool.c b/src/cc65/litpool.c index 2d4432c53..abe07f4b6 100644 --- a/src/cc65/litpool.c +++ b/src/cc65/litpool.c @@ -74,10 +74,7 @@ void TranslateLiteralPool (unsigned Offs) * charset. */ { - while (Offs < LiteralOffs) { - LiteralPool[Offs] = TgtTranslateChar (LiteralPool[Offs]); - ++Offs; - } + TgtTranslateBuf (LiteralPool + Offs, LiteralOffs - Offs); } -- 2.39.5