From f8c596668f94e80f6513366efed743f24e2d114d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 5 Aug 2016 22:00:48 -0400 Subject: [PATCH] lunix/gcc updates. --- command.cpp | 1 + environment.cpp | 2 +- environment.h | 20 ++++++++++---------- error.h | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/command.cpp b/command.cpp index f1777cb..a16cb3e 100644 --- a/command.cpp +++ b/command.cpp @@ -20,6 +20,7 @@ #include #include #include +#include extern std::atomic control_c; diff --git a/environment.cpp b/environment.cpp index 839553e..43e39ba 100644 --- a/environment.cpp +++ b/environment.cpp @@ -177,7 +177,7 @@ namespace { void Environment::echo(const char *fmt, ...) const { if (_echo && !_startup) { - for (unsigned i = 0; i < _indent; ++i) { + for (unsigned i = 0; i <= _indent; ++i) { fputc(' ', stderr); fputc(' ', stderr); } diff --git a/environment.h b/environment.h index 4829d14..556de7c 100644 --- a/environment.h +++ b/environment.h @@ -68,21 +68,21 @@ public: std::string get(const std::string &k) const; - constexpr bool echo() const noexcept { return _echo; } - constexpr bool test() const noexcept { return _test; } - constexpr bool exit() const noexcept { return _exit; } - constexpr int status() const noexcept { return _status; } - constexpr int pound() const noexcept { return _pound; } + bool echo() const noexcept { return _echo; } + bool test() const noexcept { return _test; } + bool exit() const noexcept { return _exit; } + int status() const noexcept { return _status; } + int pound() const noexcept { return _pound; } int status(int i, bool throw_up = true); int status(int i, const std::nothrow_t &); - constexpr bool startup() const noexcept { return _startup; } - constexpr void startup(bool tf) noexcept { _startup = tf; } + bool startup() const noexcept { return _startup; } + void startup(bool tf) noexcept { _startup = tf; } - constexpr bool passthrough() const noexcept { return _passthrough; } - constexpr void passthrough(bool tf) noexcept { _passthrough = tf; } + bool passthrough() const noexcept { return _passthrough; } + void passthrough(bool tf) noexcept { _passthrough = tf; } template void foreach(FX && fx) { for (const auto &kv : _table) { fx(kv.first, kv.second); }} @@ -117,7 +117,7 @@ public: catch (...) { _indent = i; _loop = j; throw; } } - constexpr bool loop() const noexcept { return _loop; } + bool loop() const noexcept { return _loop; } const alias_table_type &aliases() const { return _alias_table; } diff --git a/error.h b/error.h index 325bc13..bb0f173 100644 --- a/error.h +++ b/error.h @@ -12,7 +12,7 @@ public: mpw_error(int status, const char *s) : std::runtime_error(s), _status(status) {} - constexpr int status() const noexcept { return _status; } + int status() const noexcept { return _status; } private: int _status; };