Package: sphinx2
Severity: normal
Tags: patch

When building 'sphinx2' on amd64 with gcc-4.0,
I get the following error:

fi
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/libsphinx2/include 
-I../../include -I../../include -DFAST8B=1 -g -O2 -Wall -DAD_BACKEND_OSS -MT 
blk_cdcn_norm.lo -MD -MP -MF .deps/blk_cdcn_norm.Tpo -c blk_cdcn_norm.c  -fPIC 
-DPIC -o .libs/blk_cdcn_norm.o
blk_cdcn_norm.c: In function 'block_cdcn_norm':
blk_cdcn_norm.c:49: error: invalid storage class for function 
'block_actual_cdcn_norm'
blk_cdcn_norm.c:78: warning: implicit declaration of function 
'block_actual_cdcn_norm'
blk_cdcn_norm.c: At top level:
blk_cdcn_norm.c:102: warning: conflicting types for 'block_actual_cdcn_norm'
blk_cdcn_norm.c:102: error: static declaration of 'block_actual_cdcn_norm' 
follows non-static declaration
blk_cdcn_norm.c:78: error: previous implicit declaration of 
'block_actual_cdcn_norm' was here
make[5]: *** [blk_cdcn_norm.lo] Error 1
make[5]: Leaving directory `/sphinx2-0.5/src/libsphinx2'

With the attached patch 'sphinx2' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/sphinx2-0.5/src/libsphinx2/blk_cdcn_norm.c 
./src/libsphinx2/blk_cdcn_norm.c
--- ../tmp-orig/sphinx2-0.5/src/libsphinx2/blk_cdcn_norm.c      2004-07-16 
02:57:11.000000000 +0200
+++ ./src/libsphinx2/blk_cdcn_norm.c    2005-03-07 14:52:40.954556643 +0100
@@ -36,6 +36,8 @@
 #include <math.h>
 #include "cdcn.h"
 
+static void block_actual_cdcn_norm();
+
 /************************************************************************
  *   Dummy routine to convert from suitcase to sane varibles
  ***************************************************************************/
@@ -46,7 +48,6 @@
 {
     /* Multidimensional arrays in C suck, so we have to
        forward-declare-hack this. */
-    static void block_actual_cdcn_norm();
     float *variance, *prob, *tilt, *noise, *codebook, *corrbook;
     int    num_codes;
 
diff -urN ../tmp-orig/sphinx2-0.5/src/libsphinx2/cdcn_norm.c 
./src/libsphinx2/cdcn_norm.c
--- ../tmp-orig/sphinx2-0.5/src/libsphinx2/cdcn_norm.c  2004-07-16 
02:57:11.000000000 +0200
+++ ./src/libsphinx2/cdcn_norm.c        2005-03-07 14:53:38.791393067 +0100
@@ -36,6 +36,8 @@
 #include <math.h>
 #include "cdcn.h"
 
+static void actual_cdcn_norm();
+
 /************************************************************************
  *   Dummy routine to convert from suitcase to sane varibles
  ***************************************************************************/
@@ -44,7 +46,6 @@
                CDCN_type *cdcn_variables)
 {
     /* Multidimensional arrays, yuck. */
-    static void actual_cdcn_norm();
     float *variance, *prob, *tilt, *noise, *codebook, *corrbook;
     int num_codes;
 
diff -urN ../tmp-orig/sphinx2-0.5/src/libsphinx2/cdcn_update.c 
./src/libsphinx2/cdcn_update.c
--- ../tmp-orig/sphinx2-0.5/src/libsphinx2/cdcn_update.c        2005-03-07 
15:04:19.924642521 +0100
+++ ./src/libsphinx2/cdcn_update.c      2005-03-07 14:55:24.187049760 +0100
@@ -37,6 +37,12 @@
 #include <math.h>
 #include "cdcn.h"
 
+static float initialize (float [][NUM_COEFF+1], int, float *, float [],
+         float, float [][NUM_COEFF+1], float *, float [][NUM_COEFF+1], int);
+static void correction(float *, float *, float *, float *, int);
+static float max_q (float *, float *, float *, float *, float *,
+                       float *, int, float *, int);
+
 /*************************************************************************
  *
  * cdcn_update finds the vectors x, noise
@@ -57,12 +63,6 @@
     float      *noise, *tilt, *codebook, *prob, *variance, *corrbook;
     int        num_codes;
     /* Multidimensional arrays, gar gar gar */
-    static float initialize (float [][NUM_COEFF+1], int, float *, float [],
-         float, float [][NUM_COEFF+1], float *, float [][NUM_COEFF+1], int);
-
-    static void correction(float *, float *, float *, float *, int);
-    static float max_q (float *, float *, float *, float *, float *,
-                       float *, int, float *, int);
 
     /*
      * If error, dont bother
diff -urN ../tmp-orig/sphinx2-0.5/src/libsphinx2/linklist.c 
./src/libsphinx2/linklist.c
--- ../tmp-orig/sphinx2-0.5/src/libsphinx2/linklist.c   2004-05-18 
21:02:40.000000000 +0200
+++ ./src/libsphinx2/linklist.c 2005-03-07 15:01:20.439286506 +0100
@@ -134,7 +134,7 @@
        cpp = list[i].freelist = (void **) malloc (list[i].n_malloc * 
elem_size);
        cp = (void *) cpp;
        for (j = list[i].n_malloc-1; j > 0; --j) {
-           (char*)cp += elem_size;
+           cp = (char*)cp + elem_size;
            *cpp = cp;
            cpp = (void **)cp;
        }
diff -urN ../tmp-orig/sphinx2-0.5/src/libsphinx2/search.c 
./src/libsphinx2/search.c
--- ../tmp-orig/sphinx2-0.5/src/libsphinx2/search.c     2004-07-24 
01:36:34.000000000 +0200
+++ ./src/libsphinx2/search.c   2005-03-07 15:03:14.278313473 +0100
@@ -2459,6 +2459,9 @@
     lm_next_frame ();
 }
 
+static void compute_phone_perplexity( void );
+static search_hyp_t *fwdtree_pscr_path ( void );
+
 void
 search_finish_fwd (void)
 {
@@ -2468,7 +2471,6 @@
     CHAN_T *hmm, /* *thmm,*/ **acl;
     /* int32 bp, bestbp, bestscore; */
     /* int32 l_scr; */
-    static void compute_phone_perplexity( void );
     
     if ((CurrentFrame > 0) && (topsen_window > 1)) {
        /* Wind up remaining frames */
@@ -2529,7 +2531,6 @@
     /* Get pscr-score for fwdtree recognition */
     {
        search_hyp_t *pscrpath;
-       static search_hyp_t *fwdtree_pscr_path ( void );
        
        if (query_phone_conf ()) {
            pscrpath = fwdtree_pscr_path ();


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to