From fc50dd4cbd24c4c2bef99e90320bfab4e8777a97 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 24 Oct 2005 15:38:14 +0000 Subject: [PATCH] Don't reinitialize the symbol tree in OpenFile. (We don't reinitialize the option database, so why should we reinitialize the variables? Using a single global symbol tree we can again define variables with -string "" on the command line.) --- Box/Main.cpp | 8 +++++--- Common/CommandLine.cpp | 6 +----- Fltk/Main.cpp | 6 +++++- Parser/OpenFile.cpp | 3 +-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Box/Main.cpp b/Box/Main.cpp index a1f0c4bf40..3db67abcdb 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.50 2005-06-20 16:40:25 geuzaine Exp $ +// $Id: Main.cpp,v 1.51 2005-10-24 15:38:13 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -86,13 +86,15 @@ int main(int argc, char *argv[]) { ParUtil::Instance()->init(argc, argv); + InitSymbols(); + + Init_Mesh0(&M); + Init_Options(0); if(argc < 2) Info(0, argv[0]); - Init_Mesh0(&M); - // FIXME: could not make this work on IRIX #if !defined(__sgi__) signal(SIGINT, Signal); diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index fbc0d16fec..cf23789aa7 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -1,4 +1,4 @@ -// $Id: CommandLine.cpp,v 1.65 2005-09-22 22:39:22 geuzaine Exp $ +// $Id: CommandLine.cpp,v 1.66 2005-10-24 15:38:13 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -155,10 +155,6 @@ char *Get_BuildOptions(void) void Get_Options(int argc, char *argv[]) { - // This symbol context is local to option parsing (the symbols will - // not interfere with subsequent OpenFiles) - InitSymbols(); - // Parse session and option files ParseFile(CTX.session_filename_fullpath, 1, 1); ParseFile(CTX.options_filename_fullpath, 1, 1); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index f08e606359..e2720f41b1 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.83 2005-08-24 20:28:43 remacle Exp $ +// $Id: Main.cpp,v 1.84 2005-10-24 15:38:13 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -71,6 +71,10 @@ int main(int argc, char *argv[]) strcat(cmdline, " "); } + // Initialize the symbol tree that will hold variable names + + InitSymbols(); + // Initialize the static Mesh Init_Mesh0(&M); diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 8415c828d5..172bee9455 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.84 2005-10-15 19:06:09 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.85 2005-10-24 15:38:14 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -342,7 +342,6 @@ void OpenProblem(char *name) } CTX.threads_lock = 1; - InitSymbols(); Init_Mesh(&M); // Initialize pseudo random mesh generator to the same seed -- GitLab