Changed TgtTranslateBuf
git-svn-id: svn://svn.cc65.org/cc65/trunk@649 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -306,7 +306,8 @@ static void DoASCIIZ (void)
|
|||||||
Len = strlen (SVal);
|
Len = strlen (SVal);
|
||||||
|
|
||||||
/* Translate into target charset and emit */
|
/* Translate into target charset and emit */
|
||||||
EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len);
|
TgtTranslateBuf (SVal, Len);
|
||||||
|
EmitData ((unsigned char*) SVal, Len);
|
||||||
NextTok ();
|
NextTok ();
|
||||||
if (Tok == TOK_COMMA) {
|
if (Tok == TOK_COMMA) {
|
||||||
NextTok ();
|
NextTok ();
|
||||||
@@ -342,7 +343,8 @@ static void DoByte (void)
|
|||||||
if (Tok == TOK_STRCON) {
|
if (Tok == TOK_STRCON) {
|
||||||
/* A string, translate into target charset and emit */
|
/* A string, translate into target charset and emit */
|
||||||
unsigned Len = strlen (SVal);
|
unsigned Len = strlen (SVal);
|
||||||
EmitData ((unsigned char*) TgtTranslateBuf (SVal, Len), Len);
|
TgtTranslateBuf (SVal, Len);
|
||||||
|
EmitData ((unsigned char*) SVal, Len);
|
||||||
NextTok ();
|
NextTok ();
|
||||||
} else {
|
} else {
|
||||||
EmitByte (Expression ());
|
EmitByte (Expression ());
|
||||||
|
|||||||
@@ -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
|
/* Translate a buffer of the given length from the source character set into
|
||||||
* the target system character set.
|
* the target system character set.
|
||||||
*/
|
*/
|
||||||
@@ -158,14 +158,11 @@ char* TgtTranslateBuf (char* Buf, unsigned Len)
|
|||||||
/* Translate */
|
/* Translate */
|
||||||
if (Tab) {
|
if (Tab) {
|
||||||
unsigned char* B = (unsigned char*)Buf;
|
unsigned char* B = (unsigned char*)Buf;
|
||||||
while (Len--) {
|
while (Len--) {
|
||||||
*B = Tab[*B];
|
*B = Tab[*B];
|
||||||
++B;
|
++B;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the argument string */
|
|
||||||
return Buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ char* TgtTranslateStr (char* S);
|
|||||||
* system character set.
|
* 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
|
/* Translate a buffer of the given length from the source character set into
|
||||||
* the target system character set.
|
* the target system character set.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user