fixed mac os clang warnings

This commit is contained in:
Jean-Francois Dockes 2021-04-01 09:22:17 -07:00
parent db659c4d81
commit a3b1b48450
8 changed files with 66 additions and 73 deletions

View File

@ -133,18 +133,18 @@ public:
QtGuiResListPager(ResList *p, int ps, bool alwayssnip)
: ResListPager(ps, alwayssnip), m_reslist(p)
{}
virtual bool append(const string& data);
virtual bool append(const string& data, int idx, const Rcl::Doc& doc);
virtual string trans(const string& in);
virtual string detailsLink();
virtual const string &parFormat();
virtual const string &dateFormat();
virtual string nextUrl();
virtual string prevUrl();
virtual string headerContent();
virtual bool append(const string& data) override;
virtual bool append(const string& data, int idx, const Rcl::Doc& doc) override;
virtual string trans(const string& in) override;
virtual string detailsLink() override;
virtual const string &parFormat() override;
virtual const string &dateFormat() override;
virtual string nextUrl() override;
virtual string prevUrl() override;
virtual string headerContent() override;
virtual void suggest(const vector<string>uterms,
map<string, vector<string> >& sugg);
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
map<string, vector<string> >& sugg) override;
virtual string absSep() override {return (const char *)(prefs.abssep.toUtf8());}
#if defined(USING_WEBENGINE) || defined(USING_WEBKIT)
// We used to use http://localhost/. Now use file:/// as this is

View File

@ -247,7 +247,7 @@ void SSearch::onCompleterShown()
}
// Test if the completer text begins with the current input.
QString text = data.toString();
if (!text.lastIndexOf(queryText->text()) == 0) {
if (text.lastIndexOf(queryText->text()) != 0) {
return;
}

View File

@ -470,7 +470,7 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="toolTip">

View File

@ -223,7 +223,7 @@ public:
}
void startElement(const std::string &nm,
const std::map<std::string, std::string>& attrs) {
const std::map<std::string, std::string>& attrs) override {
LOGDEB2("SSHXMLHandler::startElement: name [" << nm << "]\n");
if (nm == "SD") {
// Simple search saved data has a type='ssearch' attribute.
@ -277,7 +277,7 @@ public:
return ;
}
void characterData(const std::string &str) {
void characterData(const std::string &str) override {
currentText += str;
}

View File

@ -128,7 +128,6 @@ class RclDynConf {
getStringEntries(const std::string& sk);
private:
unsigned int m_mlen;
ConfSimple m_data;
};

View File

@ -169,6 +169,7 @@ public:
}
if (m_terms.find(dumb) != m_terms.end()) {
PRETEND_USE(m_rawtext);
// This word is a search term. Extend or create fragment
LOGDEB1("match: [" << dumb << "] pos " << pos << " bpos " << bts <<
":" << bte << " remainingWords " << m_remainingWords << endl);

View File

@ -1721,7 +1721,7 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
// won't work).
time_t mtime = atoll(doc.dmtime.empty() ? doc.fmtime.c_str() :
doc.dmtime.c_str());
struct tm tmb{0,0,0,0,0,0,0,0,0};
struct tm tmb;
localtime_r(&mtime, &tmb);
char buf[50]; // It's actually 9, but use 50 to suppress warnings.
snprintf(buf, 50, "%04d%02d%02d",

View File

@ -49,10 +49,10 @@ public:
* Construct from readable xapian database and family name (ie: Stm)
*/
XapSynFamily(Xapian::Database xdb, const std::string& familyname)
: m_rdb(xdb)
{
: m_rdb(xdb) {
m_prefix1 = std::string(":") + familyname;
}
virtual ~XapSynFamily() {}
/** Retrieve all members of this family (e.g: french english german...) */
virtual bool getMembers(std::vector<std::string>&);
@ -65,19 +65,16 @@ public:
const std::string& term, std::vector<std::string>& result);
// The prefix shared by all synonym entries inside a family member
virtual std::string entryprefix(const std::string& member)
{
virtual std::string entryprefix(const std::string& member) {
return m_prefix1 + ":" + member + ":";
}
// The key for the "list of members" entry
virtual std::string memberskey()
{
virtual std::string memberskey() {
return m_prefix1 + ";" + "members";
}
Xapian::Database& getdb()
{
Xapian::Database& getdb() {
return m_rdb;
}
@ -95,11 +92,10 @@ protected:
class XapWritableSynFamily : public XapSynFamily {
public:
/** Construct with Xapian db open for r/w */
XapWritableSynFamily(Xapian::WritableDatabase db,
const std::string& familyname)
: XapSynFamily(db, familyname), m_wdb(db)
{
}
XapWritableSynFamily(Xapian::WritableDatabase db, const std::string& familyname)
: XapSynFamily(db, familyname), m_wdb(db) {}
virtual ~XapWritableSynFamily() {}
/** Delete all entries for one member (e.g. french), and remove from list
* of members */
@ -117,6 +113,7 @@ protected:
/** A functor which transforms a string */
class SynTermTrans {
public:
virtual ~SynTermTrans() {}
virtual std::string operator()(const std::string&) = 0;
virtual std::string name() { return "SynTermTrans: unknown";}
};
@ -131,9 +128,9 @@ public:
XapComputableSynFamMember(Xapian::Database xdb, std::string familyname,
std::string membername, SynTermTrans* trans)
: m_family(xdb, familyname), m_membername(membername),
m_trans(trans), m_prefix(m_family.entryprefix(m_membername))
{
}
m_trans(trans), m_prefix(m_family.entryprefix(m_membername)) {}
virtual ~XapComputableSynFamMember() {}
/** Expand a term to its list of synonyms. If filtertrans is set we
* keep only the results which transform to the same value as the input
@ -162,15 +159,14 @@ public:
Xapian::WritableDatabase xdb, std::string familyname,
std::string membername, SynTermTrans* trans)
: m_family(xdb, familyname), m_membername(membername),
m_trans(trans), m_prefix(m_family.entryprefix(m_membername))
{
}
m_trans(trans), m_prefix(m_family.entryprefix(m_membername)) {}
virtual bool addSynonym(const std::string& term)
{
LOGDEB2("addSynonym:me " << (this) << " term [" << (term) << "] m_trans " << (m_trans) << "\n" );
virtual ~XapWritableComputableSynFamMember() {}
virtual bool addSynonym(const std::string& term) {
LOGDEB2("addSynonym:me " << this << " term [" << term << "] m_trans " << m_trans << "\n");
std::string transformed = (*m_trans)(term);
LOGDEB2("addSynonym: transformed [" << (transformed) << "]\n" );
LOGDEB2("addSynonym: transformed [" << transformed << "]\n");
if (transformed == term)
return true;
@ -179,19 +175,17 @@ public:
m_family.getdb().add_synonym(m_prefix + transformed, term);
} XCATCHERROR(ermsg);
if (!ermsg.empty()) {
LOGERR("XapWritableComputableSynFamMember::addSynonym: xapian error " << (ermsg) << "\n" );
LOGERR("XapWritableComputableSynFamMember::addSynonym: xapian error " << ermsg << "\n");
return false;
}
return true;
}
void clear()
{
void clear() {
m_family.deleteMember(m_membername);
}
void recreate()
{
void recreate() {
clear();
m_family.createMember(m_membername);
}
@ -222,4 +216,3 @@ static const std::string synFamDiCa("DCa");
} // end namespace Rcl
#endif /* _SYNFAMILY_H_INCLUDED_ */