fix compilation error / clang warnings

This commit is contained in:
Dirk-Jan C. Binnema
2020-07-25 11:26:08 +03:00
parent 6cea9fcd71
commit 148c906d8a
8 changed files with 11 additions and 12 deletions

View File

@ -25,7 +25,7 @@
namespace Mu {
struct Store;
class Store;
/// An object abstracting the index process.
class Indexer {

View File

@ -200,7 +200,7 @@ get_query (MuQuery *mqx, const char* searchexpr, bool raw, GError **err) try {
Mu::WarningVec warns;
const auto tree = Mu::parse (searchexpr, warns,
std::make_unique<MuProc>(mqx->db()));
for (const auto w: warns)
for (auto&& w: warns)
std::cerr << w << std::endl;
return Mu::xapian_query (tree);
@ -514,7 +514,7 @@ mu_query_internal (MuQuery *self, const char *searchexpr,
ss << tree;
if (warn) {
for (const auto w: warns)
for (auto&& w: warns)
std::cerr << w << std::endl;
}

View File

@ -79,7 +79,7 @@ xapian_query_value (const Mu::Tree& tree)
return make_query(v, parts.front(), true/*maybe-wildcard*/);
std::vector<Xapian::Query> phvec;
for (const auto p: parts)
for (const auto& p: parts)
phvec.emplace_back(make_query(v, p, false/*no wildcards*/));
return Xapian::Query (Xapian::Query::OP_PHRASE, phvec.begin(), phvec.end());

View File

@ -133,7 +133,7 @@ static void
test_to_string ()
{
std::stringstream ss;
for (const auto t: tokenize ("foo and bar xor not cuux or fnorb"))
for (auto&& t: tokenize ("foo and bar xor not cuux or fnorb"))
ss << t << ' ';
g_assert_true (ss.str() ==

View File

@ -32,7 +32,6 @@
using namespace Mu;
constexpr auto MuLogDomain = "mu";
static bool MuLogInitialized = false;
static Mu::LogOptions MuLogOptions;
static std::ofstream MuStream;

View File

@ -176,8 +176,8 @@ struct Sexp {
size_t empty() const { return seq_.empty(); }
private:
friend class Sexp;
Seq seq_;
friend struct Sexp;
Seq seq_;
};
/**