changeset 23100:a40e586b66ba

eliminate global variable reading_startup_message_printed * parse.h, oct-parse.in.yy (reading_startup_message_printed): Delete global variable and all uses. * interpreter.cc (interpreter::execute_internal): Use verbose option flag instead of reading_startup_message_printed to decide whether to display newline after reading startup files.
author John W. Eaton <jwe@octave.org>
date Fri, 27 Jan 2017 09:17:57 -0500
parents d44537a50f4b
children 86376c04cb66
files libinterp/corefcn/interpreter.cc libinterp/parse-tree/oct-parse.in.yy libinterp/parse-tree/parse.h
diffstat 3 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Fri Jan 27 16:39:15 2017 +0100
+++ b/libinterp/corefcn/interpreter.cc	Fri Jan 27 09:17:57 2017 -0500
@@ -685,7 +685,7 @@
       exit_status = status;
 
     if (m_interactive && ! options.inhibit_startup_message ()
-        && reading_startup_message_printed)
+        && options.verbose_flag ())
       std::cout << std::endl;
 
     // Execute any code specified with --eval 'CODE'
--- a/libinterp/parse-tree/oct-parse.in.yy	Fri Jan 27 16:39:15 2017 +0100
+++ b/libinterp/parse-tree/oct-parse.in.yy	Fri Jan 27 09:17:57 2017 -0500
@@ -90,9 +90,6 @@
 // FIXME: to be removed after more parser+lexer refactoring.
 octave::base_lexer *LEXER = 0;
 
-// TRUE means we printed messages about reading startup files.
-bool reading_startup_message_printed = false;
-
 // List of autoloads (function -> file mapping).
 static std::map<std::string, std::string> autoload_map;
 
@@ -4764,7 +4761,6 @@
     if (verbose)
       {
         std::cout << "executing commands from " << full_name << " ... ";
-        reading_startup_message_printed = true;
         std::cout.flush ();
       }
 
--- a/libinterp/parse-tree/parse.h	Fri Jan 27 16:39:15 2017 +0100
+++ b/libinterp/parse-tree/parse.h	Fri Jan 27 09:17:57 2017 -0500
@@ -90,9 +90,6 @@
 // Nonzero means print parser debugging info (-d).
 extern int octave_debug;
 
-// TRUE means we printed messages about reading startup files.
-extern bool reading_startup_message_printed;
-
 namespace octave
 {
   // Global access to currently active lexer.