From b1ff3e6c4642602cd5f61b0218142dbab9812485 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sun, 30 Nov 2025 14:20:49 +0100 Subject: [PATCH] FunctionTracer: use __PRETTY_FUNCTION__ Change-Id: I49d53f4bb7b65d32c9e1e22be89add6199ccad24 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10038 Reviewed-by: Adrien Destugues Reviewed-by: Niels Sascha Reedijk Tested-by: Commit checker robot --- 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(-) diff --git a/headers/private/shared/FunctionTracer.h b/headers/private/shared/FunctionTracer.h index 3431ad7..e8d2693 100644 --- a/headers/private/shared/FunctionTracer.h +++ b/headers/private/shared/FunctionTracer.h @@ -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()); } diff --git a/src/kits/interface/MenuField.cpp b/src/kits/interface/MenuField.cpp index c6f885c..5197db3 100644 --- a/src/kits/interface/MenuField.cpp +++ b/src/kits/interface/MenuField.cpp @@ -47,8 +47,7 @@ #ifdef TRACE_MENU_FIELD # include 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); } diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index cbb423c..4696779 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -37,8 +37,7 @@ # include # include 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); } diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 84fa5aa..2296942 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -78,8 +78,7 @@ #ifdef TRACE_TEXT_VIEW # include 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); } -- gitore 0.2.3