Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Mar 2003 13:11:13 -0800 (PST)
From:      Joel Ray Holveck <joelh@piqnet.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/49056: Festival fixes for newer GCCs [PATCH]
Message-ID:  <200303092111.h29LBDkM034686@thor.piqnet.org>

next in thread | raw e-mail | index | archive | help

>Number:         49056
>Category:       ports
>Synopsis:       Festival fixes for newer GCCs [PATCH]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 09 13:20:13 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Joel Ray Holveck
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD thor.piqnet.org 5.0-RELEASE FreeBSD 5.0-RELEASE #13: Sun Feb 9 17:11:33 PST 2003 root@thor.piqnet.org:/usr/local/src/freebsd/src/sys/i386/compile/THOR i386
gcc (GCC) 3.2.1 [FreeBSD] 20021119 (release)
>Description:
The version of Festival will not compile using GCC 3.2.1, apparently
primarily due to some changes in the C++ strictness.  Attached is a
patch to make it work.  (Technically, the patch applies to
speech_tools and OGI, not Festival proper, but they're all part of the
Festival port.)

All but one of these changes are in the current version of Festival,
but making a new port of that may be a bit of work, since the
configuration mechanism has changed.  This PR is here as a stopgap
measure.

The one change that has not been brought into the current version is
the #include file change.  I've sent that to the Festival maintainers.
>How-To-Repeat:
	
>Fix:
Attached are three patch files, relative to $WRKDIR.  (I think that's
the format you need to put these in as patches in the files/
directory.)  The first file contains the patches that are in the
current Festival release.  The second contains patches that are not
(but have been sent to them).  The third contains patches that should
only be applied for WITH_OGI.

This first patchfile contains patches that are in the current (but not
yet ported) Festival release.  These are mostly for C++ fixes, plus
one voxware fix to get it to work with artsdsp.
--- speech_tools/audio/voxware.cc	Tue Sep 28 09:38:22 1999
+++ speech_tools/audio/voxware.cc	Sat Mar  8 18:55:29 2003
@@ -114,9 +114,11 @@
 {
     int fmt;
     int sfmts;
+    int chans = 1;
 
     ioctl(sbdevice,SNDCTL_DSP_RESET,0);
     ioctl(sbdevice,SNDCTL_DSP_SPEED,&samp_rate);
+    ioctl(sbdevice,SNDCTL_DSP_CHANNELS,&chans);
     ioctl(sbdevice,SNDCTL_DSP_GETFMTS,&sfmts);
 
     if (sfmts == AFMT_U8)
--- speech_tools/base_class/EST_Pathname_unix.cc	Mon May 31 10:38:45 1999
+++ speech_tools/base_class/EST_Pathname_unix.cc	Sat Mar  8 17:04:00 2003
@@ -126,7 +126,7 @@
 	  struct stat buf;
 
 	  if (check_for_directories && 
-	      stat((EST_String)this->as_directory() + name, &buf)==0 && 
+	      stat((EST_String)(this->as_directory() + name), &buf)==0 && 
 	      (buf.st_mode & S_IFDIR))
 	    list.append(name.as_directory());
 	  else
--- speech_tools/base_class/EST_TBuffer.cc	Sun May 30 06:50:31 1999
+++ speech_tools/base_class/EST_TBuffer.cc	Sat Mar  8 17:16:51 2003
@@ -41,6 +41,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include "EST_unix.h"
 #include "EST_TBuffer.h"
 
--- speech_tools/include/ling_class/EST_Relation.h	Fri Oct 22 06:04:41 1999
+++ speech_tools/include/ling_class/EST_Relation.h	Sat Mar  8 15:37:34 2003
@@ -190,7 +190,7 @@
     EST_Item *prepend(EST_Item *si);
     EST_Item *prepend(); 
 
-    friend EST_Item;
+    friend class EST_Item;
 };
 
 VAL_REGISTER_CLASS_DCLS(relation,EST_Relation)
--- speech_tools/include/rxp/dtd.h	Fri Jul 24 08:12:26 1998
+++ speech_tools/include/rxp/dtd.h	Sat Mar  8 16:48:18 2003
@@ -201,8 +201,8 @@
 XML_API Entity DefineEntity(Dtd dtd, Entity entity, int pe);
 XML_API Entity FindEntityN(Dtd dtd, const Char *name, int namelen, int pe);
 
-#define NewExternalEntity(name, pub, sys, not, parent) \
-    NewExternalEntityN(name, name ? Strlen(name) : 0, pub, sys, not, parent)
+#define NewExternalEntity(name, pub, sys, neg, parent) \
+    NewExternalEntityN(name, name ? Strlen(name) : 0, pub, sys, neg, parent)
 #define NewInternalEntity(name, test, parent, l, l1, mat) \
     NewInternalEntityN(name, name ? Strlen(name) : 0, test, parent, l, l1, mat)
 #define FindEntity(dtd, name, pe) FindEntityN(dtd, name, Strlen(name), pe)
--- speech_tools/testsuite/named_enum_example.cc	Tue Jun 15 10:59:19 1999
+++ speech_tools/testsuite/named_enum_example.cc	Sat Mar  8 17:34:32 2003
@@ -160,11 +160,11 @@
       cout << nm << " is " << (int)c
 	   << " = " << ColourMap.name(c) 
 	   << " (" << (spanish?spanish:"[NULL]") << " in Spanish)"
-	   << " = {" << hex
+	   << " = {"
 	   << info.red << ", "
 	   << info.green << ", "
 	   << info.blue
-	   << dec << "}\n";
+	   << "}\n";
     }
 
   // In the special case of EST_TNamedEnum (i.e. simple mappings from



The next patch fixes an #include file location: machine/soundcard.h ->
sys/soundcard.h.  The sys/soundcard.h is preferred since at least
FreeBSD 4.0 and later, but there was a compatibility symlink for
machine/soundcard.h until Mar 2002 in 5.0.
--- speech_tools/audio/voxware.cc	Tue Sep 28 09:38:22 1999
+++ speech_tools/audio/voxware.cc	Sat Mar  8 18:55:29 2003
@@ -61,7 +61,7 @@
 #include "EST_error.h"
 
 #ifdef SUPPORT_FREEBSD16
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
 #include <fcntl.h>
 int freebsd16_supported = TRUE;
 int linux16_supported = FALSE;



The last patch should only be applied if the user has WITH_OGI
defined.
--- festival/src/modules/OGIresLPC/pmark_analysis.cc	Wed Dec 29 17:11:49 1999
+++ festival/src/modules/OGIresLPC/pmark_analysis.cc	Sat Mar  8 17:46:55 2003
@@ -58,7 +58,8 @@
     EST_error("OGIresLPC pmark analysis:  infile_list empty - no input files to process");
   }
 
-  EST_Pathname f,spfile,lxfile,outfile,basename;
+  EST_Pathname f,spfile,lxfile,outfile;
+  EST_String basename;
   EST_String sp_path  = wstrdup(g.S("sp_path"));
   EST_String lx_path  = wstrdup(g.S("lx_path"));
   EST_String out_path = wstrdup(g.S("out_path"));
--- festival/src/modules/OGIresLPC/resLPC_analysis.cc	Wed Dec 29 17:11:49 1999
+++ festival/src/modules/OGIresLPC/resLPC_analysis.cc	Sat Mar  8 17:44:52 2003
@@ -62,10 +62,10 @@
     bool files_loaded = TRUE;
     f = EST_Pathname(get_c_string(car(l)));
     basename = f.basename(1);
-    pmfile  = pm_path + basename + pm_ext;
-    spfile  = sp_path + basename + sp_ext;
-    lpc_outfile = out_path   + basename + lpc_ext;
-    res_outfile = out_path   + basename + res_ext;
+    pmfile  = pm_path + ((EST_String)basename) + pm_ext;
+    spfile  = sp_path + ((EST_String)basename) + sp_ext;
+    lpc_outfile = out_path   + ((EST_String)basename) + lpc_ext;
+    res_outfile = out_path   + ((EST_String)basename) + res_ext;
     if (lpc_debug_print) cout << " loading " << pmfile << " --> output to " << res_outfile << "  " << lpc_outfile << endl;
 
     EST_Wave sp;    
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




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