From fef9554d1c44463cdff8b35048faa77be0a89aa5 Mon Sep 17 00:00:00 2001 From: Dmitry Sivachenko Date: Mon, 1 Sep 2014 12:09:12 +0000 Subject: [PATCH] Remove gcc-isms. --- textproc/irstlm/Makefile | 1 - .../irstlm/files/patch-src-interpolate-lm.cpp | 27 ++++++++++ textproc/irstlm/files/patch-src-mdiadapt.cpp | 54 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 textproc/irstlm/files/patch-src-interpolate-lm.cpp create mode 100644 textproc/irstlm/files/patch-src-mdiadapt.cpp diff --git a/textproc/irstlm/Makefile b/textproc/irstlm/Makefile index 360a9aed3771..5f889b5475f6 100644 --- a/textproc/irstlm/Makefile +++ b/textproc/irstlm/Makefile @@ -16,7 +16,6 @@ RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-shared USE_PERL5= run -USE_GCC= yes USE_AUTOTOOLS= libtoolize aclocal autoconf automake AUTOMAKE_ARGS= --add-missing USES= shebangfix libtool tar:tgz diff --git a/textproc/irstlm/files/patch-src-interpolate-lm.cpp b/textproc/irstlm/files/patch-src-interpolate-lm.cpp new file mode 100644 index 000000000000..bfa9b5f47a08 --- /dev/null +++ b/textproc/irstlm/files/patch-src-interpolate-lm.cpp @@ -0,0 +1,27 @@ +--- src/interpolate-lm.cpp.orig 2014-09-01 15:59:41.000000000 +0400 ++++ src/interpolate-lm.cpp 2014-09-01 16:00:21.000000000 +0400 +@@ -230,7 +230,7 @@ int main(int argc, char **argv) + //Learning mixture weights + if (learn) { + +- std::vector p[N]; //LM probabilities ++ std::vector *p = new std::vector[N]; //LM probabilities + float c[N]; //expected counts + float den,norm; //inner denominator, normalization term + float variation=1.0; // global variation between new old params +@@ -256,6 +256,7 @@ int main(int argc, char **argv) + lstream >> token >> id >> newlm; + if(id <= 0 || id > N) { + std::cerr << "LM id out of range." << std::endl; ++ delete[] p; + return 1; + } + id--; // count from 0 now +@@ -318,6 +319,7 @@ int main(int argc, char **argv) + outtxt << "LMINTERPOLATION " << N << "\n"; + for (int i=0; i