⛏️ index : haiku.git

author PulkoMandy <pulkomandy@pulkomandy.tk> 2025-11-30 14:20:49.0 +01:00:00
committer Adrien Destugues <pulkomandy@pulkomandy.tk> 2025-12-01 9:48:36.0 +00:00:00
commit
b1ff3e6c4642602cd5f61b0218142dbab9812485 [patch]
tree
93955dc573c3f13707462927354f1ed872a6f70a
parent
7ad0bd3735dd066a808ebd136df1cf4df83f6b67
download
b1ff3e6c4642602cd5f61b0218142dbab9812485.tar.gz

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(-)

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 <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); }
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 <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); }
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 <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); }