]> git.sur5r.net Git - cc65/blobdiff - src/common/check.h
Only for jumps, the lib uses named asm labels in branches
[cc65] / src / common / check.h
index e0a211392d16ba4bda50f2d58ad791410a29b81f..738fa262678d9fef091f06b6d1abe47480f815fd 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                 check.h                                  */
+/*                                  check.h                                  */
 /*                                                                           */
-/*                           Assert like macros                             */
+/*                            Assert like macros                             */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
 
 
 
-extern const char* MsgInternalError;           /* "Internal error: "        */
-extern const char* MsgPrecondition;            /* "Precondition violated: " */
-extern const char* MsgCheckFailed;             /* "Check failed: "          */
-extern const char* MsgProgramAborted;          /* "Program aborted: "       */
+extern const char* MsgInternalError;            /* "Internal error: "        */
+extern const char* MsgPrecondition;             /* "Precondition violated: " */
+extern const char* MsgCheckFailed;              /* "Check failed: "          */
+extern const char* MsgProgramAborted;           /* "Program aborted: "       */
 
 
 
 extern void (*CheckFailed) (const char* Msg, const char* Cond,
-                                   const char* File, unsigned Line)
-                           attribute ((noreturn));
+                            const char* File, unsigned Line)
+                            attribute ((noreturn));
 /* Function pointer that is called from check if the condition code is true. */
 
 
@@ -73,20 +73,18 @@ extern void (*CheckFailed) (const char* Msg, const char* Cond,
 
 #define ABORT(s) CheckFailed (MsgProgramAborted, s, __FILE__, __LINE__)
 /* Use this one instead of FAIL if there is no internal program error but an
- * error condition that is caused by the user or operating system (FAIL and
- * ABORT are essentially the same but the message differs).
- */
+** error condition that is caused by the user or operating system (FAIL and
+** ABORT are essentially the same but the message differs).
+*/
 
 #define PRECONDITION(c) \
-    ((c)? 0 : (CheckFailed (MsgPrecondition, #c, __FILE__, __LINE__), 0))
+    ((void) ((c)? 0 : (CheckFailed (MsgPrecondition, #c, __FILE__, __LINE__), 0)))
 
-#define CHECK(c)       \
-    ((c)? 0 : (CheckFailed (MsgCheckFailed, #c, __FILE__, __LINE__), 0))
+#define CHECK(c)        \
+    ((void) ((c)? 0 : (CheckFailed (MsgCheckFailed, #c, __FILE__, __LINE__), 0)))
 
 
 
 /* End of check.h */
-#endif
-
-
 
+#endif