From e119ac919b037d64753d457d687d175cb2ca6d2d Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Fri, 24 Jan 2020 00:21:53 +0200 Subject: [PATCH] mu: fix clang compilation --- lib/utils/mu-command-parser.hh | 5 ++--- lib/utils/mu-sexp-parser.cc | 4 ++-- lib/utils/mu-sexp-parser.hh | 8 ++++---- lib/utils/mu-utils.hh | 2 +- mu/mu-cmd-server.cc | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/utils/mu-command-parser.hh b/lib/utils/mu-command-parser.hh index 228832d4..7dc1a6dc 100644 --- a/lib/utils/mu-command-parser.hh +++ b/lib/utils/mu-command-parser.hh @@ -98,9 +98,6 @@ using CommandMap = std::unordered_map; void invoke(const Command::CommandMap& cmap, const Sexp::Node& call); -} // namespace Command - - static inline std::ostream& operator<<(std::ostream& os, const Command::ArgInfo& info) { @@ -129,6 +126,8 @@ operator<<(std::ostream& os, const Command::CommandMap& map) return os; } + +} // namespace Command } // namespace Mu diff --git a/lib/utils/mu-sexp-parser.cc b/lib/utils/mu-sexp-parser.cc index 662feffa..179659e4 100644 --- a/lib/utils/mu-sexp-parser.cc +++ b/lib/utils/mu-sexp-parser.cc @@ -33,7 +33,7 @@ parsing_error(size_t pos, const char* frm, ...) va_end(args); if (pos == 0) - return Mu::Error(Error::Code::Parsing, "%s", msg); + return Mu::Error(Error::Code::Parsing, "%s", msg.c_str()); else return Mu::Error(Error::Code::Parsing, "%zu: %s", msg.c_str()); } @@ -149,7 +149,7 @@ parse (const std::string& expr, size_t& pos) else if (isalpha(kar) || kar == ':') return parse_symbol(expr, pos); else - throw parsing_error(pos, "unexpected character '%c" + kar); + throw parsing_error(pos, "unexpected character '%c", kar); }(); pos = skip_whitespace(expr, pos); diff --git a/lib/utils/mu-sexp-parser.hh b/lib/utils/mu-sexp-parser.hh index 104be595..ecb97f2d 100644 --- a/lib/utils/mu-sexp-parser.hh +++ b/lib/utils/mu-sexp-parser.hh @@ -22,8 +22,6 @@ #include #include -#include - #include "utils/mu-error.hh" @@ -79,8 +77,6 @@ struct Node { */ Node parse(const std::string& expr); -} // Sexp - static inline std::ostream& operator<<(std::ostream& os, Sexp::Type id) { @@ -110,6 +106,10 @@ operator<<(std::ostream& os, const Sexp::Node& node) return os; } + +} // Sexp + + } // Mu #endif /* MU_SEXP_PARSER_HH__ */ diff --git a/lib/utils/mu-utils.hh b/lib/utils/mu-utils.hh index e9880657..d20d3ad6 100644 --- a/lib/utils/mu-utils.hh +++ b/lib/utils/mu-utils.hh @@ -25,6 +25,7 @@ #include #include #include +#include namespace Mu { @@ -165,7 +166,6 @@ static inline std::string to_string (const T& val) } - /** * * don't repeat these catch blocks everywhere... diff --git a/mu/mu-cmd-server.cc b/mu/mu-cmd-server.cc index 961f2464..30e1e830 100644 --- a/mu/mu-cmd-server.cc +++ b/mu/mu-cmd-server.cc @@ -1030,8 +1030,8 @@ remove_handler (Context& context, const Parameters& params) if (!mu_store_remove_path (context.store, path.c_str())) throw Error(Error::Code::Store, - "failed to remove message @ %s (%d) from store", - path, docid); + "failed to remove message @ %s (%d) from store", + path.c_str(), docid); print_expr ("(:remove %u)", docid); }