From 654d0b07ca5e006b8d3d7c1a716d8b2a588a7fc0 Mon Sep 17 00:00:00 2001 From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Wed, 6 May 2026 11:59:01 +0100 Subject: [PATCH] DRAW - Add size_t printing support. (#1270) New overloads of Append() and operator<<() are added to Draw_Interpretor. New overloads accept size_t type of argument. --- src/Draw/TKDraw/Draw/Draw_Interpretor.cxx | 10 ++++++++++ src/Draw/TKDraw/Draw/Draw_Interpretor.hxx | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx b/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx index b27afe7ff4..627f2fc8ac 100644 --- a/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Interpretor.cxx @@ -424,6 +424,16 @@ Draw_Interpretor& Draw_Interpretor::Append(const int i) //================================================================================================= +Draw_Interpretor& Draw_Interpretor::Append(const size_t theResult) +{ + char c[100]; + Sprintf(c, "%zu", theResult); + Tcl_AppendResult(myInterp, c, (const char*)nullptr); + return *this; +} + +//================================================================================================= + Draw_Interpretor& Draw_Interpretor::Append(const double r) { char s[100]; diff --git a/src/Draw/TKDraw/Draw/Draw_Interpretor.hxx b/src/Draw/TKDraw/Draw/Draw_Interpretor.hxx index b396f4fbb0..5e1d0fff45 100644 --- a/src/Draw/TKDraw/Draw/Draw_Interpretor.hxx +++ b/src/Draw/TKDraw/Draw/Draw_Interpretor.hxx @@ -185,6 +185,11 @@ public: inline Draw_Interpretor& operator<<(const int theResult) { return Append(theResult); } + //! Appends to the result + Standard_EXPORT Draw_Interpretor& Append(const size_t theResult); + + inline Draw_Interpretor& operator<<(const size_t theResult) { return Append(theResult); } + //! Appends to the result Standard_EXPORT Draw_Interpretor& Append(const double theResult);