Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 2013 13:48:34 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r332372 - head/graphics/ocropus/files
Message-ID:  <201311011348.rA1DmYpe001771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Fri Nov  1 13:48:34 2013
New Revision: 332372
URL: http://svnweb.freebsd.org/changeset/ports/332372

Log:
  graphics/ocropus: Fix C++ issues for modern compilers
  
  Approved by:	portmgr (bapt, implicit)

Added:
  head/graphics/ocropus/files/patch-ocr-layout_ocr-reading-order.cc   (contents, props changed)
  head/graphics/ocropus/files/patch-ocr-line_glclass.cc   (contents, props changed)
  head/graphics/ocropus/files/patch-ocr-utils_enumerator.h   (contents, props changed)

Added: head/graphics/ocropus/files/patch-ocr-layout_ocr-reading-order.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/ocropus/files/patch-ocr-layout_ocr-reading-order.cc	Fri Nov  1 13:48:34 2013	(r332372)
@@ -0,0 +1,12 @@
+--- ocr-layout/ocr-reading-order.cc.orig	2009-05-31 20:18:41.000000000 +0000
++++ ocr-layout/ocr-reading-order.cc
+@@ -210,7 +210,8 @@ namespace ocropus {
+ 
+         // Make dummy text-lines from horizontal rulings to use them as
+         // separating elements for reading order.
+-        for(int i=0,l=hor_rulings.length(); i<l; i++){
++        int hrl;
++        for(int i=0,hrl=hor_rulings.length(); i<hrl; i++){
+             line l;
+             rectangle r = hor_rulings[i];
+             l.c = r.ycenter();

Added: head/graphics/ocropus/files/patch-ocr-line_glclass.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/ocropus/files/patch-ocr-line_glclass.cc	Fri Nov  1 13:48:34 2013	(r332372)
@@ -0,0 +1,11 @@
+--- ocr-line/glclass.cc.orig	2009-05-31 20:18:41.000000000 +0000
++++ ocr-line/glclass.cc
+@@ -95,7 +95,7 @@ namespace glinerec {
+     double nearest_neighbor_error(IDataset &data,int ntrials=1000) {
+         int total = 0;
+         ntrials = min(data.nsamples(),ntrials);
+-        for(int i=0;i<data.nsamples();i++) {
++        for(int ic=0;ic<data.nsamples();ic++) {
+             // FIXME use sampling without replacement
+             int i = lrand48()%data.nsamples();
+             floatarray u;

Added: head/graphics/ocropus/files/patch-ocr-utils_enumerator.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/ocropus/files/patch-ocr-utils_enumerator.h	Fri Nov  1 13:48:34 2013	(r332372)
@@ -0,0 +1,24 @@
+--- ocr-utils/enumerator.h.orig	2009-05-31 20:18:41.000000000 +0000
++++ ocr-utils/enumerator.h
+@@ -32,6 +32,10 @@
+ #include <memory.h>
+ #include "ocropus.h"
+ 
++inline int Hash_hash(int x) {
++    return x;
++}
++
+ template <class T>
+ inline void memswap(T &a,T &b) {
+     char buf[sizeof (T)];
+@@ -102,10 +106,6 @@ struct EnumHash {
+     }
+ };
+ 
+-inline int Hash_hash(int x) {
+-    return x;
+-}
+-
+ struct Enumerator {
+     int n;
+     EnumHash<int,int> translation;



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