FunctionTracer: use __PRETTY_FUNCTION__
Change-Id: I49d53f4bb7b65d32c9e1e22be89add6199ccad24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10038
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Diff
headers/private/shared/FunctionTracer.h | 6 ++----
src/kits/interface/MenuField.cpp | 3 +--
src/kits/interface/TextControl.cpp | 3 +--
src/kits/interface/TextView.cpp | 3 +--
4 files changed, 5 insertions(+), 10 deletions(-)
@@ -13,15 +13,13 @@
class FunctionTracer {
public:
FunctionTracer(const char* className, const char* functionName,
int32& depth)
: fFunctionName(),
FunctionTracer(const char* functionName, int32& depth)
: fFunctionName(functionName),
fPrepend(),
fFunctionDepth(depth)
{
fFunctionDepth++;
fPrepend.Append(' ', fFunctionDepth * 2);
fFunctionName << className << "::" << functionName << "()";
printf("%s%s {\n", fPrepend.String(), fFunctionName.String());
}
@@ -47,8 +47,7 @@
#ifdef TRACE_MENU_FIELD
# include <FunctionTracer.h>
static int32 sFunctionDepth = -1;
# define CALLED(x...) FunctionTracer _ft("BMenuField", __FUNCTION__, \
sFunctionDepth)
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
# define TRACE(x...) { BString _to; \
_to.Append(' ', (sFunctionDepth + 1) * 2); \
printf("%s", _to.String()); printf(x); }
@@ -37,8 +37,7 @@
# include <stdio.h>
# include <FunctionTracer.h>
static int32 sFunctionDepth = -1;
# define CALLED(x...) FunctionTracer _ft("BTextControl", __FUNCTION__, \
sFunctionDepth)
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
# define TRACE(x...) { BString _to; \
_to.Append(' ', (sFunctionDepth + 1) * 2); \
printf("%s", _to.String()); printf(x); }
@@ -78,8 +78,7 @@
#ifdef TRACE_TEXT_VIEW
# include <FunctionTracer.h>
static int32 sFunctionDepth = -1;
# define CALLED(x...) FunctionTracer _ft("BTextView", __FUNCTION__, \
sFunctionDepth)
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
# define TRACE(x...) { BString _to; \
_to.Append(' ', (sFunctionDepth + 1) * 2); \
printf("%s", _to.String()); printf(x); }