Index: head/textproc/randlm/Makefile =================================================================== --- head/textproc/randlm/Makefile (revision 366881) +++ head/textproc/randlm/Makefile (revision 366882) @@ -1,31 +1,31 @@ # Created by: Dmitry Sivachenko # $FreeBSD$ PORTNAME= randlm PORTVERSION= 0.2.5 CATEGORIES= textproc MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=${PORTNAME} MAINTAINER= demon@FreeBSD.org COMMENT= A toolkit for building randomized language models BUILD_DEPENDS= ${LOCALBASE}/include/google/sparse_hash_map:${PORTSDIR}/devel/google-sparsehash LIB_DEPENDS= libboost_thread.so:${PORTSDIR}/devel/boost-libs RUN_DEPENDS= ${LOCALBASE}/include/google/sparse_hash_map:${PORTSDIR}/devel/google-sparsehash GNU_CONFIGURE= yes -USE_GCC= yes USE_PERL5= run USE_AUTOTOOLS= libtoolize aclocal autoconf automake AUTOMAKE_ARGS= --add-missing USE_LDCONFIG= yes -USES= libtool +USES= libtool compiler:c++11-lang MAKE_JOBS_UNSAFE=yes -CFLAGS+= -I${LOCALBASE}/include +CXXFLAGS+= -std=c++11 -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib post-patch: - cd ${WRKSRC}/hadoop && ${MV} strings.cpp strings.cc + cd ${WRKSRC}/hadoop && ${MV} strings.cpp strings.cc && ${MV} strings.h s.h + ${REINPLACE_CMD} -e s#strings.h#s.h# ${WRKSRC}/hadoop/r_compute_ngram_counts.cpp ${WRKSRC}/hadoop/m_compute_ngram_counts_batch.cpp .include Index: head/textproc/randlm/files/patch-src-RandLM-LogFreqSketch.cpp =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-LogFreqSketch.cpp (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-LogFreqSketch.cpp (revision 366882) @@ -0,0 +1,20 @@ +--- src/RandLM/LogFreqSketch.cpp.orig 2012-03-30 13:53:30.000000000 +0400 ++++ src/RandLM/LogFreqSketch.cpp 2014-09-01 18:22:05.000000000 +0400 +@@ -162,7 +162,7 @@ namespace randlm { + + bool LogFreqSketch::load(RandLMFile* fin) { + // just maximum m +- return fin->read((char*)&maximum_m_, sizeof(maximum_m_));; ++ return fin->read((char*)&maximum_m_, sizeof(maximum_m_)).good(); + } + + bool LogFreqSketch::save(RandLMFile* fout) { +@@ -170,7 +170,7 @@ namespace randlm { + assert(LogFreqBloomFilter::save(fout)); // saves RandLMStruct first + assert(OnlineRandLMStruct::save(fout)); + // just maximum m +- return fout->write((char*)&maximum_m_, sizeof(maximum_m_));; ++ return fout->write((char*)&maximum_m_, sizeof(maximum_m_)).good(); + } + + } Property changes on: head/textproc/randlm/files/patch-src-RandLM-LogFreqSketch.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/randlm/files/patch-src-RandLM-RandLM.h =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-RandLM.h (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-RandLM.h (revision 366882) @@ -0,0 +1,13 @@ +--- src/RandLM/RandLM.h.orig 2012-03-30 13:53:30.000000000 +0400 ++++ src/RandLM/RandLM.h 2014-09-01 18:11:00.000000000 +0400 +@@ -86,8 +86,8 @@ namespace randlm { + + static const std::string kRandLMFileType; + +- static const float kNullLogProb = -1000000; +- static const float kUnknownLogProb = 1000000; ++ static constexpr float kNullLogProb = -1000000; ++ static constexpr float kUnknownLogProb = 1000000; + + static const int kMainEventIdx = 0; + static const int kAuxEventIdx = 1; Property changes on: head/textproc/randlm/files/patch-src-RandLM-RandLM.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/randlm/files/patch-src-RandLM-RandLMFilter.h =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-RandLMFilter.h (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-RandLMFilter.h (revision 366882) @@ -0,0 +1,34 @@ +--- src/RandLM/RandLMFilter.h.orig 2014-09-01 18:07:56.000000000 +0400 ++++ src/RandLM/RandLMFilter.h 2014-09-01 18:08:39.000000000 +0400 +@@ -289,7 +289,7 @@ namespace randlm { + std::cerr << "Saved ResizedBitFilter. Rho = " << rho() << "." << std::endl; + assert(fout->write((char*)&old_addresses_, sizeof(old_addresses_))); + assert(fout->write((char*)&a_, sizeof(a_))); +- return fout->write((char*)&b_, sizeof(b_)); ++ return fout->write((char*)&b_, sizeof(b_)).good(); + } + protected: + bool load(RandLMFile* fin) { +@@ -297,7 +297,7 @@ namespace randlm { + std::cerr << "Loaded ResizedBitFilter. Rho = " << rho() << "." << std::endl; + assert(fin->read((char*)&old_addresses_, sizeof(old_addresses_))); + assert(fin->read((char*)&a_, sizeof(a_))); +- return fin->read((char*)&b_, sizeof(b_)); ++ return fin->read((char*)&b_, sizeof(b_)).good(); + } + // member data + uint64_t old_addresses_; // size of pre-resized filter +@@ -342,11 +342,11 @@ namespace randlm { + } + bool save(RandLMFile* fout) { + assert(Filter::save(fout)); +- return fout->write((char*)&wrap_around_, sizeof(wrap_around_)); ++ return fout->write((char*)&wrap_around_, sizeof(wrap_around_)).good(); + } + private: + bool load(RandLMFile* fin) { +- return fin->read((char*)&wrap_around_, sizeof(wrap_around_)); ++ return fin->read((char*)&wrap_around_, sizeof(wrap_around_)).good(); + } + inline bool incrementSubCell(int bit, int len, T* cell) { + // increment counter consisting of bits [startbit, startbit + len - 1] rest stays unchanged Property changes on: head/textproc/randlm/files/patch-src-RandLM-RandLMFilter.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/randlm/files/patch-src-RandLM-RandLMPreproc.h =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-RandLMPreproc.h (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-RandLMPreproc.h (revision 366882) @@ -0,0 +1,11 @@ +--- src/RandLM/RandLMPreproc.h.orig 2014-09-01 18:11:27.000000000 +0400 ++++ src/RandLM/RandLMPreproc.h 2014-09-01 18:11:43.000000000 +0400 +@@ -407,7 +407,7 @@ namespace randlm { + // Concrete subclass of NormalisedNgramFile for backoff model data + class BackoffModelFile : public NormalisedNgramFile { + public: +- static const float kNullBackoffWeight = 0; // indicates lack of backoff weight ++ static constexpr float kNullBackoffWeight = 0; // indicates lack of backoff weight + static bool ValidWeight(float boweight); + // creation at start of pipeline (i.e. load a preprocess backoff model) + BackoffModelFile(const std::string & input_path, const std::string & input_type, Property changes on: head/textproc/randlm/files/patch-src-RandLM-RandLMPreproc.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/randlm/files/patch-src-RandLM-RandLMQuantiser.h =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-RandLMQuantiser.h (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-RandLMQuantiser.h (revision 366882) @@ -0,0 +1,11 @@ +--- src/RandLM/RandLMQuantiser.h.orig 2014-09-01 18:09:32.000000000 +0400 ++++ src/RandLM/RandLMQuantiser.h 2014-09-01 18:09:51.000000000 +0400 +@@ -38,7 +38,7 @@ namespace randlm { + + class Quantiser { + public: +- static const float kFloatErr = 0.00001f; ++ static constexpr float kFloatErr = 0.00001f; + + Quantiser(RandLMInfo* info, Stats* stats, EventType event) + : info_(info), event_type_(event), code_to_value_(NULL), Property changes on: head/textproc/randlm/files/patch-src-RandLM-RandLMQuantiser.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/randlm/files/patch-src-RandLM-RandLMTypes.h =================================================================== --- head/textproc/randlm/files/patch-src-RandLM-RandLMTypes.h (nonexistent) +++ head/textproc/randlm/files/patch-src-RandLM-RandLMTypes.h (revision 366882) @@ -0,0 +1,11 @@ +--- src/RandLM/RandLMTypes.h.orig 2014-09-01 18:20:25.000000000 +0400 ++++ src/RandLM/RandLMTypes.h 2014-09-01 18:21:06.000000000 +0400 +@@ -21,7 +21,7 @@ + #include + #include + +-#define iterate(c,i) for(typeof(c.begin()) i = c.begin(); i != c.end(); i++) ++#define iterate(c,i) for(auto i = c.begin(); i != c.end(); i++) + + namespace randlm { + Property changes on: head/textproc/randlm/files/patch-src-RandLM-RandLMTypes.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property