OSDN Git Service

* config/mips/t-elf (EXTRA_PARTS): Use EXTRA_MULTILIB_PARTS instead.
[pf3gnuchains/gcc-fork.git] / gcc / mbchar.c
index 0f1794a..5c86dbf 100644 (file)
@@ -1,22 +1,22 @@
 /* Multibyte Character Functions.
    Copyright (C) 1998 Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC 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.
+GCC 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.
 
-GNU CC 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.
+GCC 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 GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
 
 /* Note regarding cross compilation:
 
@@ -29,8 +29,8 @@ Boston, MA 02111-1307, USA.  */
    leaves the source character values unchanged (except for removing the
    state shifting markers).  */
 
-#ifdef MULTIBYTE_CHARS
 #include "config.h"
+#ifdef MULTIBYTE_CHARS
 #include "system.h"
 #include "mbchar.h"
 #include <locale.h>
@@ -80,7 +80,7 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = {
 };
 
 
-char *literal_codeset = NULL;
+const char *literal_codeset = NULL;
 
 /* Store into *PWC (if PWC is not null) the wide character
    corresponding to the multibyte character at the start of the
@@ -94,12 +94,12 @@ char *literal_codeset = NULL;
 int
 local_mbtowc (pwc, s, n)
      wchar_t *pwc;
-     char *s;
+     const char *s;
      size_t n;
 {
   static JIS_STATE save_state = ASCII;
   JIS_STATE curr_state = save_state;
-  unsigned char *t = (unsigned char *) s;
+  const unsigned char *t = (const unsigned char *) s;
 
   if (s != NULL && n == 0)
     return -1;
@@ -178,13 +178,13 @@ local_mbtowc (pwc, s, n)
     {
       JIS_ACTION action;
       JIS_CHAR_TYPE ch;
-      unsigned char *ptr;
-      int i, curr_ch;
+      const unsigned char *ptr;
+      size_t i, curr_ch;
  
       if (s == NULL)
        {
          save_state = ASCII;
-         /* State-dependent. */
+         /* State-dependent.  */
          return 1;
        }
 
@@ -260,7 +260,7 @@ local_mbtowc (pwc, s, n)
 
             case MAKE_A:
             case MAKE_J:
-              ptr = (char *) (t + i + 1);
+              ptr = (const unsigned char *) (t + i + 1);
               break;
 
             case ERROR:
@@ -283,7 +283,7 @@ local_mbtowc (pwc, s, n)
   return 1;
 #else
 
-  /* This must be the "C" locale or unknown locale. */
+  /* This must be the "C" locale or unknown locale.  */
   return mbtowc (pwc, s, n);
 #endif
 }
@@ -297,7 +297,7 @@ local_mbtowc (pwc, s, n)
 
 int
 local_mblen (s, n)
-     char *s;
+     const char *s;
      size_t n;
 {
   return local_mbtowc (NULL, s, n);
@@ -329,4 +329,6 @@ local_mb_cur_max ()
   return 1; /* default */
 #endif
 }
+#else  /* MULTIBYTE_CHARS */
+extern int dummy;  /* silence 'ANSI C forbids an empty source file' warning */
 #endif /* MULTIBYTE_CHARS */