From 45cf0c2dd9538deb91c941720bcacc923003f02d Mon Sep 17 00:00:00 2001 From: cuz Date: Fri, 23 Mar 2001 17:56:28 +0000 Subject: [PATCH] Changed TgtTranslateBuf git-svn-id: svn://svn.cc65.org/cc65/trunk@649 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/pseudo.c | 6 ++++-- src/common/tgttrans.c | 13 +++++-------- src/common/tgttrans.h | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index f1953804e..22c6e533b 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -306,7 +306,8 @@ static void DoASCIIZ (void) Len = strlen (SVal); /* Translate into target charset and emit */ - EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len); + TgtTranslateBuf (SVal, Len); + EmitData ((unsigned char*) SVal, Len); NextTok (); if (Tok == TOK_COMMA) { NextTok (); @@ -342,7 +343,8 @@ static void DoByte (void) if (Tok == TOK_STRCON) { /* A string, translate into target charset and emit */ unsigned Len = strlen (SVal); - EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len); + TgtTranslateBuf (SVal, Len); + EmitData ((unsigned char*) SVal, Len); NextTok (); } else { EmitByte (Expression ()); diff --git a/src/common/tgttrans.c b/src/common/tgttrans.c index 503709803..dce261f47 100644 --- a/src/common/tgttrans.c +++ b/src/common/tgttrans.c @@ -150,7 +150,7 @@ char* TgtTranslateStr (char* S) -char* TgtTranslateBuf (char* Buf, unsigned Len) +void TgtTranslateBuf (void* Buf, unsigned Len) /* Translate a buffer of the given length from the source character set into * the target system character set. */ @@ -158,14 +158,11 @@ char* TgtTranslateBuf (char* Buf, unsigned Len) /* Translate */ if (Tab) { unsigned char* B = (unsigned char*)Buf; - while (Len--) { - *B = Tab[*B]; - ++B; - } + while (Len--) { + *B = Tab[*B]; + ++B; + } } - - /* Return the argument string */ - return Buf; } diff --git a/src/common/tgttrans.h b/src/common/tgttrans.h index 38bdefae8..e11d80adb 100644 --- a/src/common/tgttrans.h +++ b/src/common/tgttrans.h @@ -57,7 +57,7 @@ char* TgtTranslateStr (char* S); * system character set. */ -char* TgtTranslateBuf (char* Buf, unsigned Len); +void TgtTranslateBuf (void* Buf, unsigned Len); /* Translate a buffer of the given length from the source character set into * the target system character set. */ -- 2.39.5