[Tux4kids-commits] r884 - tuxmath/trunk/src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Sat Feb 14 22:40:21 UTC 2009


Author: dbruce-guest
Date: 2009-02-14 22:40:20 +0000 (Sat, 14 Feb 2009)
New Revision: 884

Removed:
   tuxmath/trunk/src/u16-mbtouc-aux.c~
   tuxmath/trunk/src/u16-mbtouc.c~
Modified:
   tuxmath/trunk/src/convert_utf.c
Log:
utf conversion cleanup



Modified: tuxmath/trunk/src/convert_utf.c
===================================================================
--- tuxmath/trunk/src/convert_utf.c	2009-02-13 19:56:31 UTC (rev 883)
+++ tuxmath/trunk/src/convert_utf.c	2009-02-14 22:40:20 UTC (rev 884)
@@ -59,8 +59,8 @@
 
   /* NOTE casts to prevent compiler warnings */
   bytes_converted = iconv(conv_descr,
-                          (const char**)&UTF8_word, &in_length,
-                          (char **)&wchar_start, &out_length);
+                          (char**)&UTF8_word, &in_length,
+                          (char**)&wchar_start, &out_length);
   iconv_close(conv_descr);
   wcsncpy(wide_word, temp_wchar, max_length);
 
@@ -108,10 +108,11 @@
   conv_descr = iconv_open("UTF-8", "wchar_t");
 #endif
 
-  /* NOTE casts to prevent compiler warnings */
+  /* NOTE casts to prevent compiler warnings. While the documentation for iconv() */
+  /* says arg 2 is a "const char**", it is "char**" in the iconv.h header itself. */
   bytes_converted = iconv(conv_descr,
-                          (const char**)&wide_word, &in_length,
-                          &UTF8_Start, &out_length);
+                          (char**)&wide_word, &in_length,
+                          (char**)&UTF8_Start, &out_length);
   iconv_close(conv_descr);
   strncpy(UTF8_word, temp_UTF8, max_length);
 

Deleted: tuxmath/trunk/src/u16-mbtouc-aux.c~
===================================================================
--- tuxmath/trunk/src/u16-mbtouc-aux.c~	2009-02-13 19:56:31 UTC (rev 883)
+++ tuxmath/trunk/src/u16-mbtouc-aux.c~	2009-02-14 22:40:20 UTC (rev 884)
@@ -1,51 +0,0 @@
-/* Conversion UTF-16 to UCS-4.
-   Copyright (C) 2001-2002, 2006-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno at clisp.org>, 2001.
-
-   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 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "../unistr.h"
-
-#if HAVE_INLINE
-
-int
-u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n)
-{
-  uint16_t c = *s;
-
-  if (c < 0xdc00)
-    {
-      if (n >= 2)
-	{
-	  if (s[1] >= 0xdc00 && s[1] < 0xe000)
-	    {
-	      *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
-	      return 2;
-	    }
-	  /* invalid multibyte character */
-	}
-      else
-	{
-	  /* incomplete multibyte character */
-	}
-    }
-  /* invalid multibyte character */
-  *puc = 0xfffd;
-  return 1;
-}
-
-#endif

Deleted: tuxmath/trunk/src/u16-mbtouc.c~
===================================================================
--- tuxmath/trunk/src/u16-mbtouc.c~	2009-02-13 19:56:31 UTC (rev 883)
+++ tuxmath/trunk/src/u16-mbtouc.c~	2009-02-14 22:40:20 UTC (rev 884)
@@ -1,56 +0,0 @@
-/* Look at first character in UTF-16 string.
-   Copyright (C) 1999-2002, 2006-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno at clisp.org>, 2001.
-
-   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 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "../unistr.h"
-
-#if !HAVE_INLINE
-
-int
-u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
-{
-  uint16_t c = *s;
-
-  if (c < 0xd800 || c >= 0xe000)
-    {
-      *puc = c;
-      return 1;
-    }
-  if (c < 0xdc00)
-    {
-      if (n >= 2)
-	{
-	  if (s[1] >= 0xdc00 && s[1] < 0xe000)
-	    {
-	      *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
-	      return 2;
-	    }
-	  /* invalid multibyte character */
-	}
-      else
-	{
-	  /* incomplete multibyte character */
-	}
-    }
-  /* invalid multibyte character */
-  *puc = 0xfffd;
-  return 1;
-}
-
-#endif




More information about the Tux4kids-commits mailing list