mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 17:30:50 +00:00
Several fixes detected when using another C compiler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4785 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4b1c5e4157
commit
1877af89cc
@ -63,9 +63,6 @@ struct StrBuf {
|
|||||||
/* Initializer for a string buffer */
|
/* Initializer for a string buffer */
|
||||||
#define STRBUF_INITIALIZER { 0, 0, 0 }
|
#define STRBUF_INITIALIZER { 0, 0, 0 }
|
||||||
|
|
||||||
/* An empty string buf */
|
|
||||||
static const StrBuf EmptyStrBuf = STRBUF_INITIALIZER;
|
|
||||||
|
|
||||||
/* An array of pointers that grows if needed */
|
/* An array of pointers that grows if needed */
|
||||||
typedef struct Collection Collection;
|
typedef struct Collection Collection;
|
||||||
struct Collection {
|
struct Collection {
|
||||||
@ -77,9 +74,6 @@ struct Collection {
|
|||||||
/* Initializer for static collections */
|
/* Initializer for static collections */
|
||||||
#define COLLECTION_INITIALIZER { 0, 0, 0 }
|
#define COLLECTION_INITIALIZER { 0, 0, 0 }
|
||||||
|
|
||||||
/* An empty collection */
|
|
||||||
static const Collection EmptyCollection = COLLECTION_INITIALIZER;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Data structure containing information from the debug info file. A pointer
|
/* Data structure containing information from the debug info file. A pointer
|
||||||
@ -91,8 +85,7 @@ struct DbgInfo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Input tokens */
|
/* Input tokens */
|
||||||
typedef enum Token Token;
|
typedef enum {
|
||||||
enum Token {
|
|
||||||
|
|
||||||
TOK_INVALID, /* Invalid token */
|
TOK_INVALID, /* Invalid token */
|
||||||
TOK_EOF, /* End of file reached */
|
TOK_EOF, /* End of file reached */
|
||||||
@ -129,7 +122,7 @@ enum Token {
|
|||||||
TOK_ZEROPAGE, /* ZEROPAGE keyword */
|
TOK_ZEROPAGE, /* ZEROPAGE keyword */
|
||||||
|
|
||||||
TOK_IDENT, /* To catch unknown keywords */
|
TOK_IDENT, /* To catch unknown keywords */
|
||||||
};
|
} Token;
|
||||||
|
|
||||||
/* Data used when parsing the debug info file */
|
/* Data used when parsing the debug info file */
|
||||||
typedef struct InputData InputData;
|
typedef struct InputData InputData;
|
||||||
@ -1523,7 +1516,7 @@ static LineInfo* FindLineInfo (FileInfo* F, cc65_addr Addr)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
cc65_dbginfo cc65_read_dbginfo (const char* filename, cc65_errorfunc errorfunc)
|
cc65_dbginfo cc65_read_dbginfo (const char* FileName, cc65_errorfunc ErrFunc)
|
||||||
/* Parse the debug info file with the given name. On success, the function
|
/* Parse the debug info file with the given name. On success, the function
|
||||||
* will return a pointer to an opaque cc65_dbginfo structure, that must be
|
* will return a pointer to an opaque cc65_dbginfo structure, that must be
|
||||||
* passed to the other functions in this module to retrieve information.
|
* passed to the other functions in this module to retrieve information.
|
||||||
@ -1533,7 +1526,7 @@ cc65_dbginfo cc65_read_dbginfo (const char* filename, cc65_errorfunc errorfunc)
|
|||||||
{
|
{
|
||||||
/* Data structure used to control scanning and parsing */
|
/* Data structure used to control scanning and parsing */
|
||||||
InputData D = {
|
InputData D = {
|
||||||
filename, /* Name of input file */
|
0, /* Name of input file */
|
||||||
1, /* Line number */
|
1, /* Line number */
|
||||||
0, /* Input file */
|
0, /* Input file */
|
||||||
0, /* Line at start of current token */
|
0, /* Line at start of current token */
|
||||||
@ -1544,12 +1537,14 @@ cc65_dbginfo cc65_read_dbginfo (const char* filename, cc65_errorfunc errorfunc)
|
|||||||
TOK_INVALID, /* Input token */
|
TOK_INVALID, /* Input token */
|
||||||
0, /* Integer constant */
|
0, /* Integer constant */
|
||||||
STRBUF_INITIALIZER, /* String constant */
|
STRBUF_INITIALIZER, /* String constant */
|
||||||
errorfunc, /* Function called in case of errors */
|
0, /* Function called in case of errors */
|
||||||
0, /* Major version number */
|
0, /* Major version number */
|
||||||
0, /* Minor version number */
|
0, /* Minor version number */
|
||||||
COLLECTION_INITIALIZER, /* Line information */
|
COLLECTION_INITIALIZER, /* Line information */
|
||||||
0, /* Pointer to debug info */
|
0, /* Pointer to debug info */
|
||||||
};
|
};
|
||||||
|
D.FileName = FileName;
|
||||||
|
D.Error = ErrFunc;
|
||||||
|
|
||||||
/* Open the input file */
|
/* Open the input file */
|
||||||
D.F = fopen (D.FileName, "r");
|
D.F = fopen (D.FileName, "r");
|
||||||
|
@ -55,12 +55,11 @@ typedef unsigned cc65_addr; /* Use to store (65xx) addresses */
|
|||||||
*/
|
*/
|
||||||
typedef void* cc65_dbginfo;
|
typedef void* cc65_dbginfo;
|
||||||
|
|
||||||
/* ### Parseerror */
|
/* Severity for cc65_parseerror */
|
||||||
typedef enum cc65_error_severity cc65_error_severity;
|
typedef enum {
|
||||||
enum cc65_error_severity {
|
|
||||||
CC65_WARNING,
|
CC65_WARNING,
|
||||||
CC65_ERROR,
|
CC65_ERROR,
|
||||||
};
|
} cc65_error_severity;
|
||||||
|
|
||||||
/* Warnings/errors in cc65_read_dbginfo are passed via this struct */
|
/* Warnings/errors in cc65_read_dbginfo are passed via this struct */
|
||||||
typedef struct cc65_parseerror cc65_parseerror;
|
typedef struct cc65_parseerror cc65_parseerror;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Makefile for debug info test executable
|
# Makefile for the debug info test executable
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@ -14,10 +14,10 @@ EXE = dbgtest
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g -O2 -Wall -W
|
CFLAGS = -g -O2 -Wall -W
|
||||||
EBIND = emxbind
|
EBIND = emxbind
|
||||||
LDFLAGS = -g
|
LDFLAGS =
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Object files and libraries to link
|
# Object files to link
|
||||||
|
|
||||||
OBJS = dbginfo.o \
|
OBJS = dbginfo.o \
|
||||||
dbgtest.o
|
dbgtest.o
|
||||||
@ -52,7 +52,7 @@ zap: clean
|
|||||||
.PHONY: depend dep
|
.PHONY: depend dep
|
||||||
depend dep: $(OBJS:.o=.c)
|
depend dep: $(OBJS:.o=.c)
|
||||||
@echo "Creating dependency information"
|
@echo "Creating dependency information"
|
||||||
$(CC) -I$(COMMON) -MM $^ > .depend
|
$(CC) -MM $^ > .depend
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user