From 03332c1146491716931441f7e94f6974bc1fdf9e Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 7 May 2022 19:40:16 +0200 Subject: [PATCH] define type Tcl_FreeProc --- libsrc/meshing/visual_interface.cpp | 2 +- libsrc/meshing/visual_interface.hpp | 6 ++++-- ng/ngtcl.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libsrc/meshing/visual_interface.cpp b/libsrc/meshing/visual_interface.cpp index cdb2a0ca..6a2ca929 100644 --- a/libsrc/meshing/visual_interface.cpp +++ b/libsrc/meshing/visual_interface.cpp @@ -13,7 +13,7 @@ void Ng_Redraw (bool blocking) { if(Ptr_Ng_Redraw) Ptr_Ng_Redraw(blocking); } namespace netgen { - void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, const int freeProc) = nullptr; + void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) = nullptr; void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc) = nullptr; void (*Ptr_Render)(bool) = nullptr; diff --git a/libsrc/meshing/visual_interface.hpp b/libsrc/meshing/visual_interface.hpp index 286cf82a..943737a0 100644 --- a/libsrc/meshing/visual_interface.hpp +++ b/libsrc/meshing/visual_interface.hpp @@ -18,6 +18,8 @@ DLL_HEADER extern void (*Ptr_Ng_Redraw) (bool blocking); class Tcl_Interp; typedef int (Tcl_CmdProc) (void * clientData, Tcl_Interp *interp, int argc, const char *argv[]); +typedef void (Tcl_FreeProc) (char *blockPtr); + namespace netgen { inline constexpr int NG_TCL_VOLATILE = 1; @@ -29,7 +31,7 @@ namespace netgen { inline constexpr int NG_TCL_RETURN = 2; inline constexpr int NG_TCL_BREAK = 3; inline constexpr int NG_TCL_CONTINUE = 4; - DLL_HEADER extern void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, const int freeProc); + DLL_HEADER extern void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); DLL_HEADER extern void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc); @@ -49,7 +51,7 @@ namespace netgen { if(Ptr_UpdateVisSurfaceMeshData) Ptr_UpdateVisSurfaceMeshData(oldnl, locpointsptr, loclinesptr, plainpointsptr); } - inline void Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc) + inline void Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) { if(Ptr_Ng_Tcl_SetResult) Ptr_Ng_Tcl_SetResult(interp, result, freeProc); diff --git a/ng/ngtcl.cpp b/ng/ngtcl.cpp index 5706d5e6..c97fa363 100644 --- a/ng/ngtcl.cpp +++ b/ng/ngtcl.cpp @@ -2,9 +2,9 @@ #include "../libsrc/meshing/visual_interface.hpp" -static void Impl_Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc) +static void Impl_Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) { - Tcl_SetResult(interp, result, (Tcl_FreeProc*)freeProc); + Tcl_SetResult(interp, result, freeProc); } static void Impl_Ng_Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc)