From c6d151d2ff929f4b18c6c401d86d284788b4564f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 28 Jan 2019 18:52:33 +0000 Subject: GCC-8.2 and libadhocutil-0.6 compat fixes --- project2/cgi/cgiStagePresent.cpp | 6 +++--- project2/common/variableConvert.cpp | 4 ++++ project2/common/variableType.cpp | 2 +- project2/common/variableType.h | 1 + project2/common/variables.cpp | 4 ++-- project2/common/variables/localparam.cpp | 2 +- project2/common/variables/param.cpp | 2 +- project2/common/variables/session.cpp | 2 +- project2/files/fsRows.cpp | 2 +- project2/files/presenterCache.cpp | 2 +- project2/ice/iceboxDaemon.cpp | 2 +- project2/processes/processStream.cpp | 2 +- project2/streams/streamNvpRows.cpp | 2 +- project2/streams/streamRows.cpp | 2 +- project2/xml/xmlScriptParser.cpp | 8 ++++---- 15 files changed, 24 insertions(+), 19 deletions(-) diff --git a/project2/cgi/cgiStagePresent.cpp b/project2/cgi/cgiStagePresent.cpp index 33f0298..0a8c086 100644 --- a/project2/cgi/cgiStagePresent.cpp +++ b/project2/cgi/cgiStagePresent.cpp @@ -52,14 +52,14 @@ CgiApplicationEngine::PresentStage::run(CgiRequestContext * crc) header = std::make_shared("200 OK"); return NextStage(NULL, shared_from_this(), std::dynamic_pointer_cast(presenter.deref()), presenter); } - catch (EmptyRequiredRows) { + catch (const EmptyRequiredRows &) { header = std::make_shared("404 Not found"); return NextStage(NULL, shared_from_this(), std::dynamic_pointer_cast(presenter.deref()), presenter); } - catch (ResponseStagePtr & p) { + catch (const ResponseStagePtr & p) { return NextStage(NULL, p, std::dynamic_pointer_cast(p), std::dynamic_pointer_cast(p)); } - catch (StagePtr & p) { + catch (const StagePtr & p) { return NextStage(p, NULL, std::dynamic_pointer_cast(p), std::dynamic_pointer_cast(p)); } } diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp index 0681ed0..b3d3432 100644 --- a/project2/common/variableConvert.cpp +++ b/project2/common/variableConvert.cpp @@ -179,6 +179,10 @@ VariableType::operator const std::string &() const { return boost::apply_visitor(ConvertVisitorStdString(this), *this); } +VariableType::operator std::string_view() const +{ + return boost::apply_visitor(ConvertVisitorStdString(this), *this); +} VariableType::operator int() const { return boost::apply_visitor(ConvertVisitor(this), *this); diff --git a/project2/common/variableType.cpp b/project2/common/variableType.cpp index 84170b7..c9213c0 100644 --- a/project2/common/variableType.cpp +++ b/project2/common/variableType.cpp @@ -146,7 +146,7 @@ VTCONSN(long long int, int64_t); VTCONSN(long long unsigned int, int64_t); VTCONSD(std::string, Glib::ustring); VTCONSD(char * const, Glib::ustring); -VTCONSC(unsigned char * const, Glib::ustring, const char * const); +VTCONSC(unsigned char * const, Glib::ustring, const char *); VariableType::VariableType(const struct tm & vt) : _VT(boost::posix_time::ptime_from_tm(vt)) diff --git a/project2/common/variableType.h b/project2/common/variableType.h index 0e3cc0a..292b349 100644 --- a/project2/common/variableType.h +++ b/project2/common/variableType.h @@ -93,6 +93,7 @@ class DLL_PUBLIC VariableType : public _VT { operator const Glib::ustring &() const; operator const std::string &() const; + operator std::string_view() const; operator long long int() const; operator long int() const; operator int() const; diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp index 2b789c0..6cc5a71 100644 --- a/project2/common/variables.cpp +++ b/project2/common/variables.cpp @@ -54,13 +54,13 @@ class VariableParent : public VariableImplDyn { return row->getCurrentValue(ec, name); } } - catch (RowSet::ParentOutOfRange) { + catch (const RowSet::ParentOutOfRange &) { if (!defaultValue) { throw; } return (*defaultValue)(ec); } - catch (RowSet::FieldDoesNotExist) { + catch (const RowSet::FieldDoesNotExist &) { if (!defaultValue) { throw; } diff --git a/project2/common/variables/localparam.cpp b/project2/common/variables/localparam.cpp index 63d6f55..b7506d4 100644 --- a/project2/common/variables/localparam.cpp +++ b/project2/common/variables/localparam.cpp @@ -18,7 +18,7 @@ class VariableLocalParam : public VariableImplDyn { try { return ec->getScopedParameter(name); } - catch (ParamNotFound) { + catch (class ParamNotFound &) { if (!defaultValue) { throw; } diff --git a/project2/common/variables/param.cpp b/project2/common/variables/param.cpp index 8e4125a..8be4dea 100644 --- a/project2/common/variables/param.cpp +++ b/project2/common/variables/param.cpp @@ -17,7 +17,7 @@ class VariableParam : public VariableImplDyn { try { return ec->getParameter(name); } - catch (ParamNotFound) { + catch (const ParamNotFound &) { if (!defaultValue) { throw; } diff --git a/project2/common/variables/session.cpp b/project2/common/variables/session.cpp index d3331c0..dbc1ec7 100644 --- a/project2/common/variables/session.cpp +++ b/project2/common/variables/session.cpp @@ -17,7 +17,7 @@ class VariableSession : public VariableImplDyn { try { return ec->getSession()->GetValue(name); } - catch (Session::VariableNotFound) { + catch (const Session::VariableNotFound &) { if (!defaultValue) { throw; } diff --git a/project2/files/fsRows.cpp b/project2/files/fsRows.cpp index 47c4d4a..6d09178 100644 --- a/project2/files/fsRows.cpp +++ b/project2/files/fsRows.cpp @@ -82,7 +82,7 @@ FsRows::execute(const Glib::ustring &, const RowProcessorCallback & rp, ExecCont for (SpecSpec::const_iterator sf = s.begin(); sf != s.end(); ) { const Glib::ustring & name = (*sf++); if (name[0] == '-') { - ss.specs.insert(SpecBaseStringFactory::createNew(name.substr(1), *sf++)); + ss.specs.insert(SpecBaseStringFactory::createNew(name.raw().substr(1), *sf++)); } else { throw NotSupported(name); diff --git a/project2/files/presenterCache.cpp b/project2/files/presenterCache.cpp index 8f5dd64..d0b6df2 100644 --- a/project2/files/presenterCache.cpp +++ b/project2/files/presenterCache.cpp @@ -4,7 +4,7 @@ #include "options.h" #include #include -#include +#include #include #include #include diff --git a/project2/ice/iceboxDaemon.cpp b/project2/ice/iceboxDaemon.cpp index bc0431c..502857e 100644 --- a/project2/ice/iceboxDaemon.cpp +++ b/project2/ice/iceboxDaemon.cpp @@ -29,7 +29,7 @@ class IceBoxDaemon : public IceBox::Service, public AppInstance { int argc = 0; char ** argv = nullptr; ic->getLogger()->print("Creating daemon: " + daemonType); - daemon = DaemonFactory::createNew(daemonType, argc, argv); + daemon = DaemonFactory::createNew(daemonType.raw(), argc, argv); daemon->setup(); daemonThread = new std::thread(&Daemon::run, daemon); } diff --git a/project2/processes/processStream.cpp b/project2/processes/processStream.cpp index 079def9..79945d2 100644 --- a/project2/processes/processStream.cpp +++ b/project2/processes/processStream.cpp @@ -41,7 +41,7 @@ class ProcessStream : public Stream, IHaveParameters { // ignore any error if the application is still running, // but if there is already an exception being thrown, we don't // want to throw another. - if (status != 0 && !std::uncaught_exception()) { + if (status != 0 && !std::uncaught_exceptions()) { throw SubProcessFailed(strerror(status)); } } diff --git a/project2/streams/streamNvpRows.cpp b/project2/streams/streamNvpRows.cpp index ddfb245..a4c4b7b 100644 --- a/project2/streams/streamNvpRows.cpp +++ b/project2/streams/streamNvpRows.cpp @@ -50,7 +50,7 @@ class StreamNvpRows : public RowSet { ~ParseState() { - if (!std::uncaught_exception()) { + if (!std::uncaught_exceptions()) { newRecord(tok.length()); } } diff --git a/project2/streams/streamRows.cpp b/project2/streams/streamRows.cpp index be68340..1bea9ad 100644 --- a/project2/streams/streamRows.cpp +++ b/project2/streams/streamRows.cpp @@ -27,7 +27,7 @@ class StreamRows : public DefinedColumns, public RowSet { ~ParseState() { - if (!std::uncaught_exception()) { + if (!std::uncaught_exceptions()) { sr->end(*this); } } diff --git a/project2/xml/xmlScriptParser.cpp b/project2/xml/xmlScriptParser.cpp index b47682f..c20445b 100644 --- a/project2/xml/xmlScriptParser.cpp +++ b/project2/xml/xmlScriptParser.cpp @@ -187,7 +187,7 @@ XmlScriptNode::variable(const Glib::ustring & n) const if (cs.size() == 1) { if (const xmlpp::Element * c = dynamic_cast(cs.front())) { if (const xmlpp::Attribute * source = c->get_attribute("source")) { - return VariableFactory::createNew(source->get_value(), std::make_shared(c, script.lock())); + return VariableFactory::createNew(source->get_value().raw(), std::make_shared(c, script.lock())); } else { return std::make_shared(std::make_shared(c, script.lock())); @@ -201,10 +201,10 @@ std::shared_ptr XmlScriptNode::variable(const boost::optional & defaultSource) const { if (const xmlpp::Attribute * source = element->get_attribute("source")) { - return VariableFactory::createNew(source->get_value(), std::make_shared(element, script.lock())); + return VariableFactory::createNew(source->get_value().raw(), std::make_shared(element, script.lock())); } else if (defaultSource) { - return VariableFactory::createNew(defaultSource.get(), std::make_shared(element, script.lock())); + return VariableFactory::createNew(defaultSource.get().raw(), std::make_shared(element, script.lock())); } else { return std::make_shared(std::make_shared(element, script.lock())); @@ -223,7 +223,7 @@ XmlScriptNode::applyValue(const Glib::ustring & n, VariableType & val, ExecConte if (const xmlpp::Element * c = dynamic_cast(cs.front())) { std::shared_ptr v; if (const xmlpp::Attribute * source = c->get_attribute("source")) { - v = VariableFactory::createNew(source->get_value(), std::make_shared(c, script.lock())); + v = VariableFactory::createNew(source->get_value().raw(), std::make_shared(c, script.lock())); } else { v = std::make_shared(std::make_shared(c, script.lock())); -- cgit v1.2.3