From 029beab25cf91e4dcb191140ec7fd169f0b2dbce Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Wed, 10 Apr 2013 20:16:33 -0400 Subject: eliminated the second colm location struct --- colm/colm.h | 1 + colm/exports.cc | 10 ---------- colm/global.h | 3 ++- colm/input.h | 3 ++- colm/tree.c | 2 +- colm/tree.h | 2 +- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/colm/colm.h b/colm/colm.h index 79202aa2..a4d6e9fa 100644 --- a/colm/colm.h +++ b/colm/colm.h @@ -10,6 +10,7 @@ struct ColmKid; struct ColmProgram; struct ColmRuntimeData; struct ColmTree; +struct ColmLocation; struct ColmProgram *colmNewProgram( struct ColmRuntimeData *rtd, long debugRealm ); void colmRunProgram( struct ColmProgram *prg, int argc, const char **argv ); diff --git a/colm/exports.cc b/colm/exports.cc index d7d8640c..edcc7ca4 100644 --- a/colm/exports.cc +++ b/colm/exports.cc @@ -63,16 +63,6 @@ void Compiler::generateExports() "#include \n" "\n"; - out << - "struct ColmLocation\n" - "{\n" - " const char *name;\n" - " long line;\n" - " long column;\n" - " long byte;\n" - "};\n" - "\n"; - out << "inline void appendString( ColmPrintArgs *args, const char *data, int length )\n" "{\n" diff --git a/colm/global.h b/colm/global.h index bfee95bd..1f7a0b90 100644 --- a/colm/global.h +++ b/colm/global.h @@ -65,7 +65,8 @@ extern int gblErrorCount; extern char machineMain[]; extern bool gblLibrary; extern const char *gblExportTo; -extern "C" struct ColmLocation; + +struct ColmLocation; /* Location in an input file. */ struct InputLoc diff --git a/colm/input.h b/colm/input.h index 9cbd5f38..6a65385c 100644 --- a/colm/input.h +++ b/colm/input.h @@ -64,6 +64,7 @@ struct Constructor; struct ConsItem; struct _FsmRun; struct ColmTree; +struct ColmLocation; struct ColmProgram; enum RunBufType { @@ -86,7 +87,7 @@ typedef struct _RunBuf RunBuf *newRunBuf(); typedef struct _StreamImpl StreamImpl; -typedef struct _Location Location; +typedef struct ColmLocation Location; struct StreamFuncs { diff --git a/colm/tree.c b/colm/tree.c index 81ba92a0..fe103a7b 100644 --- a/colm/tree.c +++ b/colm/tree.c @@ -2014,7 +2014,7 @@ Location *locSearch( Program *prg, Tree *tree ) struct ColmLocation *findLocation( Program *prg, Tree *tree ) { - return (struct ColmLocation*)locSearch( prg, tree ); + return locSearch( prg, tree ); } void xmlEscapeData( struct ColmPrintArgs *printArgs, const char *data, long len ) diff --git a/colm/tree.h b/colm/tree.h index edfb60f9..8496918c 100644 --- a/colm/tree.h +++ b/colm/tree.h @@ -33,7 +33,7 @@ typedef unsigned long Word; typedef unsigned long Half; struct Bindings; -typedef struct _Location +typedef struct ColmLocation { const char *name; long line; -- cgit v1.2.1