From e37f1418e5cfb1f55c8eaba74abca6d0b4698a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 16 Jun 2017 15:08:14 +0200 Subject: [PATCH] Clean DEBUG macro Change-Id: I5acf266d565045468c6fba19b1ca493773ae78bc --- Makefile | 4 ---- build/config.mak | 3 ++- ion/include/ion/events.h | 2 +- ion/src/device/boot/rt0.cpp | 2 +- ion/src/shared/events.cpp | 2 +- liba/include/assert.h | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 55aca45ba..b88135524 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,6 @@ SFLAGS += -Wall # Flags - Header dependency tracking SFLAGS += -MD -MP -ifeq ($(DEBUG),1) -SFLAGS += -DDEBUG=1 -endif - # Language-specific flags CFLAGS = -std=c99 CXXFLAGS = -std=c++11 -fno-exceptions -fno-rtti -fno-threadsafe-statics diff --git a/build/config.mak b/build/config.mak index 963f434ee..f0a73d81f 100644 --- a/build/config.mak +++ b/build/config.mak @@ -2,7 +2,7 @@ PLATFORM ?= device VERBOSE ?= 0 -DEBUG ?= 1 +DEBUG ?= 0 # Do not edit below this @@ -18,5 +18,6 @@ include build/toolchain.$(TOOLCHAIN).mak OS_WITH_ONBOARDING_APP ?= 1 OS_WITH_SOFTWARE_UPDATE_PROMPT ?= 1 +SFLAGS += -DDEBUG=$(DEBUG) SFLAGS += -DOS_WITH_ONBOARDING_APP=$(OS_WITH_ONBOARDING_APP) SFLAGS += -DOS_WITH_SOFTWARE_UPDATE_PROMPT=$(OS_WITH_SOFTWARE_UPDATE_PROMPT) diff --git a/ion/include/ion/events.h b/ion/include/ion/events.h index 6f38628c5..b009f2b25 100644 --- a/ion/include/ion/events.h +++ b/ion/include/ion/events.h @@ -15,7 +15,7 @@ public: static constexpr Event Special(int i) { return Event(4*PageSize+i); } constexpr Event(int i) : m_id(i){} // TODO: Assert here that i>=0 && i<255 -#ifdef DEBUG +#if DEBUG uint8_t id() const { return m_id; } const char * name() const; #endif diff --git a/ion/src/device/boot/rt0.cpp b/ion/src/device/boot/rt0.cpp index c1d6212d6..89924814c 100644 --- a/ion/src/device/boot/rt0.cpp +++ b/ion/src/device/boot/rt0.cpp @@ -20,7 +20,7 @@ extern "C" { } void abort() { -#ifdef DEBUG +#if DEBUG while (1) { } #else diff --git a/ion/src/shared/events.cpp b/ion/src/shared/events.cpp index bfbf75771..67857e39d 100644 --- a/ion/src/shared/events.cpp +++ b/ion/src/shared/events.cpp @@ -130,7 +130,7 @@ bool Event::isDefined() const { } } -#ifdef DEBUG +#if DEBUG static constexpr const char * s_nameForEvent[255] = { // Plain diff --git a/liba/include/assert.h b/liba/include/assert.h index 76522148e..e9d717ab9 100644 --- a/liba/include/assert.h +++ b/liba/include/assert.h @@ -3,7 +3,7 @@ #include "private/macros.h" -#ifdef DEBUG +#if DEBUG #define assert(e) ((void) ((e) ? ((void)0) : __assert(#e, __FILE__, __LINE__))) #else #define assert(e) ((void)0)