]> git.sur5r.net Git - cc65/commitdiff
Use the CHECK macros from the common dir
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 1 Aug 2000 15:17:43 +0000 (15:17 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 1 Aug 2000 15:17:43 +0000 (15:17 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@251 b7a2c559-68d2-44c3-8de9-860c34a00d81

27 files changed:
src/ca65/error.c
src/ca65/error.h
src/ca65/expr.c
src/ca65/instr.c
src/ca65/istack.c
src/ca65/listing.c
src/ca65/macpack.c
src/ca65/macro.c
src/ca65/nexttok.c
src/ca65/objcode.c
src/ca65/pseudo.c
src/ca65/scanner.c
src/ca65/symtab.c
src/ca65/toklist.c
src/ca65/ulabel.c
src/cl65/error.c
src/cl65/error.h
src/ld65/config.c
src/ld65/dbgsyms.c
src/ld65/error.c
src/ld65/error.h
src/ld65/exports.c
src/ld65/expr.c
src/ld65/o65.c
src/ld65/segments.c
src/od65/error.c
src/od65/error.h

index 86fd96b2985971c1f39accbf04a1ff5463155ec9..93ffa121a2809735599d063a02ddcbcef9aa24ad 100644 (file)
 /* 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;
index c7bd9d86c97c0e964f6164837b5c0d08a30927f8..f3ebceb7b1db6855a61a2c994609fab73aaa74e7 100644 (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 */
index 535bea07d8183dc515b256a4ac05007299410441..5cd4610c40773f03adaed2ffb1a3628863116f86 100644 (file)
@@ -34,6 +34,7 @@
 
 
 /* common */
+#include "check.h"
 #include "exprdefs.h"
 #include "xmalloc.h"
 
index 6f8b3fea7c15b1496788d545f9b63ac423272bb5..553296471d0db506f012baa2556b415f1220be26 100644 (file)
 #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"
index 18b4031c260005ad57dd1e5716ce05dd39883afa..3b7ffb648fe5d04219e3a3c2f85e356752db9d5f 100644 (file)
 
 
 
-#include "../common/xmalloc.h"
-
+/* common */
+#include "check.h"
+#include "xmalloc.h"
+                 
+/* ca65 */
 #include "error.h"
 #include "istack.h"
 
index 3f3fb3d79acb76b78875fa46f76f23463327a197..94edfd2c98adddcf44a1edb505ddb0a336152e9f 100644 (file)
@@ -38,6 +38,7 @@
 #include <errno.h>
 
 /* common */
+#include "check.h"
 #include "fname.h"
 #include "segdefs.h"
 #include "version.h"
index 8f50eedba24a8c9cbad39033c809e275274d362e..317cf390cc59a0e46f36ed189b2bb7ae578bc7d6 100644 (file)
 
 
 
+/* common */
+#include "check.h"
+                 
+/* ca65 */
 #include "error.h"
 #include "scanner.h"
 #include "macpack.h"
index d85fbcc905fd31a71e308982b915b56068805148..be71e3761f438842ca10faf0ec7077c25b9ecdac 100644 (file)
 #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 */
index 9504e29280e3ab6cb70521b38a994bf2370a4278..f460cdc91f6c4df57dd2974a1ff3ede6e7f8dbe6 100644 (file)
 
 #include <stdio.h>
 
+/* common */
+#include "check.h"
+                  
+/* ca65 */
 #include "error.h"
 #include "expr.h"
 #include "scanner.h"
index a6bf604d9200d5c8e4848aace618b49566a1d3ee..5ad68f41eccf77cd21e512e1398e24464f86d550 100644 (file)
 #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 */
index 057eead6c80b1691040e2e90b6550ebd0c7b7b1e..8604ca75f5ebbac5e50231e48f74eef40f86b061 100644 (file)
@@ -41,6 +41,7 @@
 
 /* common */
 #include "bitops.h"
+#include "check.h"
 
 /* ca65 */
 #include "condasm.h"
index 4647d4c018a9c625091223b0d0b54c73cd3f5244..fbebe0277b88b4a1ff915d8c9bb43faf044b97f3 100644 (file)
 #include <sys/stat.h>
 
 /* common */
+#include "check.h"
 #include "fname.h"
 #include "xmalloc.h"
-         
+
 /* ca65 */
 #include "condasm.h"
 #include "error.h"
index d7997fa7bb57e5d81ac937cfca61d4296d0607e1..027f715ddf224f7b811d34bd944719d0dcf3a6dc 100644 (file)
 #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 ();
 }
index 82137f720622d27a82a687795a37f5ff352305d8..ff1cfa2674cf9200f7cfe2e8a186fb51d778cd6f 100644 (file)
 
 
 #include <string.h>
-                     
+
 /* common */
+#include "check.h"
 #include "xmalloc.h"
-         
+
 /* ca65 */
 #include "error.h"
 #include "istack.h"
index 1618afb73f39ee2d8111b61246e44fc6050bd3f4..4faee3d2187a8bcb427f551887cd2612841a163f 100644 (file)
 
 
 
-#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"
index 54cdc2b22033114e64b8016fd53e682918693ceb..0372d50a08f035b05fafc3a7b9ff3a0ea435a382 100644 (file)
 #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                                    */
 /*****************************************************************************/
index e029eb5c3f0e88cf51a4a33f42ffcda9b72c3d8b..755e91476e869580b7cc27e0140ccce56458ccd5 100644 (file)
 
 
 
-/*****************************************************************************/
-/*                                  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 */
index 3d9869899d8a8f099219be1a4e51ddd3e7b1ebb4..d3f63765481721f47aa51eb15f56b540719b4156 100644 (file)
 #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"
index 5df33aaf4c782bbc9d09ac7aa62b335198977599..911dedab9239d518311446ba321f550fb14a6651 100644 (file)
 
 #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"
index 53b06d16bdffcbe60bf815093f3a92c576b08684..fa049488b0063b80fae1267c38926e10b9daf0d1 100644 (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       */
 
 
 
-/*****************************************************************************/
-/*                                  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                                    */
 /*****************************************************************************/
index 263a4881e1f4549a8e5cdfe30ad972b696e82659..a29a0822986f6fd91deffff9571d75e37d25d264 100644 (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       */
 
 
 
-/*****************************************************************************/
-/*                                  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 */
 
index 7141067a36cd9c185128236a9325162dd4d4cf29..93681465b4e9e9acef9bc828671bb643e0b4f406 100644 (file)
 #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"
index 51471bb30cff258cc140ccc7377d1206ddb61947..3e1f01041d8f1e09f5a79c5379f3f3546df98bcf 100644 (file)
@@ -34,6 +34,7 @@
 
 
 /* common */
+#include "check.h"
 #include "exprdefs.h"
 #include "xmalloc.h"
 
index a630cc0352f3a429b8b77e2c8776c20d78a73fdf..c1441037b94df66279035673cfdd88b1b03fcad8 100644 (file)
@@ -39,6 +39,7 @@
 #include <time.h>
 
 /* common */
+#include "check.h"
 #include "version.h"
 #include "xmalloc.h"
 
index 66b6f1ea044655e121c4c9fe8e55bf9d9f385fc9..17976e52d804514084187442744e32bd99fc623b 100644 (file)
 #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"
index 8b3da8a46133312f94118361e1f99cf21197e095..3d934e5c1832c3577086d8e7ab5303ef0158e770 100644 (file)
 
 
 
-/*****************************************************************************/
-/*                                  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                                    */
 /*****************************************************************************/
index d434cd4c780ce6b600c058b39e5dde780163d4a5..f4dbf3fd4db97a103cd00dd2482413cfb9039419 100644 (file)
 
 
 
-/*****************************************************************************/
-/*                                  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 */