1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Use the CHECK macros from the common dir

git-svn-id: svn://svn.cc65.org/cc65/trunk@251 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-08-01 15:17:43 +00:00
parent 7e4a0ed5c6
commit 5ee8618510
27 changed files with 81 additions and 185 deletions

View File

@ -51,15 +51,6 @@
/* Warning level */
unsigned WarnLevel = 1;
/* Messages for internal compiler errors */
const char _MsgCheckFailed [] =
"Check failed: `%s' (= %d), file `%s', line %u\n";
const char _MsgPrecondition [] =
"Precondition violated: `%s' (= %d), file `%s', line %u\n";
const char _MsgFail [] =
"%s, file `%s', line %u\n";
/* Statistics */
unsigned ErrorCount = 0;
unsigned WarningCount = 0;

View File

@ -153,11 +153,6 @@ enum Fatals {
/* Warning levels */
extern unsigned WarnLevel;
/* Messages for internal compiler errors */
extern const char _MsgCheckFailed [];
extern const char _MsgPrecondition [];
extern const char _MsgFail [];
/* Statistics */
extern unsigned ErrorCount;
extern unsigned WarningCount;
@ -191,17 +186,6 @@ void Fatal (unsigned FatNum, ...);
void Internal (const char* Format, ...);
/* Print a message about an internal compiler error and die. */
#define CHECK(c) \
if (!(c)) \
Internal (_MsgCheckFailed, #c, c, __FILE__, __LINE__)
#define PRECONDITION(c) \
if (!(c)) \
Internal (_MsgPrecondition, #c, c, __FILE__, __LINE__)
#define FAIL(s) \
Internal (_MsgFail, s, __FILE__, __LINE__)
/* End of error.h */

View File

@ -34,6 +34,7 @@
/* common */
#include "check.h"
#include "exprdefs.h"
#include "xmalloc.h"

View File

@ -37,8 +37,11 @@
#include <string.h>
#include <ctype.h>
#include "../common/bitops.h"
/* common */
#include "bitops.h"
#include "check.h"
/* ca65 */
#include "ea.h"
#include "error.h"
#include "expr.h"

View File

@ -33,8 +33,11 @@
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "xmalloc.h"
/* ca65 */
#include "error.h"
#include "istack.h"

View File

@ -38,6 +38,7 @@
#include <errno.h>
/* common */
#include "check.h"
#include "fname.h"
#include "segdefs.h"
#include "version.h"

View File

@ -33,6 +33,10 @@
/* common */
#include "check.h"
/* ca65 */
#include "error.h"
#include "scanner.h"
#include "macpack.h"

View File

@ -36,9 +36,12 @@
#include <stdio.h>
#include <string.h>
#include "../common/hashstr.h"
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "hashstr.h"
#include "xmalloc.h"
/* ca65 */
#include "condasm.h"
#include "error.h"
#include "istack.h"
@ -657,7 +660,7 @@ static void StartExpDefine (Macro* M)
/* A define style macro must be called with as many actual parameters
* as there are formal ones. Get the parameter count.
*/
*/
unsigned Count = M->ParamCount;
/* Skip the current token */

View File

@ -35,6 +35,10 @@
#include <stdio.h>
/* common */
#include "check.h"
/* ca65 */
#include "error.h"
#include "expr.h"
#include "scanner.h"

View File

@ -38,9 +38,10 @@
#include <ctype.h>
/* common */
#include "check.h"
#include "segdefs.h"
#include "xmalloc.h"
/* cc65 */
#include "error.h"
#include "fragment.h"
@ -162,7 +163,7 @@ static Segment* NewSegment (const char* Name, unsigned SegType)
return S;
}
void UseCodeSeg (void)
/* Use the code segment */

View File

@ -41,6 +41,7 @@
/* common */
#include "bitops.h"
#include "check.h"
/* ca65 */
#include "condasm.h"

View File

@ -41,9 +41,10 @@
#include <sys/stat.h>
/* common */
#include "check.h"
#include "fname.h"
#include "xmalloc.h"
/* ca65 */
#include "condasm.h"
#include "error.h"

View File

@ -36,10 +36,11 @@
#include <string.h>
/* common */
#include "symdefs.h"
#include "check.h"
#include "hashstr.h"
#include "symdefs.h"
#include "xmalloc.h"
/* ca65 */
#include "global.h"
#include "error.h"
@ -998,7 +999,7 @@ void WriteImports (void)
}
S = S->List;
}
/* Done writing imports */
ObjEndImports ();
}

View File

@ -34,10 +34,11 @@
#include <string.h>
/* common */
#include "check.h"
#include "xmalloc.h"
/* ca65 */
#include "error.h"
#include "istack.h"

View File

@ -33,9 +33,12 @@
#include "../common/filepos.h"
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "filepos.h"
#include "xmalloc.h"
/* ca65 */
#include "error.h"
#include "expr.h"
#include "scanner.h"

View File

@ -37,29 +37,15 @@
#include <stdlib.h>
#include <stdarg.h>
#include "../common/cmdline.h"
/* common */
#include "cmdline.h"
/* cl65 */
#include "global.h"
#include "error.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
const char _MsgCheckFailed [] =
"Check failed: `%s' (= %d), file `%s', line %u\n";
const char _MsgPrecondition [] =
"Precondition violated: `%s' (= %d), file `%s', line %u\n";
const char _MsgFail [] =
"%s, file `%s', line %u\n";
/*****************************************************************************/
/* Code */
/*****************************************************************************/

View File

@ -38,19 +38,6 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
extern const char _MsgCheckFailed [];
extern const char _MsgPrecondition [];
extern const char _MsgFail [];
/*****************************************************************************/
/* Code */
/*****************************************************************************/
@ -66,17 +53,6 @@ void Error (const char* Format, ...);
void Internal (const char* Format, ...);
/* Print an internal error message and die */
#define CHECK(c) \
if (!(c)) \
Internal (_MsgCheckFailed, #c, c, __FILE__, __LINE__)
#define PRECONDITION(c) \
if (!(c)) \
Internal (_MsgPrecondition, #c, c, __FILE__, __LINE__)
#define FAIL(s) \
Internal (_MsgFail, s, __FILE__, __LINE__)
/* End of error.h */

View File

@ -38,9 +38,12 @@
#include <string.h>
#include <errno.h>
#include "../common/bitops.h"
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "bitops.h"
#include "xmalloc.h"
/* ld65 */
#include "error.h"
#include "global.h"
#include "bin.h"

View File

@ -35,9 +35,12 @@
#include <string.h>
#include "../common/symdefs.h"
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "symdefs.h"
#include "xmalloc.h"
/* ld65 */
#include "global.h"
#include "error.h"
#include "fileio.h"

View File

@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -41,22 +41,6 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
const char _MsgCheckFailed [] =
"Check failed: `%s' (= %d), file `%s', line %u\n";
const char _MsgPrecondition [] =
"Precondition violated: `%s' (= %d), file `%s', line %u\n";
const char _MsgFail [] =
"%s, file `%s', line %u\n";
/*****************************************************************************/
/* Code */
/*****************************************************************************/

View File

@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -43,19 +43,6 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
extern const char _MsgCheckFailed [];
extern const char _MsgPrecondition [];
extern const char _MsgFail [];
/*****************************************************************************/
/* Code */
/*****************************************************************************/
@ -71,18 +58,7 @@ void Error (const char* Format, ...) attribute((format(printf,1,2)));
void Internal (const char* Format, ...) attribute((format(printf,1,2)));
/* Print an internal error message and die */
#define CHECK(c) \
if (!(c)) \
Internal (_MsgCheckFailed, #c, c, __FILE__, __LINE__)
#define PRECONDITION(c) \
if (!(c)) \
Internal (_MsgPrecondition, #c, c, __FILE__, __LINE__)
#define FAIL(s) \
Internal (_MsgFail, s, __FILE__, __LINE__)
/* End of error.h */

View File

@ -37,10 +37,13 @@
#include <stdlib.h>
#include <string.h>
#include "../common/symdefs.h"
#include "../common/hashstr.h"
#include "../common/xmalloc.h"
/* common */
#include "check.h"
#include "hashstr.h"
#include "symdefs.h"
#include "xmalloc.h"
/* ld65 */
#include "global.h"
#include "error.h"
#include "fileio.h"

View File

@ -34,6 +34,7 @@
/* common */
#include "check.h"
#include "exprdefs.h"
#include "xmalloc.h"

View File

@ -39,6 +39,7 @@
#include <time.h>
/* common */
#include "check.h"
#include "version.h"
#include "xmalloc.h"

View File

@ -37,12 +37,13 @@
#include <string.h>
/* common */
#include "check.h"
#include "exprdefs.h"
#include "hashstr.h"
#include "segdefs.h"
#include "symdefs.h"
#include "xmalloc.h"
/* ld65 */
#include "error.h"
#include "expr.h"

View File

@ -41,22 +41,6 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
const char _MsgCheckFailed [] =
"Check failed: `%s' (= %d), file `%s', line %u\n";
const char _MsgPrecondition [] =
"Precondition violated: `%s' (= %d), file `%s', line %u\n";
const char _MsgFail [] =
"%s, file `%s', line %u\n";
/*****************************************************************************/
/* Code */
/*****************************************************************************/

View File

@ -43,19 +43,6 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Messages for internal compiler errors */
extern const char _MsgCheckFailed [];
extern const char _MsgPrecondition [];
extern const char _MsgFail [];
/*****************************************************************************/
/* Code */
/*****************************************************************************/
@ -71,17 +58,6 @@ void Error (const char* Format, ...) attribute((format(printf,1,2)));
void Internal (const char* Format, ...) attribute((format(printf,1,2)));
/* Print an internal error message and die */
#define CHECK(c) \
if (!(c)) \
Internal (_MsgCheckFailed, #c, c, __FILE__, __LINE__)
#define PRECONDITION(c) \
if (!(c)) \
Internal (_MsgPrecondition, #c, c, __FILE__, __LINE__)
#define FAIL(s) \
Internal (_MsgFail, s, __FILE__, __LINE__)
/* End of error.h */