[Tux4kids-commits] r899 - in tuxmath/trunk: . intl src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Thu Feb 19 12:46:37 UTC 2009


Author: dbruce-guest
Date: 2009-02-19 12:46:36 +0000 (Thu, 19 Feb 2009)
New Revision: 899

Modified:
   tuxmath/trunk/config.h.in
   tuxmath/trunk/configure
   tuxmath/trunk/configure.ac
   tuxmath/trunk/intl/plural.c
   tuxmath/trunk/src/campaign.c
   tuxmath/trunk/src/campaign.h
   tuxmath/trunk/src/credits.c
   tuxmath/trunk/src/linewrap.c
   tuxmath/trunk/src/linewrap.h
Log:
revision of linewrapping code



Modified: tuxmath/trunk/config.h.in
===================================================================
--- tuxmath/trunk/config.h.in	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/config.h.in	2009-02-19 12:46:36 UTC (rev 899)
@@ -158,6 +158,9 @@
 /* Define to 1 if you have the <libintl.h> header file. */
 #undef HAVE_LIBINTL_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `SDL_image' library (-lSDL_image). */
 #undef HAVE_LIBSDL_IMAGE
 
@@ -185,6 +188,9 @@
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
+/* Define to 1 if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
 /* Define to 1 if you have the `memmove' function. */
 #undef HAVE_MEMMOVE
 

Modified: tuxmath/trunk/configure
===================================================================
--- tuxmath/trunk/configure	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/configure	2009-02-19 12:46:36 UTC (rev 899)
@@ -14745,6 +14745,83 @@
 
 
 
+{ echo "$as_me:$LINENO: checking for csin in -lm" >&5
+echo $ECHO_N "checking for csin in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_csin+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char csin ();
+int
+main ()
+{
+return csin ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_csin=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_csin=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_csin" >&5
+echo "${ECHO_T}$ac_cv_lib_m_csin" >&6; }
+if test $ac_cv_lib_m_csin = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Math library not found - functions in <math.h> may not be available." >&5
+echo "$as_me: error: Math library not found - functions in <math.h> may not be available." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
 ##dnl sdlpango support
 ##have_sdlpango=no
 
@@ -15558,7 +15635,8 @@
 
 
 
-for ac_header in argz.h error.h errno.h fcntl.h float.h iconv.h inttypes.h langinfo.h libgen.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h
+
+for ac_header in argz.h error.h errno.h fcntl.h float.h iconv.h inttypes.h langinfo.h libgen.h libintl.h limits.h locale.h malloc.h math.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then

Modified: tuxmath/trunk/configure.ac
===================================================================
--- tuxmath/trunk/configure.ac	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/configure.ac	2009-02-19 12:46:36 UTC (rev 899)
@@ -102,7 +102,14 @@
              [AC_MSG_WARN(SDL_Pango not found http://sdlpango.sourceforge.net/)])
 
 
+dnl Check for complex math functions
+AC_CHECK_LIB([m],
+             [csin],
+             ,
+             [AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
 
+
+
 ##dnl sdlpango support
 ##have_sdlpango=no
 
@@ -123,7 +130,7 @@
 AC_FUNC_ALLOCA
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS([argz.h error.h errno.h fcntl.h float.h iconv.h inttypes.h langinfo.h libgen.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h])
+AC_CHECK_HEADERS([argz.h error.h errno.h fcntl.h float.h iconv.h inttypes.h langinfo.h libgen.h libintl.h limits.h locale.h malloc.h math.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h])
 
 
 # --------------------------------------------------------------------------------------------

Modified: tuxmath/trunk/intl/plural.c
===================================================================
--- tuxmath/trunk/intl/plural.c	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/intl/plural.c	2009-02-19 12:46:36 UTC (rev 899)
@@ -1,24 +1,23 @@
-/* A Bison parser, made by GNU Bison 2.3a.  */
 
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
 /* Skeleton implementation for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +28,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -47,7 +46,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3a"
+#define YYBISON_VERSION "2.4.1"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -55,23 +54,30 @@
 /* Pure parsers.  */
 #define YYPURE 1
 
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
 /* Substitute the variable and function names.  */
-#define yyparse __gettextparse
-#define yylex   __gettextlex
-#define yyerror __gettexterror
-#define yylval  __gettextlval
-#define yychar  __gettextchar
-#define yydebug __gettextdebug
-#define yynerrs __gettextnerrs
+#define yyparse         __gettextparse
+#define yylex           __gettextlex
+#define yyerror         __gettexterror
+#define yylval          __gettextlval
+#define yychar          __gettextchar
+#define yydebug         __gettextdebug
+#define yynerrs         __gettextnerrs
 
 
 /* Copy the first part of user declarations.  */
-/* Line 164 of yacc.c.  */
-#line 1 "plural.y"
 
+/* Line 189 of yacc.c  */
+#line 1 "../../trunk/intl/plural.y"
+
 /* Expression parsing for plural form selection.
    Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper at cygnus.com>, 2000.
@@ -119,6 +125,9 @@
 #define YYPARSE_PARAM	arg
 
 
+/* Line 189 of yacc.c  */
+#line 130 "../../trunk/intl/plural.c"
+
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -163,28 +172,31 @@
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-{/* Line 191 of yacc.c.  */
-#line 51 "plural.y"
+{
 
+/* Line 214 of yacc.c  */
+#line 51 "../../trunk/intl/plural.y"
+
   unsigned long int num;
   enum expression_operator op;
   struct expression *exp;
-}
-/* Line 191 of yacc.c.  */
-#line 175 "plural.c"
-	YYSTYPE;
+
+
+
+/* Line 214 of yacc.c  */
+#line 188 "../../trunk/intl/plural.c"
+} YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
 
+/* Copy the second part of user declarations.  */
 
+/* Line 264 of yacc.c  */
+#line 57 "../../trunk/intl/plural.y"
 
-/* Copy the second part of user declarations.  */
-/* Line 221 of yacc.c.  */
-#line 57 "plural.y"
-
 /* Prototypes for local functions.  */
 static int yylex (YYSTYPE *lval, const char **pexp);
 static void yyerror (const char *str);
@@ -260,9 +272,10 @@
 }
 
 
-/* Line 221 of yacc.c.  */
-#line 265 "plural.c"
 
+/* Line 264 of yacc.c  */
+#line 278 "../../trunk/intl/plural.c"
+
 #ifdef short
 # undef short
 #endif
@@ -424,9 +437,9 @@
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -460,12 +473,12 @@
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
     do									\
       {									\
 	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
@@ -883,11 +896,11 @@
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 		       &(yyvsp[(yyi + 1) - (yynrhs)])
 		       		       );
-      fprintf (stderr, "\n");
+      YYFPRINTF (stderr, "\n");
     }
 }
 
@@ -1167,10 +1180,8 @@
 	break;
     }
 }
-
 
 /* Prevent warnings from -Wmissing-prototypes.  */
-
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
@@ -1189,11 +1200,10 @@
 
 
 
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
 
-/*----------.
-| yyparse.  |
-`----------*/
-
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
@@ -1216,22 +1226,46 @@
 #endif
 #endif
 {
-  /* The lookahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
 /* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
-/* Number of syntax errors so far.  */
-int yynerrs;
+    /* Number of syntax errors so far.  */
+    int yynerrs;
 
-  int yystate;
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
+
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    YYSIZE_T yystacksize;
+
   int yyn;
   int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
   /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
+  int yytoken;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
   char yymsgbuf[128];
@@ -1239,51 +1273,28 @@
   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
-
-
-
 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
 
@@ -1313,7 +1324,6 @@
 	YYSTYPE *yyvs1 = yyvs;
 	yytype_int16 *yyss1 = yyss;
 
-
 	/* Each stack pointer address is followed by the size of the
 	   data in use in that stack, in bytes.  This used to be a
 	   conditional around just the two extra args, but that might
@@ -1321,7 +1331,6 @@
 	yyoverflow (YY_("memory exhausted"),
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
-
 		    &yystacksize);
 
 	yyss = yyss1;
@@ -1344,9 +1353,8 @@
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
 	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
@@ -1357,7 +1365,6 @@
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
@@ -1468,8 +1475,9 @@
   switch (yyn)
     {
         case 2:
-/* Line 1269 of yacc.c.  */
-#line 155 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 155 "../../trunk/intl/plural.y"
     {
 	    if ((yyvsp[(1) - (1)].exp) == NULL)
 	      YYABORT;
@@ -1478,80 +1486,90 @@
     break;
 
   case 3:
-/* Line 1269 of yacc.c.  */
-#line 163 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 163 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
 	  }
     break;
 
   case 4:
-/* Line 1269 of yacc.c.  */
-#line 167 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 167 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 5:
-/* Line 1269 of yacc.c.  */
-#line 171 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 171 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 6:
-/* Line 1269 of yacc.c.  */
-#line 175 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 175 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 7:
-/* Line 1269 of yacc.c.  */
-#line 179 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 179 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 8:
-/* Line 1269 of yacc.c.  */
-#line 183 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 183 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 9:
-/* Line 1269 of yacc.c.  */
-#line 187 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 187 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
 	  }
     break;
 
   case 10:
-/* Line 1269 of yacc.c.  */
-#line 191 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 191 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
 	  }
     break;
 
   case 11:
-/* Line 1269 of yacc.c.  */
-#line 195 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 195 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = new_exp_0 (var);
 	  }
     break;
 
   case 12:
-/* Line 1269 of yacc.c.  */
-#line 199 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 199 "../../trunk/intl/plural.y"
     {
 	    if (((yyval.exp) = new_exp_0 (num)) != NULL)
 	      (yyval.exp)->val.num = (yyvsp[(1) - (1)].num);
@@ -1559,16 +1577,18 @@
     break;
 
   case 13:
-/* Line 1269 of yacc.c.  */
-#line 204 "plural.y"
+
+/* Line 1455 of yacc.c  */
+#line 204 "../../trunk/intl/plural.y"
     {
 	    (yyval.exp) = (yyvsp[(2) - (3)].exp);
 	  }
     break;
 
 
-/* Line 1269 of yacc.c.  */
-#line 1572 "plural.c"
+
+/* Line 1455 of yacc.c  */
+#line 1592 "../../trunk/intl/plural.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1579,7 +1599,6 @@
 
   *++yyvsp = yyval;
 
-
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -1742,7 +1761,7 @@
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -1779,10 +1798,11 @@
 }
 
 
-/* Line 1486 of yacc.c.  */
-#line 209 "plural.y"
 
+/* Line 1675 of yacc.c  */
+#line 209 "../../trunk/intl/plural.y"
 
+
 void
 internal_function
 FREE_EXPRESSION (struct expression *exp)

Modified: tuxmath/trunk/src/campaign.c
===================================================================
--- tuxmath/trunk/src/campaign.c	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/src/campaign.c	2009-02-19 12:46:36 UTC (rev 899)
@@ -12,7 +12,6 @@
 #include "fileops.h"
 #include "mathcards.h"
 #include "options.h"
-#include "linewrap.h"
 
 
 void briefPlayer(int stage); //show text introducing the given stage
@@ -28,7 +27,7 @@
   int i, j;
   int gameresult = 0, endcampaign = 0;
   char roundmessage[10];
-  char* endtext[2] = {N_("Congratulations! You win!"), ""};
+  char* endtext[2] = {N_("Congratulations! You win!"), " "};
   printf("Entering start_campaign()\n");
   
   

Modified: tuxmath/trunk/src/campaign.h
===================================================================
--- tuxmath/trunk/src/campaign.h	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/src/campaign.h	2009-02-19 12:46:36 UTC (rev 899)
@@ -9,6 +9,7 @@
  
 #include "SDL_extras.h"
 #include "tuxmath.h"
+#include "linewrap.h"
 
 
 //#define TESTING_CAMPAIGN //allow ESC to skip missions instead of exiting
@@ -23,61 +24,61 @@
    the space), and use "" (rather than NULL) for the termination
    string. This is a consequence of the linewrapping code.  TEH Feb
    2009. */
-static const char* briefings[NUM_STAGES][20] = {
+static const char briefings[NUM_STAGES][MAX_LINES][MAX_LINEWIDTH] = {
   //cadet
   {
-    N_("-[Esc] to skip"),
-    N_("Mission One: Careful Cadet"),
-    "--------------------------",
-    N_("I'm so glad you've come!"),
-    " ",
-    N_("The penguins need your help! Comets are falling from the sky, and are melting the penguins' igloos. To save their homes, we need you to find the secret code that will zap each comet."),
-    " ",
-    N_("Do your best!"),
-    ""
+    {N_("-[Esc] to skip")},
+    {N_("Mission One: Careful Cadet")},
+    {"--------------------------"},
+    {N_("I'm so glad you've come!")},
+    {" "},
+    {N_("The penguins need your help! Comets are falling from the sky, and are melting the penguins' igloos. To save their homes, we need you to find the secret code that will zap each comet.")},
+    {" "},
+    {N_("Do your best!")},
+    {""}
   },
   //scout
   {
-    "-[Esc] to skip",
-    N_("Mission Two: Smart Scout"),
-    "------------------------",
-    N_("Great job! Since you saved the penguins' homes, we are promoting you to Scout. Scouts are good for keeping an eye out for trouble..."),
-    " ",
-    N_("...like what's happening right now! The TakeAways have come, and they're sending new, trickier comets against the penguins!"),
-    N_("But you can save them!"),
-    ""
+    {"-[Esc] to skip"},
+    {N_("Mission Two: Smart Scout")},
+    {"------------------------"},
+    {N_("Great job! Since you saved the penguins' homes, we are promoting you to Scout. Scouts are good for keeping an eye out for trouble...")},
+    {" "},
+    {N_("...like what's happening right now! The TakeAways have come, and they're sending new, trickier comets against the penguins!")},
+    {N_("But you can save them!")},
+    {""}
   },
   //ranger
   {
-    "-[Esc] to skip",
-    N_("Mission Three: Royal Ranger"),
-    "---------------------------",
-    N_("You've done it again! The Penguin Emperor has chosen you to join his team of Rangers that help protect the city.  We're sending you there now..."),
-    " ",
-    N_("...oh no! Now the Emperor himself is under attack, from new types of comets: these problems are multiplying! To fight these, you need great skill. We think you can do it. Join the Rangers and help save the city!"),
-    ""
+    {"-[Esc] to skip"},
+    {N_("Mission Three: Royal Ranger")},
+    {"---------------------------"},
+    {N_("You've done it again! The Penguin Emperor has chosen you to join his team of Rangers that help protect the city.  We're sending you there now...")},
+    {" "},
+    {N_("...oh no! Now the Emperor himself is under attack, from new types of comets: these problems are multiplying! To fight these, you need great skill. We think you can do it. Join the Rangers and help save the city!")},
+    {""}
   },
   //ace
   {
-    "-[Esc] to skip",
-    N_("Mission Four: Imperial Ace"),
-    "--------------------------",
-    N_("You did it! The Emperor wants to thank you in person. We are taking you to his ice palace for a great honor: you will become the Imperial Ace!"),
-    " ",
-    N_("But right in the middle of the ceremony, a new attack from the land of Division starts!"),
-    N_("Now is no time for resting; the city needs your help!"),
-    ""
+    {"-[Esc] to skip"},
+    {N_("Mission Four: Imperial Ace")},
+    {"--------------------------"},
+    {N_("You did it! The Emperor wants to thank you in person. We are taking you to his ice palace for a great honor: you will become the Imperial Ace!")},
+    {" "},
+    {N_("But right in the middle of the ceremony, a new attack from the land of Division starts!")},
+    {N_("Now is no time for resting; the city needs your help!")},
+    {""}
   },
   //commando
   {
-    "-[Esc] to skip",
-    N_("Final Mission: Computing Commando"),
-    "---------------------------------",
-    N_("Penguin scientists have learned that all these attacks are coming from a secret base, and they need you to go fight the final battle. They also give you this clue: first do multiplication and division, and then do addition and subtraction."),
-    N_("I hope that hint helps!"),
-    " ",
-    N_("This is it! You can stop these attacks forever, Commando!"),
-    ""
+    {"-[Esc] to skip"},
+    {N_("Final Mission: Computing Commando")},
+    {"---------------------------------"},
+    {N_("Penguin scientists have learned that all these attacks are coming from a secret base, and they need you to go fight the final battle. They also give you this clue: first do multiplication and division, and then do addition and subtraction.")},
+    {N_("I hope that hint helps!")},
+    {" "},
+    {N_("This is it! You can stop these attacks forever, Commando!")},
+    {""}
   },
 };
 

Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/src/credits.c	2009-02-19 12:46:36 UTC (rev 899)
@@ -33,71 +33,71 @@
 
 char credit_text[MAX_LINES][MAX_LINEWIDTH] = {
   {"-TUX, OF MATH COMMAND"},  /* '-' at beginning makes highlighted: */
-  {"COPYRIGHT 2001-2009 "},
-  {"  "},
-  {"PART OF THE 'TUX4KIDS' PROJECT "},
-  {"  "},
-  {"-DESIGNED BY "},
-  {"SAM 'CRISWELL' HART "},
-  {"  "},
-  {"-LEAD PROGRAMMERS "},
-  {"BILL KENDRICK, "},
-  {"NEW BREED SOFTWARE "},
-  {"DAVID BRUCE "},
-  {"TIM HOLY "},
-  {"  "},
-  {"-ADDITIONAL CODE "},
-  {"GLEN DITCHFIELD "},
-  {"MICHAEL BEHRISCH "},
-  {"DONNY VISZNEKI "},
-  {"YVES COMBE "},
-  {"DAVID YODER "},
-  {"KARL OVE HUFTHAMMER "},
-  {"AHMED SAYED "},
-  {"BRENDAN LUCHEN "},
-  {"JESUS M. MAGER H. "},
-  {"  "},
-  {"-LEAD ARTIST "},
-  {"SAM HART "},
+  {"COPYRIGHT 2001-2009"},
   {" "},
-  {"-ADDITIONAL ART "},
-  {"BILL KENDRICK "},
-  {"KENDRA SWANSON & LINNEA HOLY "},
-  {"  "},
-  {"-SOUND EFFECTS "},
-  {"TBA "},
-  {"  "},
-  {"-MUSIC "},
-  {"BEYOND THE HORIZON "},
-  {"BY MYSTRA OF STONE ARTS, 1994 "},
-  {"  "},
-  {"CCCP MAIN "},
-  {"BY GROO OF CNCD, 1994 "},
-  {"  "},
-  {"SOFT BRILLIANCE "},
-  {"TJOPPBASS, 1994 "},
-  {"  "},
-  {"-PACKAGERS "},
-  {"JESSE ANDREWS "},
-  {"HOLGER LEVSEN "},
-  {"  "},
-  {"-'TUX' THE PENGUIN CREATED BY "},
-  {"LARRY EWING "},
-  {"  "},
-  {"-TESTERS "},
-  {"PETE SALZMAN "},
-  {"ST. CATHERINE ELEM., CINCINNATI, OH "},
-  {"WESTWOOD ELEMENTARY, CINCINNATI, OH "},
-  {"LAURA BRUCE "},
-  {"ROOSEVELT ELEMENTARY, TAMPA, FL "},
-  {"KENDRA SWANSON AND LINNEA HOLY "},
-  {"OLD BONHOMME ELEMENTARY, "},
-  {"ST. LOUIS, MO "},
-  {"STEPHANIE CHAPIE & HOWARD NATHANSON "},
-  {"  "},
-  {"  "},
-  {"-WEBSITE "},
-  {"WWW.TUX4KIDS.COM "},
+  {"PART OF THE 'TUX4KIDS' PROJECT"},
+  {" "},
+  {"-DESIGNED BY"},
+  {"SAM 'CRISWELL' HART"},
+  {" "},
+  {"-LEAD PROGRAMMERS"},
+  {"BILL KENDRICK,"},
+  {"NEW BREED SOFTWARE"},
+  {"DAVID BRUCE"},
+  {"TIM HOLY"},
+  {" "},
+  {"-ADDITIONAL CODE"},
+  {"GLEN DITCHFIELD"},
+  {"MICHAEL BEHRISCH"},
+  {"DONNY VISZNEKI"},
+  {"YVES COMBE"},
+  {"DAVID YODER"},
+  {"KARL OVE HUFTHAMMER"},
+  {"AHMED SAYED"},
+  {"BRENDAN LUCHEN"},
+  {"JESUS M. MAGER H."},
+  {" "},
+  {"-LEAD ARTIST"},
+  {"SAM HART"},
+  {" "},
+  {"-ADDITIONAL ART"},
+  {"BILL KENDRICK"},
+  {"KENDRA SWANSON & LINNEA HOLY"},
+  {" "},
+  {"-SOUND EFFECTS"},
+  {"TBA"},
+  {" "},
+  {"-MUSIC"},
+  {"BEYOND THE HORIZON"},
+  {"BY MYSTRA OF STONE ARTS, 1994"},
+  {" "},
+  {"CCCP MAIN"},
+  {"BY GROO OF CNCD, 1994"},
+  {" "},
+  {"SOFT BRILLIANCE"},
+  {"TJOPPBASS, 1994"},
+  {" "},
+  {"-PACKAGERS"},
+  {"JESSE ANDREWS"},
+  {"HOLGER LEVSEN"},
+  {" "},
+  {"-'TUX' THE PENGUIN CREATED BY"},
+  {"LARRY EWING"},
+  {" "},
+  {"-TESTERS"},
+  {"PETE SALZMAN"},
+  {"ST. CATHERINE ELEM., CINCINNATI, OH"},
+  {"WESTWOOD ELEMENTARY, CINCINNATI, OH"},
+  {"LAURA BRUCE"},
+  {"ROOSEVELT ELEMENTARY, TAMPA, FL"},
+  {"KENDRA SWANSON AND LINNEA HOLY"},
+  {"OLD BONHOMME ELEMENTARY,"},
+  {"ST. LOUIS, MO"},
+  {"STEPHANIE CHAPIE & HOWARD NATHANSON"},
+  {" "},
+  {" "},
+  {"-WEBSITE"},
+  {"WWW.TUX4KIDS.COM"},
   {NULL}
 };
 

Modified: tuxmath/trunk/src/linewrap.c
===================================================================
--- tuxmath/trunk/src/linewrap.c	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/src/linewrap.c	2009-02-19 12:46:36 UTC (rev 899)
@@ -60,7 +60,8 @@
   listIndex = 0;
   for (strIndex = 0, i = 0; i < length; strIndex++, i++)
   {
-    if (breaks[i] == UC_BREAK_POSSIBLE || breaks[i] == UC_BREAK_MANDATORY)
+    if (breaks[i] == UC_BREAK_POSSIBLE
+     || breaks[i] == UC_BREAK_MANDATORY)
     {
       str_list[listIndex][strIndex] = '\0';  // terminate the previous string
       strIndex = 0;                          // start the next line
@@ -82,7 +83,8 @@
     return max_lines;
 }
 
-void linewrap_list(const char *input[], char str_list[MAX_LINES][MAX_LINEWIDTH],
+void linewrap_list(const char input[MAX_LINES][MAX_LINEWIDTH],
+                   char str_list[MAX_LINES][MAX_LINEWIDTH],
                    int width, int max_lines, int max_width)
 {
   int inputIndex;
@@ -91,25 +93,37 @@
   int n_lines;
 
   outputIndex = 0;
-  for (inputIndex = 0; strlen(input[inputIndex]) > 0 && outputIndex < max_lines-1; inputIndex++) {
-    printf("inputIndex = %d, outputIndex = %d, String: %s\n",inputIndex,outputIndex,input[inputIndex]);
+  for (inputIndex = 0; strlen(input[inputIndex]) > 0 && outputIndex < max_lines-1; inputIndex++)
+  {
+    printf("inputIndex = %d, outputIndex = %d, String: %s\n",
+           inputIndex, outputIndex, input[inputIndex]);
+
     /* Handle blank strings */
-    if (strcmp(input[inputIndex], " ") == 0) {
+    if (strcmp(input[inputIndex], " ") == 0)
+    {
       strcpy(str_list[outputIndex++]," ");
       printf("Blank (%d)\n",inputIndex);
       continue;
     }
+
     /* Handle real strings */
     printf("Not blank. Translated: %s\n",gettext(input[inputIndex]));
-    n_lines = linewrap(gettext(input[inputIndex]), wrapped_lines0, width,max_lines, max_width);
+    n_lines = linewrap(gettext(input[inputIndex]), wrapped_lines0, width, max_lines, max_width);
     printf("Wrapped to %d lines.\n", n_lines);
-    for (intermedIndex = 0; intermedIndex < n_lines && outputIndex < max_lines-1; intermedIndex++, outputIndex++) {
+
+    for (intermedIndex = 0;
+         intermedIndex < n_lines && outputIndex < max_lines-1;
+         intermedIndex++, outputIndex++)
+    {
       printf("intermedIndex %d, outputIndex %d, string %s\n",intermedIndex,outputIndex, wrapped_lines0[intermedIndex]);
       strncpy(str_list[outputIndex], wrapped_lines0[intermedIndex], max_width);
     }
   }
+
   printf("All done (outputIndex = %d)\n",outputIndex);
-  for (; outputIndex < max_lines; outputIndex++) {
+
+  for (; outputIndex < max_lines; outputIndex++)
+  {
     //printf("  blanking %d\n", outputIndex);
     str_list[outputIndex][0] = '\0';
   }

Modified: tuxmath/trunk/src/linewrap.h
===================================================================
--- tuxmath/trunk/src/linewrap.h	2009-02-18 21:29:42 UTC (rev 898)
+++ tuxmath/trunk/src/linewrap.h	2009-02-19 12:46:36 UTC (rev 899)
@@ -4,7 +4,8 @@
 
 /* Storage for linewrapping */
 #define MAX_LINES 128
-#define MAX_LINEWIDTH 40
+#define MAX_LINEWIDTH 256
+
 extern char wrapped_lines[MAX_LINES][MAX_LINEWIDTH];
 
 /* linewrap takes an input string (can be in essentially arbitrary
@@ -23,13 +24,11 @@
    On output, linewrap returns the number of lines used to format the
    string.
 */
-extern int linewrap(const char *input, char str_list[MAX_LINES][MAX_LINEWIDTH], int width, int max_lines, int max_width);
+extern int linewrap(const char* input, char str_list[MAX_LINES][MAX_LINEWIDTH], int width, int max_lines, int max_width);
 
 /* This takes a NULL-terminated array of strings and performs
    translation and linewrapping, outputting another NULL-terminated
    array. */
-extern void linewrap_list(const char *input[], char str_list[MAX_LINES][MAX_LINEWIDTH], int width, int max_lines, int max_width);
+extern void linewrap_list(const char input[MAX_LINES][MAX_LINEWIDTH], char str_list[MAX_LINES][MAX_LINEWIDTH], int width, int max_lines, int max_width);
 
-
-
 #endif




More information about the Tux4kids-commits mailing list