mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 15:29:46 +00:00
Use the new TgtTranslateBuf function
git-svn-id: svn://svn.cc65.org/cc65/trunk@493 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
c45592efbf
commit
2df60e5033
@ -293,14 +293,20 @@ static void DoAlign (void)
|
|||||||
static void DoASCIIZ (void)
|
static void DoASCIIZ (void)
|
||||||
/* Define text with a zero terminator */
|
/* Define text with a zero terminator */
|
||||||
{
|
{
|
||||||
|
unsigned Len;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
/* Must have a string constant */
|
||||||
if (Tok != TOK_STRCON) {
|
if (Tok != TOK_STRCON) {
|
||||||
ErrorSkip (ERR_STRCON_EXPECTED);
|
ErrorSkip (ERR_STRCON_EXPECTED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get the length of the string constant */
|
||||||
|
Len = strlen (SVal);
|
||||||
|
|
||||||
/* Translate into target charset and emit */
|
/* Translate into target charset and emit */
|
||||||
TgtTranslateStr (SVal);
|
EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len);
|
||||||
EmitData ((unsigned char*) SVal, strlen (SVal));
|
|
||||||
NextTok ();
|
NextTok ();
|
||||||
if (Tok == TOK_COMMA) {
|
if (Tok == TOK_COMMA) {
|
||||||
NextTok ();
|
NextTok ();
|
||||||
@ -335,8 +341,8 @@ static void DoByte (void)
|
|||||||
while (1) {
|
while (1) {
|
||||||
if (Tok == TOK_STRCON) {
|
if (Tok == TOK_STRCON) {
|
||||||
/* A string, translate into target charset and emit */
|
/* A string, translate into target charset and emit */
|
||||||
TgtTranslateStr (SVal);
|
unsigned Len = strlen (SVal);
|
||||||
EmitData ((unsigned char*) SVal, strlen (SVal));
|
EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len);
|
||||||
NextTok ();
|
NextTok ();
|
||||||
} else {
|
} else {
|
||||||
EmitByte (Expression ());
|
EmitByte (Expression ());
|
||||||
|
@ -74,10 +74,7 @@ void TranslateLiteralPool (unsigned Offs)
|
|||||||
* charset.
|
* charset.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
while (Offs < LiteralOffs) {
|
TgtTranslateBuf (LiteralPool + Offs, LiteralOffs - Offs);
|
||||||
LiteralPool[Offs] = TgtTranslateChar (LiteralPool[Offs]);
|
|
||||||
++Offs;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user