]> granicus.if.org Git - python/commitdiff
Rename DEBUG macro to Py_DEBUG
authorGuido van Rossum <guido@python.org>
Mon, 30 Dec 1996 16:17:54 +0000 (16:17 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Dec 1996 16:17:54 +0000 (16:17 +0000)
Include/frameobject.h
Include/node.h
Include/object.h
Parser/acceler.c
Parser/grammar.c
Parser/parser.c
Parser/pgen.c
Parser/tokenizer.c
Python/ceval.c
Python/thread.c
Python/thread_sgi.h

index 40dd65373ed828f364223bba5252aa6c7c3ab7f4..85c1f4c10efa44c9af2175b3ae7d44f4635dc5b8 100644 (file)
@@ -80,7 +80,7 @@ PyFrameObject * PyFrame_New
 
 /* Tuple access macros */
 
-#ifndef DEBUG
+#ifndef Py_DEBUG
 #define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i))
 #define GETITEMNAME(v, i) \
        PyString_AS_STRING((PyStringObject *)GETITEM((v), (i)))
index 03d674aa66804f05e73ae50d10a9c0c056d9f92d..0575f4a80ce820c342779d6088909afc13639503 100644 (file)
@@ -56,7 +56,7 @@ extern void PyNode_Free Py_PROTO((node *n));
 #define STR(n)         ((n)->n_str)
 
 /* Assert that the type of a node is what we expect */
-#ifndef DEBUG
+#ifndef Py_DEBUG
 #define REQ(n, type) { /*pass*/ ; }
 #else
 #define REQ(n, type) \
index e876e91661ebd7a0989de1428cd317779d449706..54b5481d493f91c98c466d6deaa5a6b060cefc4c 100644 (file)
@@ -84,7 +84,7 @@ whose size is determined when the object is allocated.
 123456789-123456789-123456789-123456789-123456789-123456789-123456789-12
 */
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 
 /* Turn on heavy reference debugging */
 #define Py_TRACE_REFS
@@ -92,7 +92,7 @@ whose size is determined when the object is allocated.
 /* Turn on reference counting */
 #define Py_REF_DEBUG
 
-#endif /* DEBUG */
+#endif /* Py_DEBUG */
 
 #ifdef Py_TRACE_REFS
 #define PyObject_HEAD \
index 025f01fdf414e1a8500f692d45a9f43f12bd8c50..ef1edc3013e71dab7ce8a32c07972eeb3cc68d37 100644 (file)
@@ -56,14 +56,14 @@ addaccelerators(g)
 {
        dfa *d;
        int i;
-#ifdef DEBUG
+#ifdef Py_DEBUG
        fprintf(stderr, "Adding parser accelerators ...\n");
 #endif
        d = g->g_dfa;
        for (i = g->g_ndfas; --i >= 0; d++)
                fixdfa(g, d);
        g->g_accel = 1;
-#ifdef DEBUG
+#ifdef Py_DEBUG
        fprintf(stderr, "Done.\n");
 #endif
 }
index 51bf90ea37c9266122c9bf44f84c25cd23574d55..5eebd3192e06dd2bf632644506821409a570f061 100644 (file)
@@ -171,7 +171,7 @@ translatelabels(g)
 {
        int i;
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
        printf("Translating labels ...\n");
 #endif
        /* Don't translate EMPTY */
index e6fc180ee6fe15b5ff78f84ad9bc192cd2c1ba3a..e42fb11e4b823fedf28d58671e3104d965a45e89 100644 (file)
@@ -44,7 +44,7 @@ PERFORMANCE OF THIS SOFTWARE.
 #include "errcode.h"
 
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 extern int debugging;
 #define D(x) if (!debugging); else x
 #else
@@ -85,7 +85,7 @@ s_push(s, d, parent)
        return 0;
 }
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 
 static void s_pop PROTO((stack *));
 
@@ -98,7 +98,7 @@ s_pop(s)
        s->s_top++;
 }
 
-#else /* !DEBUG */
+#else /* !Py_DEBUG */
 
 #define s_pop(s) (s)->s_top++
 
@@ -309,7 +309,7 @@ addtoken(ps, type, str, lineno)
 }
 
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 
 /* DEBUG OUTPUT */
 
@@ -379,7 +379,7 @@ printtree(ps)
        printf("\n");
 }
 
-#endif /* DEBUG */
+#endif /* Py_DEBUG */
 
 /*
 
index c5a0618479c957f8be576a15ecc0c9c69c5132ba..96686309397f63d301d2264c44a6082604a06b64 100644 (file)
@@ -166,7 +166,7 @@ addnfa(gr, name)
        return nf;
 }
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 
 static char REQNFMT[] = "metacompile: less than %d children\n";
 
index 8a726e0ea3f13fc2d3469f82bd89937dd52c9bfd..75c1e4e7e21178a5c8f51004af1c0d5118132269 100644 (file)
@@ -736,7 +736,7 @@ tok_get(tok, p_start, p_end)
 }
 
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 
 void
 tok_dump(type, start, end)
index 7b7fdf0ac516976c0c9883c039ecfd752c5d6b8f..816973f86a7404c8b466e74a1aaf8a2aa61e0eea 100644 (file)
@@ -51,7 +51,7 @@ PERFORMANCE OF THIS SOFTWARE.
 /* Turn this on if your compiler chokes on the big switch: */
 /* #define CASE_TOO_BIG 1 */
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 /* For debugging the interpreter: */
 #define LLTRACE  1     /* Low-level trace feature */
 #define CHECKEXC 1     /* Double-check exception checking */
@@ -339,7 +339,7 @@ eval_code2(co, globals, locals,
 #ifdef LLTRACE
        int lltrace;
 #endif
-#if defined(DEBUG) || defined(LLTRACE)
+#if defined(Py_DEBUG) || defined(LLTRACE)
        /* Make it easier to find out where we are with a debugger */
        char *filename = getstringvalue(co->co_filename);
 #endif
@@ -602,7 +602,7 @@ eval_code2(co, globals, locals,
 
                /* Extract opcode and argument */
 
-#if defined(DEBUG) || defined(LLTRACE)
+#if defined(Py_DEBUG) || defined(LLTRACE)
                f->f_lasti = INSTR_OFFSET();
 #endif
                
index 0e6d6ee2169b645e68686a0f0c262e14d5fe988e..ad7dd5c76d91adc57e8e3467ffb81668f37f95ec 100644 (file)
@@ -83,7 +83,7 @@ extern char *getenv();
 #define _P2(v1,t1,v2,t2)       (v1,v2) t1; t2;
 #endif /* __STDC__ */
 
-#ifdef DEBUG
+#ifdef Py_DEBUG
 static int thread_debug = 0;
 #define dprintf(args)  ((thread_debug & 1) && printf args)
 #define d2printf(args) ((thread_debug & 8) && printf args)
@@ -98,7 +98,7 @@ static void _init_thread(); /* Forward */
 
 void init_thread _P0()
 {
-#ifdef DEBUG
+#ifdef Py_DEBUG
        char *p = getenv("THREADDEBUG");
 
        if (p) {
@@ -107,7 +107,7 @@ void init_thread _P0()
                else
                        thread_debug = 1;
        }
-#endif /* DEBUG */
+#endif /* Py_DEBUG */
        if (initialized)
                return;
        initialized = 1;
index 2774e49f5ca77184521c9557d976fda072664cf5..32b94f26d97f8d38f5f7e818f5649104ee5264c6 100644 (file)
@@ -77,7 +77,7 @@ static void exit_sig _P0()
        }
        if (do_exit) {
                d2printf(("exiting in exit_sig\n"));
-#ifdef DEBUG
+#ifdef Py_DEBUG
                if ((thread_debug & 8) == 0)
                        thread_debug &= ~1; /* don't produce debug messages */
 #endif
@@ -140,12 +140,12 @@ static void _init_thread _P0()
        if (usconfig(CONF_ARENATYPE, US_SHAREDONLY) < 0)
                perror("usconfig - CONF_ARENATYPE");
        usconfig(CONF_LOCKTYPE, US_DEBUG); /* XXX */
-#ifdef DEBUG
+#ifdef Py_DEBUG
        if (thread_debug & 4)
                usconfig(CONF_LOCKTYPE, US_DEBUGPLUS);
        else if (thread_debug & 2)
                usconfig(CONF_LOCKTYPE, US_DEBUG);
-#endif /* DEBUG */
+#endif /* Py_DEBUG */
        if ((shared_arena = usinit(tmpnam(0))) == 0)
                perror("usinit");
 #ifdef USE_DL