Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 2014 12:09:12 +0000 (UTC)
From:      Dmitry Sivachenko <demon@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r366866 - in head/textproc/irstlm: . files
Message-ID:  <201409011209.s81C9C3L094414@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: demon
Date: Mon Sep  1 12:09:12 2014
New Revision: 366866
URL: http://svnweb.freebsd.org/changeset/ports/366866
QAT: https://qat.redports.org/buildarchive/r366866/

Log:
  Remove gcc-isms.

Added:
  head/textproc/irstlm/files/
  head/textproc/irstlm/files/patch-src-interpolate-lm.cpp   (contents, props changed)
  head/textproc/irstlm/files/patch-src-mdiadapt.cpp   (contents, props changed)
Modified:
  head/textproc/irstlm/Makefile

Modified: head/textproc/irstlm/Makefile
==============================================================================
--- head/textproc/irstlm/Makefile	Mon Sep  1 12:03:09 2014	(r366865)
+++ head/textproc/irstlm/Makefile	Mon Sep  1 12:09:12 2014	(r366866)
@@ -16,7 +16,6 @@ RUN_DEPENDS=	${LOCALBASE}/bin/bash:${POR
 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

Added: head/textproc/irstlm/files/patch-src-interpolate-lm.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/irstlm/files/patch-src-interpolate-lm.cpp	Mon Sep  1 12:09:12 2014	(r366866)
@@ -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<float> p[N]; //LM probabilities
++    std::vector<float> *p = new std::vector<float>[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<N; i++) outtxt << w[i] << " " << lmf[i] << "\n";
+     outtxt.close();
++    delete[] p;
+   }
+ 
+   for(int i = 0; i < N; i++)

Added: head/textproc/irstlm/files/patch-src-mdiadapt.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/irstlm/files/patch-src-mdiadapt.cpp	Mon Sep  1 12:09:12 2014	(r366866)
@@ -0,0 +1,54 @@
+--- src/mdiadapt.cpp.orig	2014-09-01 15:41:52.000000000 +0400
++++ src/mdiadapt.cpp	2014-09-01 15:46:52.000000000 +0400
+@@ -1170,7 +1170,7 @@ int mdiadaptlm::saveBIN_per_word(char *f
+   }
+ 	
+ 	
+-  streampos pos[lmsize()+1];
++  streampos *pos = new streampos[lmsize()+1];
+   int maxlev=lmsize();
+   char buff[100];
+   int isQuant=0; //savebin for quantized LM is not yet implemented
+@@ -1385,7 +1385,7 @@ int mdiadaptlm::saveBIN_per_word(char *f
+     out.seekp(pos[i]);
+     out << buff;
+   }
+-	
++	delete[] pos;
+ 	out.close();
+ 	
+   //concatenate files for each single level into one file
+@@ -1420,7 +1420,7 @@ int mdiadaptlm::saveBIN_per_level(char *
+     VERBOSE(2,"savebin: " << filename << "\n");
+   }
+ 
+-  streampos pos[lmsize()+1];
++  streampos *pos = new streampos[lmsize()+1];
+   int maxlev=lmsize();
+   char buff[100];
+   int isQuant=0; //savebin for quantized LM is not yet implemented
+@@ -1583,6 +1583,7 @@ int mdiadaptlm::saveBIN_per_level(char *
+     out << buff;
+   }
+   out.close();
++  delete[] pos;
+ 
+   //concatenate files for each single level into one file
+ 	//single level files should have a name derived from "filename"
+@@ -1803,7 +1804,7 @@ int mdiadaptlm::saveARPA_per_level(char 
+   fstream out(filename,ios::out);
+   //  out.precision(15);
+ 
+-  streampos pos[lmsize()+1];
++  streampos *pos = new streampos[lmsize()+1]; 
+   table_entry_pos_t num[lmsize()+1];
+   char buff[100];
+ 
+@@ -1955,6 +1956,7 @@ int mdiadaptlm::saveARPA_per_level(char 
+     out << buff;
+   }
+ 
++  delete[] pos;
+   out.seekp(last);
+   out << "\\end\\" << "\n";
+   system("date");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409011209.s81C9C3L094414>