diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-11-14 06:12:24 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-11-14 06:12:24 -0500 |
commit | 11c38d0708cd2969ed08ee538ca83ec006e21796 (patch) | |
tree | 05f4a4d756a1d1b563d989c6d6b01acdc19d9c97 | |
parent | 30185afd9a917a862de8928075c6fb34ad4fbba7 (diff) | |
download | python-coveragepy-git-11c38d0708cd2969ed08ee538ca83ec006e21796.tar.gz |
TRUE and FALSE for booleans
-rw-r--r-- | coverage/ctracer/tracer.c | 8 | ||||
-rw-r--r-- | coverage/ctracer/util.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index dba8a11c..6fa099d0 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -139,7 +139,7 @@ indent(int n) return spaces + strlen(spaces) - n*2; } -static int logging = 0; +static int logging = FALSE; /* Set these constants to be a file substring and line number to start logging. */ static const char * start_file = "tests/views"; static int start_line = 27; @@ -778,7 +778,7 @@ CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unuse #if TRACE_LOG ascii = MyText_AS_BYTES(frame->f_code->co_filename); if (strstr(MyBytes_AS_STRING(ascii), start_file) && frame->f_lineno == start_line) { - logging = 1; + logging = TRUE; } Py_DECREF(ascii); #endif @@ -941,7 +941,7 @@ static PyObject * CTracer_start(CTracer *self, PyObject *args_unused) { PyEval_SetTrace((Py_tracefunc)CTracer_trace, (PyObject*)self); - self->started = 1; + self->started = TRUE; self->tracing_arcs = self->trace_arcs && PyObject_IsTrue(self->trace_arcs); self->cur_entry.last_line = -1; @@ -955,7 +955,7 @@ CTracer_stop(CTracer *self, PyObject *args_unused) { if (self->started) { PyEval_SetTrace(NULL, NULL); - self->started = 0; + self->started = FALSE; } Py_RETURN_NONE; diff --git a/coverage/ctracer/util.h b/coverage/ctracer/util.h index bb3ad5a3..ad8f49d6 100644 --- a/coverage/ctracer/util.h +++ b/coverage/ctracer/util.h @@ -49,4 +49,8 @@ #define RET_OK 0 #define RET_ERROR -1 +/* Nicer booleans */ +#define FALSE 0 +#define TRUE 1 + #endif /* _COVERAGE_UTIL_H */ |