[Julius-cvs 601] CVS update: julius4/libsent/src/hmminfo

アーカイブの一覧に戻る

sumom****@users***** sumom****@users*****
2011年 2月 11日 (金) 00:23:52 JST


Index: julius4/libsent/src/hmminfo/rdhmmdef.c
diff -u julius4/libsent/src/hmminfo/rdhmmdef.c:1.3 julius4/libsent/src/hmminfo/rdhmmdef.c:1.4
--- julius4/libsent/src/hmminfo/rdhmmdef.c:1.3	Mon Jul  7 14:50:11 2008
+++ julius4/libsent/src/hmminfo/rdhmmdef.c	Fri Feb 11 00:23:52 2011
@@ -30,7 +30,7 @@
  * @author Akinobu LEE
  * @date   Wed Feb 16 00:17:18 2005
  *
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
  * 
  */
 /*
@@ -47,7 +47,7 @@
 #define MAXBUFLEN  4096		///< Maximum length of a line in the input
 
 char *rdhmmdef_token;		///< Current token string (GLOBAL)
-static char *buf = NULL;	///< Local work area for token reading
+static char buf[MAXBUFLEN];	///< Local work area for token reading
 static int line;		///< Input Line count
 
 /* global functions for rdhmmdef_*.c */
@@ -79,16 +79,9 @@
 char *
 read_token(FILE *fp)
 {
-  if (buf != NULL) {
-    /* already have buffer */
-    if ((rdhmmdef_token = mystrtok_quote(NULL, HMMDEF_DELM)) != NULL) {
-      /* return next token */
-      return rdhmmdef_token;
-    }
-  } else {
-    /* init: allocate buffer for the first time */
-    buf = (char *)mymalloc(MAXBUFLEN);
-    line = 1;
+  if ((rdhmmdef_token = mystrtok_quote(NULL, HMMDEF_DELM)) != NULL) {
+    /* return next token */
+    return rdhmmdef_token;
   }
   /* read new 1 line */
   if (getl(buf, MAXBUFLEN, fp) == NULL) {
@@ -190,7 +183,13 @@
   hmm->variance_inversed = FALSE;
 
   /* read the first token */
-  read_token(fp);
+  /* read new 1 line */
+  line = 1;
+  if (getl(buf, MAXBUFLEN, fp) == NULL) {
+    rdhmmdef_token = NULL;
+  } else {
+    rdhmmdef_token = mystrtok_quote(buf, HMMDEF_DELM);
+  }
   
   /* the toplevel loop */
   while (rdhmmdef_token != NULL) {/* break on EOF */



Julius-cvs メーリングリストの案内
アーカイブの一覧に戻る