[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MiNT 1.11: faster TRACE() & friends



I believe there was some whitespace missing in the last patch I sent,
which is why I repost it.

Michael

diff -u mint/debug.c:1.4 mint/debug.c:1.5
--- mint/debug.c:1.4	Fri Sep  2 14:59:07 1994
+++ mint/debug.c	Fri Sep  2 14:59:07 1994
@@ -227,11 +227,13 @@
  * Psemaphore, Pmsg, Syield.
  */
 
+#if 0 /* now in debug.h */
 #define FORCE_LEVEL 0
 #define ALERT_LEVEL 1
 #define DEBUG_LEVEL 2
 #define TRACE_LEVEL 3
 #define LOW_LEVEL 4
+#endif
 
 /*
  * The inner loop does this: at each newline, the keyboard is polled. If
diff -u /dev/null mint/debug.h:1.1
--- /dev/null	Fri Sep  2 14:59:07 1994
+++ mint/debug.h	Fri Sep  2 14:59:08 1994
@@ -0,0 +1,30 @@
+extern int debug_level;				/* in debug.c */
+extern int debug_logging;			/* in debug.c */
+
+#define FORCE_LEVEL 0
+#define ALERT_LEVEL 1
+#define DEBUG_LEVEL 2
+#define TRACE_LEVEL 3
+#define LOW_LEVEL 4
+
+#ifndef DEBUG_INFO
+
+# define TRACELOW(x)
+# define TRACE(x)
+# define DEBUG(x)
+
+#else                         
+
+# define TRACELOW(s) \
+  do { if (debug_logging || (debug_level >= LOW_LEVEL)) \
+         Tracelow s ; } while(0)
+
+# define TRACE(s) \
+  do { if (debug_logging || (debug_level >= TRACE_LEVEL)) \
+         Trace s ; } while(0)
+
+# define DEBUG(s) \
+  do { if (debug_logging || (debug_level >= DEBUG_LEVEL)) \
+         Debug s ; } while(0)
+
+#endif /* DEBUG_INFO */
diff -u mint/mint.h:1.10 mint/mint.h:1.11
--- mint/mint.h:1.10	Fri Sep  2 14:59:08 1994
+++ mint/mint.h	Fri Sep  2 14:59:08 1994
@@ -247,15 +247,7 @@
 #define DEBUG_INFO
 #endif
 
-#ifndef DEBUG_INFO
-#define TRACELOW(x)
-#define TRACE(x)
-#define DEBUG(x)
-#else
-#define TRACELOW(x) Tracelow x
-#define TRACE(x) Trace x
-#define DEBUG(x) Debug x
-#endif
+#include "debug.h"
 
 #define check_addr(x) 0
 #define yield() sleep(READY_Q, 0L)