Get recoll to compile with clang (on freebsd) and eliminate warnings. You can no build recoll with make CXX=clang LINK=clang

This commit is contained in:
Jean-Francois Dockes 2012-05-20 17:35:03 +02:00
parent f7e1d687b1
commit 9b06f6cb25
13 changed files with 42 additions and 31 deletions

View file

@ -80,7 +80,7 @@ void Binc::MimeDocument::parseFull(int fd) const
int bsize = 0;
string bound;
MimePart::parseFull(bound, bsize);
doParseFull(bound, bsize);
// eat any trailing junk to get the correct size
char c;
@ -109,7 +109,7 @@ void Binc::MimeDocument::parseFull(istream& s) const
int bsize = 0;
string bound;
MimePart::parseFull(bound, bsize);
doParseFull(bound, bsize);
// eat any trailing junk to get the correct size
char c;
@ -286,7 +286,7 @@ static void parseMessageRFC822(vector<Binc::MimePart> *members,
// parsefull returns the number of bytes that need to be removed
// from the body because of the terminating boundary string.
int bsize = 0;
if (m.parseFull(toboundary, bsize))
if (m.doParseFull(toboundary, bsize))
*foundendofpart = true;
// make sure bodylength doesn't overflow
@ -468,7 +468,7 @@ static void parseMultipart(const string &boundary,
// If parseFull returns != 0, then it encountered the multipart's
// final boundary.
int bsize = 0;
if (m.parseFull(boundary, bsize)) {
if (m.doParseFull(boundary, bsize)) {
quit = true;
*boundarysize = bsize;
}
@ -591,10 +591,10 @@ static void parseSinglePart(const string &toboundary,
}
//------------------------------------------------------------------------
int Binc::MimePart::parseFull(const string &toboundary,
int Binc::MimePart::doParseFull(const string &toboundary,
int &boundarysize) const
{
MPFDEB((stderr, "BINC: parsefull, toboundary[%s]\n", toboundary.c_str()));
MPFDEB((stderr, "BINC: doParsefull, toboundary[%s]\n", toboundary.c_str()));
headerstartoffsetcrlf = mimeSource->getOffset();
// Parse the header of this mime part.
@ -626,6 +626,6 @@ int Binc::MimePart::parseFull(const string &toboundary,
&eof, &foundendofpart, &bodylength);
}
MPFDEB((stderr, "BINC: parsefull ret, toboundary[%s]\n", toboundary.c_str()));
MPFDEB((stderr, "BINC: doParsefull ret, toboundary[%s]\n", toboundary.c_str()));
return (eof || foundendofpart) ? 1 : 0;
}

View file

@ -72,7 +72,7 @@ void Binc::MimeDocument::parseOnlyHeader(int fd) const
nlines = 0;
nbodylines = 0;
MimePart::parseOnlyHeader("");
doParseOnlyHeader("");
}
void Binc::MimeDocument::parseOnlyHeader(istream& s) const
@ -95,11 +95,11 @@ void Binc::MimeDocument::parseOnlyHeader(istream& s) const
nlines = 0;
nbodylines = 0;
MimePart::parseOnlyHeader("");
doParseOnlyHeader("");
}
//------------------------------------------------------------------------
int Binc::MimePart::parseOnlyHeader(const string &toboundary) const
int Binc::MimePart::doParseOnlyHeader(const string &toboundary) const
{
string name;
string content;

View file

@ -114,8 +114,8 @@ namespace Binc {
virtual void clear(void) const;
const MimePart *getPart(const std::string &findpart, std::string genpart, FetchType fetchType = FetchBody) const;
virtual int parseOnlyHeader(const std::string &toboundary) const;
virtual int parseFull(const std::string &toboundary, int &boundarysize) const;
virtual int doParseOnlyHeader(const std::string &toboundary) const;
virtual int doParseFull(const std::string &toboundary, int &boundarysize) const;
MimePart(void);
virtual ~MimePart(void);

View file

@ -6,15 +6,15 @@ LIBS = librcl.a
all: $(LIBS)
OBJS = rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o myhtmlparse.o mimehandler.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o rcldb.o rcldoc.o rclquery.o searchdata.o stemdb.o stoplist.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-getpart.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime-printdoc.o mime-printheader.o mime.o convert.o iodevice.o iofactory.o
DEPS = rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp myhtmlparse.dep.stamp mimehandler.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp stemdb.dep.stamp stoplist.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-getpart.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime-printdoc.dep.stamp mime-printheader.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp
OBJS = unac.o rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o myhtmlparse.o mimehandler.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o rcldb.o rcldoc.o rclquery.o searchdata.o stemdb.o stoplist.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-getpart.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime-printdoc.o mime-printheader.o mime.o convert.o iodevice.o iofactory.o
DEPS = unac.dep.stamp rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp myhtmlparse.dep.stamp mimehandler.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp stemdb.dep.stamp stoplist.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-getpart.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime-printdoc.dep.stamp mime-printheader.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp
librcl.a : $(DEPS) $(OBJS) unac.o
ar ru librcl.a $(OBJS) unac.o
librcl.a : $(DEPS) $(OBJS)
ar ru librcl.a $(OBJS)
$(RANLIB) librcl.a
unac.o : $(depth)/unac/unac.c $(depth)/unac/unac.h $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c $(depth)/unac/unac.c
unac.o : ../unac/unac.cpp $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c ../unac/unac.cpp
rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp
beaglequeuecache.o : ../common/beaglequeuecache.cpp $(depth)/mk/localdefs
@ -165,6 +165,9 @@ clean:
for i in *.dep;do test -f $$i && cp /dev/null $$i;done
distclean: clean
rm -f *.dep
unac.dep.stamp : ../unac/unac.cpp $(depth)/mk/localdefs
$(CXX) -M $(ALL_CXXFLAGS) ../unac/unac.cpp > unac.dep
touch unac.dep.stamp
rclaspell.dep.stamp : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
$(CXX) -M $(ALL_CXXFLAGS) ../aspell/rclaspell.cpp > rclaspell.dep
touch rclaspell.dep.stamp
@ -351,6 +354,7 @@ wipedir.dep.stamp : ../utils/wipedir.cpp $(depth)/mk/localdefs
x11mon.dep.stamp : ../utils/x11mon.cpp $(depth)/mk/localdefs
$(CXX) -M $(ALL_CXXFLAGS) ../utils/x11mon.cpp > x11mon.dep
touch x11mon.dep.stamp
include unac.dep
include rclaspell.dep
include beaglequeuecache.dep
include cstr.dep

View file

@ -44,6 +44,7 @@ ${depth}/rcldb/rclquery.cpp \
${depth}/rcldb/searchdata.cpp \
${depth}/rcldb/stemdb.cpp \
${depth}/rcldb/stoplist.cpp \
${depth}/unac/unac.cpp \
${depth}/utils/base64.cpp \
${depth}/utils/circache.cpp \
${depth}/utils/closefrom.cpp \
@ -116,12 +117,10 @@ all: \$(LIBS)
OBJS = $OBJS
DEPS = $DEPS
librcl.a : \$(DEPS) \$(OBJS) unac.o
ar ru librcl.a \$(OBJS) unac.o
librcl.a : \$(DEPS) \$(OBJS)
ar ru librcl.a \$(OBJS)
\$(RANLIB) librcl.a
unac.o : \$(depth)/unac/unac.c \$(depth)/unac/unac.h $defs
\$(CXX) \$(ALL_CXXFLAGS) -c \$(depth)/unac/unac.c
EOF
for c in $SRC_CPP;do
@ -138,7 +137,7 @@ done
cat >> $mk <<EOF
depend: \$(DEPS)
clean:
rm -f \$(OBJS) \$(LIBS) \$(DEPS) *.stamp unac.o
rm -f \$(OBJS) \$(LIBS) \$(DEPS) *.stamp
for i in *.dep;do test -f \$\$i && cp /dev/null \$\$i;done
distclean: clean
rm -f *.dep

View file

@ -279,7 +279,7 @@ class SmallerListWidget: public QListWidget
public:
SmallerListWidget(QWidget *parent)
: QListWidget(parent) {}
virtual QSize sizeHint() {return QSize(150, 40);}
virtual QSize sizeHint() const {return QSize(150, 40);}
};
ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,

View file

@ -54,7 +54,7 @@ DocSeqFiltered::DocSeqFiltered(RclConfig *conf, RefCntr<DocSequence> iseq,
setFiltSpec(filtspec);
}
bool DocSeqFiltered::setFiltSpec(DocSeqFiltSpec &filtspec)
bool DocSeqFiltered::setFiltSpec(const DocSeqFiltSpec &filtspec)
{
LOGDEB0(("DocSeqFiltered::setFiltSpec\n"));
for (unsigned int i = 0; i < filtspec.crits.size(); i++) {

View file

@ -37,7 +37,7 @@ public:
DocSeqFiltSpec &filtspec);
virtual ~DocSeqFiltered() {}
virtual bool canFilter() {return true;}
virtual bool setFiltSpec(DocSeqFiltSpec &filtspec);
virtual bool setFiltSpec(const DocSeqFiltSpec &filtspec);
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
virtual int getResCnt() {return m_seq->getResCnt();}
private:

View file

@ -26,7 +26,7 @@ using std::vector;
class RclConfig;
class PlainToRich;
class HiliteData;
struct HiliteData;
/**
* Manage a paged HTML result list.

View file

@ -41,7 +41,7 @@ public:
}
};
bool DocSeqSorted::setSortSpec(DocSeqSortSpec &sortspec)
bool DocSeqSorted::setSortSpec(const DocSeqSortSpec &sortspec)
{
LOGDEB(("DocSeqSorted::setSortSpec\n"));
m_spec = sortspec;

View file

@ -36,7 +36,7 @@ class DocSeqSorted : public DocSeqModifier {
}
virtual ~DocSeqSorted() {}
virtual bool canSort() {return true;}
virtual bool setSortSpec(DocSeqSortSpec &sortspec);
virtual bool setSortSpec(const DocSeqSortSpec &sortspec);
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
virtual int getResCnt() {return m_docsp.size();}
private:

View file

@ -57,14 +57,21 @@ static const string& docfToDatf(const string& df)
// special processing for special fields like dates and sizes. User
// custom field data will have to be processed before insertion to
// achieve equivalent results.
#if XAPIAN_MAJOR_VERSION == 1 && XAPIAN_MINOR_VERSION < 2
class QSorter : public Xapian::Sorter {
#else
class QSorter : public Xapian::KeyMaker {
#endif
public:
QSorter(const string& f)
: m_fld(docfToDatf(f) + "=")
{
m_ismtime = !m_fld.compare("dmtime=");
m_issize = !m_fld.compare("fbytes=") || !m_fld.compare("dbytes=") ||
!m_fld.compare("pcbytes=");
if (m_ismtime)
m_issize = false;
else
m_issize = !m_fld.compare("fbytes=") || !m_fld.compare("dbytes=") ||
!m_fld.compare("pcbytes=");
}
virtual std::string operator()(const Xapian::Document& xdoc) const

1
src/unac/unac.cpp Symbolic link
View file

@ -0,0 +1 @@
unac.c