From 87e749304f3bab1c1778713fd12b5e9a056f5981 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sat, 16 Feb 2019 11:44:16 -0800 Subject: [PATCH] main --- app/StaMain.cc | 25 ++----------------------- app/StaMain.hh | 5 ++--- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/app/StaMain.cc b/app/StaMain.cc index 8b38b4f3..6cb54604 100644 --- a/app/StaMain.cc +++ b/app/StaMain.cc @@ -30,8 +30,6 @@ typedef sta::Vector SwigInitFuncSeq; static int sta_argc; static char **sta_argv; static SwigInitFunc sta_swig_init; -static bool sta_native_cmds; -static bool sta_compatibility_cmds; static const char *init_filename = "[file join $env(HOME) .sta]"; extern const char *tcl_inits[]; @@ -57,10 +55,7 @@ staMain(Sta *sta, if (threads_exists) sta->setThreadCount(thread_count); - bool native_cmds, compatibility_cmds; - parseCmdsArg(argc, argv, native_cmds, compatibility_cmds); - - staSetupAppInit(argc, argv, swig_init, native_cmds, compatibility_cmds); + staSetupAppInit(argc, argv, swig_init); // Set argc to 1 so Tcl_Main doesn't source any files. // Tcl_Main never returns. Tcl_Main(1, argv, staTclAppInit); @@ -87,31 +82,15 @@ parseThreadsArg(int argc, } } -void -parseCmdsArg(int argc, - char **argv, - bool &native_cmds, - bool &compatibility_cmds) -{ - native_cmds = findCmdLineFlag(argc, argv, "-native"); - compatibility_cmds = findCmdLineFlag(argc, argv, "-compatibility"); - if (!native_cmds && !compatibility_cmds) - compatibility_cmds = true; // default -} - // Set globals to pass to staTclAppInit. void staSetupAppInit(int argc, char **argv, - SwigInitFunc swig_init, - bool native_cmds, - bool compatibility_cmds) + SwigInitFunc swig_init) { sta_argc = argc; sta_argv = argv; sta_swig_init = swig_init; - sta_native_cmds = native_cmds; - sta_compatibility_cmds = compatibility_cmds; } // Tcl init executed inside Tcl_Main. diff --git a/app/StaMain.hh b/app/StaMain.hh index 8eb62855..d553e2b4 100644 --- a/app/StaMain.hh +++ b/app/StaMain.hh @@ -35,9 +35,8 @@ staMain(Sta *sta, void staSetupAppInit(int argc, char **argv, - SwigInitFunc swig_init, - bool native_cmds, - bool compatibility_cmds); + SwigInitFunc swig_init); + // The variable tcl_init is an implicit argument to this function that // provides the definitions for builtin tcl commands encoded by // etc/TclEncode.tcl.