fix compilation error / clang warnings
This commit is contained in:
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
namespace Mu {
|
namespace Mu {
|
||||||
|
|
||||||
struct Store;
|
class Store;
|
||||||
|
|
||||||
/// An object abstracting the index process.
|
/// An object abstracting the index process.
|
||||||
class Indexer {
|
class Indexer {
|
||||||
|
|||||||
@ -200,7 +200,7 @@ get_query (MuQuery *mqx, const char* searchexpr, bool raw, GError **err) try {
|
|||||||
Mu::WarningVec warns;
|
Mu::WarningVec warns;
|
||||||
const auto tree = Mu::parse (searchexpr, warns,
|
const auto tree = Mu::parse (searchexpr, warns,
|
||||||
std::make_unique<MuProc>(mqx->db()));
|
std::make_unique<MuProc>(mqx->db()));
|
||||||
for (const auto w: warns)
|
for (auto&& w: warns)
|
||||||
std::cerr << w << std::endl;
|
std::cerr << w << std::endl;
|
||||||
|
|
||||||
return Mu::xapian_query (tree);
|
return Mu::xapian_query (tree);
|
||||||
@ -514,7 +514,7 @@ mu_query_internal (MuQuery *self, const char *searchexpr,
|
|||||||
ss << tree;
|
ss << tree;
|
||||||
|
|
||||||
if (warn) {
|
if (warn) {
|
||||||
for (const auto w: warns)
|
for (auto&& w: warns)
|
||||||
std::cerr << w << std::endl;
|
std::cerr << w << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ xapian_query_value (const Mu::Tree& tree)
|
|||||||
return make_query(v, parts.front(), true/*maybe-wildcard*/);
|
return make_query(v, parts.front(), true/*maybe-wildcard*/);
|
||||||
|
|
||||||
std::vector<Xapian::Query> phvec;
|
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*/));
|
phvec.emplace_back(make_query(v, p, false/*no wildcards*/));
|
||||||
|
|
||||||
return Xapian::Query (Xapian::Query::OP_PHRASE, phvec.begin(), phvec.end());
|
return Xapian::Query (Xapian::Query::OP_PHRASE, phvec.begin(), phvec.end());
|
||||||
|
|||||||
@ -133,7 +133,7 @@ static void
|
|||||||
test_to_string ()
|
test_to_string ()
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
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 << ' ';
|
ss << t << ' ';
|
||||||
|
|
||||||
g_assert_true (ss.str() ==
|
g_assert_true (ss.str() ==
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
using namespace Mu;
|
using namespace Mu;
|
||||||
|
|
||||||
constexpr auto MuLogDomain = "mu";
|
|
||||||
static bool MuLogInitialized = false;
|
static bool MuLogInitialized = false;
|
||||||
static Mu::LogOptions MuLogOptions;
|
static Mu::LogOptions MuLogOptions;
|
||||||
static std::ofstream MuStream;
|
static std::ofstream MuStream;
|
||||||
|
|||||||
@ -176,7 +176,7 @@ struct Sexp {
|
|||||||
size_t empty() const { return seq_.empty(); }
|
size_t empty() const { return seq_.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Sexp;
|
friend struct Sexp;
|
||||||
Seq seq_;
|
Seq seq_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -541,7 +541,7 @@ static gboolean
|
|||||||
output_sexp (MuMsg *msg, MuMsgIter *iter, const MuConfig *opts, GError **err)
|
output_sexp (MuMsg *msg, MuMsgIter *iter, const MuConfig *opts, GError **err)
|
||||||
{
|
{
|
||||||
const auto *ti{opts->threads ? mu_msg_iter_get_thread_info (iter) : NULL};
|
const auto *ti{opts->threads ? mu_msg_iter_get_thread_info (iter) : NULL};
|
||||||
const auto sexp{Mu:Mu::msg_to_sexp(msg , mu_msg_iter_get_docid (iter), ti,
|
const auto sexp{Mu::msg_to_sexp(msg , mu_msg_iter_get_docid (iter), ti,
|
||||||
MU_MSG_OPTION_HEADERS_ONLY)};
|
MU_MSG_OPTION_HEADERS_ONLY)};
|
||||||
fputs (to_string(sexp, !opts->nocolor).c_str(), stdout);
|
fputs (to_string(sexp, !opts->nocolor).c_str(), stdout);
|
||||||
fputs ("\n", stdout);
|
fputs ("\n", stdout);
|
||||||
|
|||||||
@ -372,7 +372,7 @@ static bool
|
|||||||
add_path_func (Mu::Store& store, const char *path, GError **err)
|
add_path_func (Mu::Store& store, const char *path, GError **err)
|
||||||
{
|
{
|
||||||
const auto docid = store.add_message (path);
|
const auto docid = store.add_message (path);
|
||||||
g_debug ("added message @ %s, docid=%u", docid);
|
g_debug ("added message @ %s, docid=%u", path, docid);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -415,7 +415,7 @@ tickle_func (Mu::Store& store, const char *path, GError **err)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto res = mu_msg_tickle (msg, err);
|
const auto res = mu_msg_tickle (msg, err);
|
||||||
g_debug ("tickled %s (%s)", res ? "ok" : "failed");
|
g_debug ("tickled %s (%s)", path, res ? "ok" : "failed");
|
||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
|
|
||||||
return res == TRUE;
|
return res == TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user