From f871ab4ba611c26a9dc9cccb4725d0084291962e Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 23 Aug 2000 07:01:18 +0000 Subject: [PATCH] Move target handling routines into the common directory. git-svn-id: svn://svn.cc65.org/cc65/trunk@299 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/expr.c | 4 ++-- src/ca65/main.c | 14 ++++++-------- src/ca65/make/gcc.mak | 1 - src/ca65/make/watcom.mak | 2 -- src/ca65/pseudo.c | 6 +++--- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/ca65/expr.c b/src/ca65/expr.c index ba3117857..0675a8c7b 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -36,6 +36,7 @@ /* common */ #include "check.h" #include "exprdefs.h" +#include "tgttrans.h" #include "xmalloc.h" /* ca65 */ @@ -46,7 +47,6 @@ #include "objcode.h" #include "objfile.h" #include "symtab.h" -#include "target.h" #include "toklist.h" #include "ulabel.h" #include "expr.h" @@ -484,7 +484,7 @@ static ExprNode* Factor (void) break; case TOK_CHARCON: - N = LiteralExpr ((unsigned char) XlatChar ((char)IVal)); + N = LiteralExpr (TgtTranslateChar (IVal)); NextTok (); break; diff --git a/src/ca65/main.c b/src/ca65/main.c index 697d47c32..4bfdc2e84 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -41,6 +41,7 @@ /* common */ #include "cmdline.h" +#include "target.h" #include "version.h" /* ca65 */ @@ -61,7 +62,6 @@ #include "pseudo.h" #include "scanner.h" #include "symtab.h" -#include "target.h" #include "ulabel.h" @@ -283,17 +283,15 @@ static void OptSmart (const char* Opt, const char* Arg) static void OptTarget (const char* Opt, const char* Arg) /* Set the target system */ { - int T; if (Arg == 0) { NeedArg (Opt); } /* Map the target name to a target id */ - T = MapTarget (Arg); - if (T < 0) { + Target = FindTarget (Arg); + if (Target == TGT_UNKNOWN) { AbEnd ("Invalid target name: `%s'", Arg); } - Target = (target_t) T; } @@ -554,10 +552,10 @@ int main (int argc, char* argv []) /* Filename. Check if we already had one */ if (InFile) { fprintf (stderr, "%s: Don't know what to do with `%s'\n", - ProgName, Arg); - exit (EXIT_FAILURE); + ProgName, Arg); + exit (EXIT_FAILURE); } else { - InFile = Arg; + InFile = Arg; } } diff --git a/src/ca65/make/gcc.mak b/src/ca65/make/gcc.mak index 9bd03e597..6407780dc 100644 --- a/src/ca65/make/gcc.mak +++ b/src/ca65/make/gcc.mak @@ -32,7 +32,6 @@ OBJS = condasm.o \ repeat.o \ scanner.o \ symtab.o \ - target.o \ toklist.o \ ulabel.o diff --git a/src/ca65/make/watcom.mak b/src/ca65/make/watcom.mak index e634ed4b7..28817ef76 100644 --- a/src/ca65/make/watcom.mak +++ b/src/ca65/make/watcom.mak @@ -90,7 +90,6 @@ OBJS = condasm.obj \ repeat.obj \ scanner.obj \ symtab.obj \ - target.obj \ toklist.obj \ ulabel.obj @@ -137,7 +136,6 @@ FILE pseudo.obj FILE repeat.obj FILE scanner.obj FILE symtab.obj -FILE target.obj FILE toklist.obj FILE ulabel.obj LIBRARY ..\common\common.lib diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index 8321ad3f9..de2131b8f 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -42,6 +42,7 @@ /* common */ #include "bitops.h" #include "check.h" +#include "tgttrans.h" /* ca65 */ #include "condasm.h" @@ -58,7 +59,6 @@ #include "options.h" #include "repeat.h" #include "symtab.h" -#include "target.h" #include "pseudo.h" @@ -270,7 +270,7 @@ static void DoASCIIZ (void) return; } /* Translate into target charset and emit */ - XlatStr (SVal); + TgtTranslateStr (SVal); EmitData ((unsigned char*) SVal, strlen (SVal)); NextTok (); if (Tok == TOK_COMMA) { @@ -306,7 +306,7 @@ static void DoByte (void) while (1) { if (Tok == TOK_STRCON) { /* A string, translate into target charset and emit */ - XlatStr (SVal); + TgtTranslateStr (SVal); EmitData ((unsigned char*) SVal, strlen (SVal)); NextTok (); } else { -- 2.39.5