summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/3level.h41
-rw-r--r--locale/programs/charmap-dir.c5
-rw-r--r--locale/programs/charmap-dir.h5
-rw-r--r--locale/programs/charmap-kw.gperf5
-rw-r--r--locale/programs/charmap-kw.h5
-rw-r--r--locale/programs/charmap.c5
-rw-r--r--locale/programs/charmap.h5
-rw-r--r--locale/programs/config.h5
-rw-r--r--locale/programs/ld-address.c5
-rw-r--r--locale/programs/ld-collate.c275
-rw-r--r--locale/programs/ld-ctype.c15
-rw-r--r--locale/programs/ld-identification.c5
-rw-r--r--locale/programs/ld-measurement.c5
-rw-r--r--locale/programs/ld-messages.c5
-rw-r--r--locale/programs/ld-monetary.c13
-rw-r--r--locale/programs/ld-name.c5
-rw-r--r--locale/programs/ld-numeric.c5
-rw-r--r--locale/programs/ld-paper.c5
-rw-r--r--locale/programs/ld-telephone.c5
-rw-r--r--locale/programs/ld-time.c5
-rw-r--r--locale/programs/linereader.c5
-rw-r--r--locale/programs/linereader.h5
-rw-r--r--locale/programs/locale-spec.c5
-rw-r--r--locale/programs/locale.c5
-rw-r--r--locale/programs/localedef.c5
-rw-r--r--locale/programs/localedef.h5
-rw-r--r--locale/programs/locarchive.c5
-rw-r--r--locale/programs/locfile-kw.gperf5
-rw-r--r--locale/programs/locfile-kw.h5
-rw-r--r--locale/programs/locfile-token.h5
-rw-r--r--locale/programs/locfile.c5
-rw-r--r--locale/programs/locfile.h5
-rw-r--r--locale/programs/repertoire.c11
-rw-r--r--locale/programs/repertoire.h5
-rw-r--r--locale/programs/simple-hash.c5
-rw-r--r--locale/programs/simple-hash.h5
-rw-r--r--locale/programs/xmalloc.c5
-rw-r--r--locale/programs/xstrdup.c5
-rw-r--r--locale/weightwc.h4
39 files changed, 276 insertions, 248 deletions
diff --git a/locale/programs/3level.h b/locale/programs/3level.h
index 88f1b49724..cce925e1bc 100644
--- a/locale/programs/3level.h
+++ b/locale/programs/3level.h
@@ -3,8 +3,9 @@
    Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
@@ -202,42 +203,6 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
 	}
     }
 }
-
-/* GCC ATM seems to do a poor job with pointers to nested functions passed
-   to inlined functions.  Help it a little bit with this hack.  */
-#define wchead_table_iterate(tp, fn) \
-do									      \
-  {									      \
-    struct wchead_table *t = (tp);					      \
-    uint32_t index1;							      \
-    for (index1 = 0; index1 < t->level1_size; index1++)			      \
-      {									      \
-	uint32_t lookup1 = t->level1[index1];				      \
-	if (lookup1 != ((uint32_t) ~0))					      \
-	  {								      \
-	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
-	    uint32_t index2;						      \
-	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
-	      {								      \
-		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
-		if (lookup2 != ((uint32_t) ~0))				      \
-		  {							      \
-		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
-		    uint32_t index3;					      \
-		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
-		      {							      \
-			struct element_t *lookup3			      \
-			  = t->level3[index3 + lookup2_shifted];	      \
-			if (lookup3 != NULL)				      \
-			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
-			      lookup3);					      \
-		      }							      \
-		  }							      \
-	      }								      \
-	  }								      \
-      }									      \
-  } while (0)
-
 #endif
 
 #ifndef NO_FINALIZE
diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
index 07d0cdcfd0..e192eddde3 100644
--- a/locale/programs/charmap-dir.c
+++ b/locale/programs/charmap-dir.c
@@ -2,8 +2,9 @@
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/charmap-dir.h b/locale/programs/charmap-dir.h
index 256db8dc35..028f926b0a 100644
--- a/locale/programs/charmap-dir.h
+++ b/locale/programs/charmap-dir.h
@@ -2,8 +2,9 @@
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/charmap-kw.gperf b/locale/programs/charmap-kw.gperf
index 64f7452500..03fea94844 100644
--- a/locale/programs/charmap-kw.gperf
+++ b/locale/programs/charmap-kw.gperf
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper, <drepper@gnu.org>.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/charmap-kw.h b/locale/programs/charmap-kw.h
index d7d85774da..8ad6421639 100644
--- a/locale/programs/charmap-kw.h
+++ b/locale/programs/charmap-kw.h
@@ -35,8 +35,9 @@
    Contributed by Ulrich Drepper, <drepper@gnu.org>.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index dbc1101fd0..ef528217fd 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/charmap.h b/locale/programs/charmap.h
index fd711f2d11..11fddd760a 100644
--- a/locale/programs/charmap.h
+++ b/locale/programs/charmap.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/config.h b/locale/programs/config.h
index 6f9bfde903..2f66997abe 100644
--- a/locale/programs/config.h
+++ b/locale/programs/config.h
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-address.c b/locale/programs/ld-address.c
index dac8551071..6343b3c8a4 100644
--- a/locale/programs/ld-address.c
+++ b/locale/programs/ld-address.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 56f3180b10..09237ea38c 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
@@ -989,7 +990,8 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen,
 	  uint32_t wcs[2] = { wc, 0 };
 
 	  /* We have to allocate an entry.  */
-	  elem = new_element (collate, seq != NULL ? seq->bytes : NULL,
+	  elem = new_element (collate,
+			      seq != NULL ? (char *) seq->bytes : NULL,
 			      seq != NULL ? seq->nbytes : 0,
 			      wc == ILLEGAL_CHAR_VALUE ? NULL : wcs,
 			      symstr, symlen, 1);
@@ -1384,7 +1386,8 @@ order for `%.*s' already defined at %s:%Zu"),
 
 		      /* We have to allocate an entry.  */
 		      elem = new_element (collate,
-					  seq != NULL ? seq->bytes : NULL,
+					  seq != NULL
+					  ? (char *) seq->bytes : NULL,
 					  seq != NULL ? seq->nbytes : 0,
 					  wc == ILLEGAL_CHAR_VALUE
 					  ? NULL : wcs, buf, lenfrom, 1);
@@ -1935,6 +1938,137 @@ output_weightwc (struct obstack *pool, struct locale_collate_t *collate,
   return retval | ((elem->section->ruleidx & 0x7f) << 24);
 }
 
+/* If localedef is every threaded, this would need to be __thread var.  */
+static struct
+{
+  struct obstack *weightpool;
+  struct obstack *extrapool;
+  struct obstack *indpool;
+  struct locale_collate_t *collate;
+  struct collidx_table *tablewc;
+} atwc;
+
+static void add_to_tablewc (uint32_t ch, struct element_t *runp);
+
+static void
+add_to_tablewc (uint32_t ch, struct element_t *runp)
+{
+  if (runp->wcnext == NULL && runp->nwcs == 1)
+    {
+      int32_t weigthidx = output_weightwc (atwc.weightpool, atwc.collate,
+					   runp);
+      collidx_table_add (atwc.tablewc, ch, weigthidx);
+    }
+  else
+    {
+      /* As for the singlebyte table, we recognize sequences and
+	 compress them.  */
+      struct element_t *lastp;
+
+      collidx_table_add (atwc.tablewc, ch,
+			 -(obstack_object_size (atwc.extrapool)
+			 / sizeof (uint32_t)));
+
+      do
+	{
+	  /* Store the current index in the weight table.  We know that
+	     the current position in the `extrapool' is aligned on a
+	     32-bit address.  */
+	  int32_t weightidx;
+	  int added;
+
+	  /* Find out wether this is a single entry or we have more than
+	     one consecutive entry.  */
+	  if (runp->wcnext != NULL
+	      && runp->nwcs == runp->wcnext->nwcs
+	      && wmemcmp ((wchar_t *) runp->wcs,
+			  (wchar_t *)runp->wcnext->wcs,
+			  runp->nwcs - 1) == 0
+	      && (runp->wcs[runp->nwcs - 1]
+		  == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+	    {
+	      int i;
+	      struct element_t *series_startp = runp;
+	      struct element_t *curp;
+
+	      /* Now add first the initial byte sequence.  */
+	      added = (1 + 1 + 2 * (runp->nwcs - 1)) * sizeof (int32_t);
+	      if (sizeof (int32_t) == sizeof (int))
+		obstack_make_room (atwc.extrapool, added);
+
+	      /* More than one consecutive entry.  We mark this by having
+		 a negative index into the indirect table.  */
+	      obstack_int32_grow_fast (atwc.extrapool,
+				       -(obstack_object_size (atwc.indpool)
+					 / sizeof (int32_t)));
+	      obstack_int32_grow_fast (atwc.extrapool, runp->nwcs - 1);
+
+	      do
+		runp = runp->wcnext;
+	      while (runp->wcnext != NULL
+		     && runp->nwcs == runp->wcnext->nwcs
+		     && wmemcmp ((wchar_t *) runp->wcs,
+				 (wchar_t *)runp->wcnext->wcs,
+				 runp->nwcs - 1) == 0
+		     && (runp->wcs[runp->nwcs - 1]
+			 == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+
+	      /* Now walk backward from here to the beginning.  */
+	      curp = runp;
+
+	      for (i = 1; i < runp->nwcs; ++i)
+		obstack_int32_grow_fast (atwc.extrapool, curp->wcs[i]);
+
+	      /* Now find the end of the consecutive sequence and
+		 add all the indeces in the indirect pool.  */
+	      do
+		{
+		  weightidx = output_weightwc (atwc.weightpool, atwc.collate,
+					       curp);
+		  obstack_int32_grow (atwc.indpool, weightidx);
+
+		  curp = curp->wclast;
+		}
+	      while (curp != series_startp);
+
+	      /* Add the final weight.  */
+	      weightidx = output_weightwc (atwc.weightpool, atwc.collate,
+					   curp);
+	      obstack_int32_grow (atwc.indpool, weightidx);
+
+	      /* And add the end byte sequence.  Without length this
+		 time.  */
+	      for (i = 1; i < curp->nwcs; ++i)
+		obstack_int32_grow (atwc.extrapool, curp->wcs[i]);
+	    }
+	  else
+	    {
+	      /* A single entry.  Simply add the index and the length and
+		 string (except for the first character which is already
+		 tested for).  */
+	      int i;
+
+	      /* Output the weight info.  */
+	      weightidx = output_weightwc (atwc.weightpool, atwc.collate,
+					   runp);
+
+	      added = (1 + 1 + runp->nwcs - 1) * sizeof (int32_t);
+	      if (sizeof (int) == sizeof (int32_t))
+		obstack_make_room (atwc.extrapool, added);
+
+	      obstack_int32_grow_fast (atwc.extrapool, weightidx);
+	      obstack_int32_grow_fast (atwc.extrapool, runp->nwcs - 1);
+	      for (i = 1; i < runp->nwcs; ++i)
+		obstack_int32_grow_fast (atwc.extrapool, runp->wcs[i]);
+	    }
+
+	  /* Next entry.  */
+	  lastp = runp;
+	  runp = runp->wcnext;
+	}
+      while (runp != NULL);
+    }
+}
 
 void
 collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
@@ -2292,132 +2426,21 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
      with the same wide character and add them one after the other to
      the table.  In case we have more than one sequence starting with
      the same byte we have to use extra indirection.  */
-  {
-    auto void add_to_tablewc (uint32_t ch, struct element_t *runp);
+  tablewc.p = 6;
+  tablewc.q = 10;
+  collidx_table_init (&tablewc);
 
-    void add_to_tablewc (uint32_t ch, struct element_t *runp)
-      {
-	if (runp->wcnext == NULL && runp->nwcs == 1)
-	  {
-	    int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
-	    collidx_table_add (&tablewc, ch, weigthidx);
-	  }
-	else
-	  {
-	    /* As for the singlebyte table, we recognize sequences and
-	       compress them.  */
-	    struct element_t *lastp;
-
-	    collidx_table_add (&tablewc, ch,
-			       -(obstack_object_size (&extrapool) / sizeof (uint32_t)));
-
-	    do
-	      {
-		/* Store the current index in the weight table.  We know that
-		   the current position in the `extrapool' is aligned on a
-		   32-bit address.  */
-		int32_t weightidx;
-		int added;
-
-		/* Find out wether this is a single entry or we have more than
-		   one consecutive entry.  */
-		if (runp->wcnext != NULL
-		    && runp->nwcs == runp->wcnext->nwcs
-		    && wmemcmp ((wchar_t *) runp->wcs,
-				(wchar_t *)runp->wcnext->wcs,
-				runp->nwcs - 1) == 0
-		    && (runp->wcs[runp->nwcs - 1]
-			== runp->wcnext->wcs[runp->nwcs - 1] + 1))
-		  {
-		    int i;
-		    struct element_t *series_startp = runp;
-		    struct element_t *curp;
-
-		    /* Now add first the initial byte sequence.  */
-		    added = (1 + 1 + 2 * (runp->nwcs - 1)) * sizeof (int32_t);
-		    if (sizeof (int32_t) == sizeof (int))
-		      obstack_make_room (&extrapool, added);
-
-		    /* More than one consecutive entry.  We mark this by having
-		       a negative index into the indirect table.  */
-		    obstack_int32_grow_fast (&extrapool,
-					     -(obstack_object_size (&indirectpool)
-					       / sizeof (int32_t)));
-		    obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
-
-		    do
-		      runp = runp->wcnext;
-		    while (runp->wcnext != NULL
-			   && runp->nwcs == runp->wcnext->nwcs
-			   && wmemcmp ((wchar_t *) runp->wcs,
-				       (wchar_t *)runp->wcnext->wcs,
-				       runp->nwcs - 1) == 0
-			   && (runp->wcs[runp->nwcs - 1]
-			       == runp->wcnext->wcs[runp->nwcs - 1] + 1));
-
-		    /* Now walk backward from here to the beginning.  */
-		    curp = runp;
-
-		    for (i = 1; i < runp->nwcs; ++i)
-		      obstack_int32_grow_fast (&extrapool, curp->wcs[i]);
-
-		    /* Now find the end of the consecutive sequence and
-		       add all the indeces in the indirect pool.  */
-		    do
-		      {
-			weightidx = output_weightwc (&weightpool, collate,
-						     curp);
-			obstack_int32_grow (&indirectpool, weightidx);
-
-			curp = curp->wclast;
-		      }
-		    while (curp != series_startp);
-
-		    /* Add the final weight.  */
-		    weightidx = output_weightwc (&weightpool, collate, curp);
-		    obstack_int32_grow (&indirectpool, weightidx);
-
-		    /* And add the end byte sequence.  Without length this
-		       time.  */
-		    for (i = 1; i < curp->nwcs; ++i)
-		      obstack_int32_grow (&extrapool, curp->wcs[i]);
-		  }
-		else
-		  {
-		    /* A single entry.  Simply add the index and the length and
-		       string (except for the first character which is already
-		       tested for).  */
-		    int i;
-
-		    /* Output the weight info.  */
-		    weightidx = output_weightwc (&weightpool, collate, runp);
-
-		    added = (1 + 1 + runp->nwcs - 1) * sizeof (int32_t);
-		    if (sizeof (int) == sizeof (int32_t))
-		      obstack_make_room (&extrapool, added);
-
-		    obstack_int32_grow_fast (&extrapool, weightidx);
-		    obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
-		    for (i = 1; i < runp->nwcs; ++i)
-		      obstack_int32_grow_fast (&extrapool, runp->wcs[i]);
-		  }
-
-		/* Next entry.  */
-		lastp = runp;
-		runp = runp->wcnext;
-	      }
-	    while (runp != NULL);
-	  }
-      }
+  atwc.weightpool = &weightpool;
+  atwc.extrapool = &extrapool;
+  atwc.indpool = &indirectpool;
+  atwc.collate = collate;
+  atwc.tablewc = &tablewc;
 
-    tablewc.p = 6;
-    tablewc.q = 10;
-    collidx_table_init (&tablewc);
+  wchead_table_iterate (&collate->wcheads, add_to_tablewc);
 
-    wchead_table_iterate (&collate->wcheads, add_to_tablewc);
+  memset (&atwc, 0, sizeof (atwc));
 
-    collidx_table_finalize (&tablewc);
-  }
+  collidx_table_finalize (&tablewc);
 
   /* Now add the four tables.  */
   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_TABLEWC));
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 0e4b96d12f..d4474bf1a2 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
@@ -648,7 +649,8 @@ character <SP> not defined in character map")));
 	    /* Find the UCS value for `bytes'.  */
 	    int inner;
 	    uint32_t wch;
-	    struct charseq *seq = charmap_find_symbol (charmap, bytes, nbytes);
+	    struct charseq *seq
+	      = charmap_find_symbol (charmap, (char *) bytes, nbytes);
 
 	    if (seq == NULL)
 	      wch = ILLEGAL_CHAR_VALUE;
@@ -749,7 +751,7 @@ character <SP> not defined in character map")));
       for (cnt = 0; cnt < 10; ++cnt)
 	{
 	  ctype->mbdigits[cnt] = charmap_find_symbol (charmap,
-						      digits + cnt, 1);
+						      (char *) digits + cnt, 1);
 	  if (ctype->mbdigits[cnt] == NULL)
 	    {
 	      ctype->mbdigits[cnt] = charmap_find_symbol (charmap,
@@ -3469,7 +3471,8 @@ set_class_defaults (struct locale_ctype_t *ctype,
       for (cnt = ctype->outdigits_act; cnt < 10; ++cnt)
 	{
 	  ctype->mboutdigits[cnt] = charmap_find_symbol (charmap,
-							 digits + cnt, 1);
+							 (char *) digits + cnt,
+							 1);
 
 	  if (ctype->mboutdigits[cnt] == NULL)
 	    ctype->mboutdigits[cnt] = charmap_find_symbol (charmap,
@@ -4024,7 +4027,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
 		int inner;
 		uint32_t wch;
 		struct charseq *seq =
-		  charmap_find_symbol (charmap, bytes, nbytes);
+		  charmap_find_symbol (charmap, (char *) bytes, nbytes);
 
 		if (seq == NULL)
 		  wch = ILLEGAL_CHAR_VALUE;
diff --git a/locale/programs/ld-identification.c b/locale/programs/ld-identification.c
index d050f7aaa9..ae6a606888 100644
--- a/locale/programs/ld-identification.c
+++ b/locale/programs/ld-identification.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-measurement.c b/locale/programs/ld-measurement.c
index 6a9b847a1a..8abe38e135 100644
--- a/locale/programs/ld-measurement.c
+++ b/locale/programs/ld-measurement.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-messages.c b/locale/programs/ld-messages.c
index e98574f130..7e41a19e39 100644
--- a/locale/programs/ld-messages.c
+++ b/locale/programs/ld-messages.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index d493a142b5..b8d291e7fc 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -1,10 +1,12 @@
-/* Copyright (C) 1995-1999,2000,2001,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999,2000,2001,2002,2005,2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
@@ -278,13 +280,14 @@ not correspond to a valid name in ISO 4217"),
        monetary->cat = initval;						      \
     }									      \
   else if ((monetary->cat < min || monetary->cat > max)			      \
+	   && min < max							      \
 	   && !be_quiet && !nothing)					      \
     WITH_CUR_LOCALE (error (0, 0, _("\
 %s: value for field `%s' must be in range %d...%d"),			      \
 			    "LC_MONETARY", #cat, min, max))
 
-  TEST_ELEM (int_frac_digits, -128, 127, -1);
-  TEST_ELEM (frac_digits, -128, 127, -1);
+  TEST_ELEM (int_frac_digits, 1, 0, -1);
+  TEST_ELEM (frac_digits, 1, 0, -1);
   TEST_ELEM (p_cs_precedes, -1, 1, -1);
   TEST_ELEM (p_sep_by_space, -1, 2, -1);
   TEST_ELEM (n_cs_precedes, -1, 1, -1);
diff --git a/locale/programs/ld-name.c b/locale/programs/ld-name.c
index c1153fd51d..9f328828cf 100644
--- a/locale/programs/ld-name.c
+++ b/locale/programs/ld-name.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-numeric.c b/locale/programs/ld-numeric.c
index d7ffe75bee..b1a89e262b 100644
--- a/locale/programs/ld-numeric.c
+++ b/locale/programs/ld-numeric.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-paper.c b/locale/programs/ld-paper.c
index 38f9af3e60..eda94f6304 100644
--- a/locale/programs/ld-paper.c
+++ b/locale/programs/ld-paper.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-telephone.c b/locale/programs/ld-telephone.c
index 4075a14f46..108bdc79a9 100644
--- a/locale/programs/ld-telephone.c
+++ b/locale/programs/ld-telephone.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index 0d19350371..30c13533c2 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index 4b38fd283c..8a04e32276 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/linereader.h b/locale/programs/linereader.h
index d4d7e830a6..e0c844e5b2 100644
--- a/locale/programs/linereader.h
+++ b/locale/programs/linereader.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper, <drepper@gnu.org>.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locale-spec.c b/locale/programs/locale-spec.c
index 6ad3d95efe..6334f4c5ff 100644
--- a/locale/programs/locale-spec.c
+++ b/locale/programs/locale-spec.c
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index cc3082d48a..8322fc0d75 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
index 04dcf8ee0d..3e4d114fdc 100644
--- a/locale/programs/localedef.c
+++ b/locale/programs/localedef.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h
index f8cc4ca9c1..bdff9e6f28 100644
--- a/locale/programs/localedef.h
+++ b/locale/programs/localedef.h
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index c1242db164..9e316d3a0d 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locfile-kw.gperf b/locale/programs/locfile-kw.gperf
index efdb9afab9..936256ab34 100644
--- a/locale/programs/locfile-kw.gperf
+++ b/locale/programs/locfile-kw.gperf
@@ -4,8 +4,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locfile-kw.h b/locale/programs/locfile-kw.h
index 6ec2134cdd..c883842b3c 100644
--- a/locale/programs/locfile-kw.h
+++ b/locale/programs/locfile-kw.h
@@ -35,8 +35,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locfile-token.h b/locale/programs/locfile-token.h
index beb979c632..d6db1a778c 100644
--- a/locale/programs/locfile-token.h
+++ b/locale/programs/locfile-token.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
index ae8ce73ce4..17cd0209a4 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
index f6290f0ee0..6e5341f36e 100644
--- a/locale/programs/locfile.h
+++ b/locale/programs/locfile.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/repertoire.c b/locale/programs/repertoire.c
index b6c0a6ad58..cc83374c9f 100644
--- a/locale/programs/repertoire.c
+++ b/locale/programs/repertoire.c
@@ -1,10 +1,11 @@
-/* Copyright (C) 1998-2002,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002,2004,2005,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
@@ -392,7 +393,7 @@ repertoire_new_char (struct linereader *lr, hash_table *ht, hash_table *rt,
   const char *cp;
   char *buf = NULL;
   int prefix_len, len1, len2;
-  unsigned int from_nr, to_nr, cnt;
+  unsigned long int from_nr, to_nr, cnt;
 
   if (to == NULL)
     {
@@ -461,7 +462,7 @@ hexadecimal range format should use only capital characters"));
     {
       uint32_t this_value = value + (cnt - from_nr);
 
-      obstack_printf (ob, decimal_ellipsis ? "%.*s%0*d" : "%.*s%0*X",
+      obstack_printf (ob, decimal_ellipsis ? "%.*s%0*ld" : "%.*s%0*lX",
 		      prefix_len, from, len1 - prefix_len, cnt);
       obstack_1grow (ob, '\0');
 
diff --git a/locale/programs/repertoire.h b/locale/programs/repertoire.h
index 75877044ca..2e1f7ae192 100644
--- a/locale/programs/repertoire.h
+++ b/locale/programs/repertoire.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
index de8998cc7a..5bd65f2478 100644
--- a/locale/programs/simple-hash.c
+++ b/locale/programs/simple-hash.c
@@ -4,8 +4,9 @@
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, October 1994.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/simple-hash.h b/locale/programs/simple-hash.h
index 7261ebc396..b41c233b06 100644
--- a/locale/programs/simple-hash.h
+++ b/locale/programs/simple-hash.h
@@ -3,8 +3,9 @@
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/xmalloc.c b/locale/programs/xmalloc.c
index a95dc5a40f..a2eeda79b8 100644
--- a/locale/programs/xmalloc.c
+++ b/locale/programs/xmalloc.c
@@ -4,8 +4,9 @@
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/programs/xstrdup.c b/locale/programs/xstrdup.c
index 12fb3a8287..e6e302f412 100644
--- a/locale/programs/xstrdup.c
+++ b/locale/programs/xstrdup.c
@@ -3,8 +3,9 @@
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 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
diff --git a/locale/weightwc.h b/locale/weightwc.h
index 436aa7e548..9ea1126a24 100644
--- a/locale/weightwc.h
+++ b/locale/weightwc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001,2003,2004,2005,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -31,7 +31,7 @@ findidx (const wint_t **cpp)
 
   /* Oh well, more than one sequence starting with this byte.
      Search for the correct one.  */
-  const int32_t *cp = &extra[-i];
+  const int32_t *cp = (const int32_t *) &extra[-i];
   while (1)
     {
       size_t nhere;