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

View file

@ -72,7 +72,7 @@ void Binc::MimeDocument::parseOnlyHeader(int fd) const
nlines = 0; nlines = 0;
nbodylines = 0; nbodylines = 0;
MimePart::parseOnlyHeader(""); doParseOnlyHeader("");
} }
void Binc::MimeDocument::parseOnlyHeader(istream& s) const void Binc::MimeDocument::parseOnlyHeader(istream& s) const
@ -95,11 +95,11 @@ void Binc::MimeDocument::parseOnlyHeader(istream& s) const
nlines = 0; nlines = 0;
nbodylines = 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 name;
string content; string content;

View file

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

View file

@ -6,15 +6,15 @@ LIBS = librcl.a
all: $(LIBS) 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 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 = 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 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 librcl.a : $(DEPS) $(OBJS)
ar ru librcl.a $(OBJS) unac.o ar ru librcl.a $(OBJS)
$(RANLIB) librcl.a $(RANLIB) librcl.a
unac.o : $(depth)/unac/unac.c $(depth)/unac/unac.h $(depth)/mk/localdefs unac.o : ../unac/unac.cpp $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c $(depth)/unac/unac.c $(CXX) $(ALL_CXXFLAGS) -c ../unac/unac.cpp
rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
$(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp $(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp
beaglequeuecache.o : ../common/beaglequeuecache.cpp $(depth)/mk/localdefs 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 for i in *.dep;do test -f $$i && cp /dev/null $$i;done
distclean: clean distclean: clean
rm -f *.dep 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 rclaspell.dep.stamp : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
$(CXX) -M $(ALL_CXXFLAGS) ../aspell/rclaspell.cpp > rclaspell.dep $(CXX) -M $(ALL_CXXFLAGS) ../aspell/rclaspell.cpp > rclaspell.dep
touch rclaspell.dep.stamp 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 x11mon.dep.stamp : ../utils/x11mon.cpp $(depth)/mk/localdefs
$(CXX) -M $(ALL_CXXFLAGS) ../utils/x11mon.cpp > x11mon.dep $(CXX) -M $(ALL_CXXFLAGS) ../utils/x11mon.cpp > x11mon.dep
touch x11mon.dep.stamp touch x11mon.dep.stamp
include unac.dep
include rclaspell.dep include rclaspell.dep
include beaglequeuecache.dep include beaglequeuecache.dep
include cstr.dep include cstr.dep

View file

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

View file

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

View file

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

View file

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

View file

@ -26,7 +26,7 @@ using std::vector;
class RclConfig; class RclConfig;
class PlainToRich; class PlainToRich;
class HiliteData; struct HiliteData;
/** /**
* Manage a paged HTML result list. * 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")); LOGDEB(("DocSeqSorted::setSortSpec\n"));
m_spec = sortspec; m_spec = sortspec;

View file

@ -36,7 +36,7 @@ class DocSeqSorted : public DocSeqModifier {
} }
virtual ~DocSeqSorted() {} virtual ~DocSeqSorted() {}
virtual bool canSort() {return true;} 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 bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
virtual int getResCnt() {return m_docsp.size();} virtual int getResCnt() {return m_docsp.size();}
private: private:

View file

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

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

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