Unconstify members of the lconv structure to make it conform to the C89 and
authorHasso Tepper <hasso@dragonflybsd.org>
Thu, 20 Sep 2007 07:40:51 +0000 (07:40 +0000)
committerHasso Tepper <hasso@dragonflybsd.org>
Thu, 20 Sep 2007 07:40:51 +0000 (07:40 +0000)
C99 standards. Note that documentation doesn't need a correction, it's
already correct.

include/locale.h
lib/libc/locale/localeconv.c
usr.bin/locale/locale.c

index 17a999a..b116a2d 100644 (file)
@@ -1,5 +1,5 @@
 /*     $NetBSD: src/include/locale.h,v 1.13 2003/08/07 09:44:10 agc Exp $      */
-/*     $DragonFly: src/include/locale.h,v 1.3 2005/04/21 16:36:34 joerg Exp $ */
+/*     $DragonFly: src/include/locale.h,v 1.4 2007/09/20 07:40:51 hasso Exp $ */
 
 /*
  * Copyright (c) 1991, 1993
 #define _LOCALE_H_
 
 struct lconv {
-       const char      *decimal_point;
-       const char      *thousands_sep;
-       const char      *grouping;
-       const char      *int_curr_symbol;
-       const char      *currency_symbol;
-       const char      *mon_decimal_point;
-       const char      *mon_thousands_sep;
-       const char      *mon_grouping;
-       const char      *positive_sign;
-       const char      *negative_sign;
+       char    *decimal_point;
+       char    *thousands_sep;
+       char    *grouping;
+       char    *int_curr_symbol;
+       char    *currency_symbol;
+       char    *mon_decimal_point;
+       char    *mon_thousands_sep;
+       char    *mon_grouping;
+       char    *positive_sign;
+       char    *negative_sign;
        char    int_frac_digits;
        char    frac_digits;
        char    p_cs_precedes;
index 0f23493..ebbf093 100644 (file)
@@ -1,5 +1,5 @@
 /*     $NetBSD: src/lib/libc/locale/localeconv.c,v 1.12 2004/01/02 21:53:49 itojun Exp $       */
-/*     $DragonFly: src/lib/libc/locale/localeconv.c,v 1.3 2005/04/21 16:36:34 joerg Exp $ */
+/*     $DragonFly: src/lib/libc/locale/localeconv.c,v 1.4 2007/09/20 07:40:51 hasso Exp $ */
 
 /*
  * Written by J.T. Conklin <jtc@NetBSD.org>.
@@ -31,15 +31,20 @@ localeconv(void)
 
        if (__mlocale_changed) {
                /* LC_MONETARY */
-               ret.int_curr_symbol = _CurrentMonetaryLocale->int_curr_symbol;
-               ret.currency_symbol = _CurrentMonetaryLocale->currency_symbol;
+               ret.int_curr_symbol =
+                   (char *)_CurrentMonetaryLocale->int_curr_symbol;
+               ret.currency_symbol =
+                   (char *)_CurrentMonetaryLocale->currency_symbol;
                ret.mon_decimal_point =
-                   _CurrentMonetaryLocale->mon_decimal_point;
+                   (char *)_CurrentMonetaryLocale->mon_decimal_point;
                ret.mon_thousands_sep =
-                   _CurrentMonetaryLocale->mon_thousands_sep;
-               ret.mon_grouping = _CurrentMonetaryLocale->mon_grouping;
-               ret.positive_sign = _CurrentMonetaryLocale->positive_sign;
-               ret.negative_sign = _CurrentMonetaryLocale->negative_sign;
+                   (char *)_CurrentMonetaryLocale->mon_thousands_sep;
+               ret.mon_grouping =
+                   (char *)_CurrentMonetaryLocale->mon_grouping;
+               ret.positive_sign = 
+                   (char *)_CurrentMonetaryLocale->positive_sign;
+               ret.negative_sign =
+                   (char *)_CurrentMonetaryLocale->negative_sign;
                ret.int_frac_digits = _CurrentMonetaryLocale->int_frac_digits;
                ret.frac_digits = _CurrentMonetaryLocale->frac_digits;
                ret.p_cs_precedes = _CurrentMonetaryLocale->p_cs_precedes;
@@ -63,14 +68,12 @@ localeconv(void)
 
        if (__nlocale_changed) {
                /* LC_NUMERIC */
-               /* LINTED const castaway */
                ret.decimal_point =
                    (char *)_CurrentNumericLocale->decimal_point;
-               /* LINTED const castaway */
                ret.thousands_sep =
                    (char *)_CurrentNumericLocale->thousands_sep;
-               /* LINTED const castaway */
-               ret.grouping = (char *) _CurrentNumericLocale->grouping;
+               ret.grouping =
+                   (char *)_CurrentNumericLocale->grouping;
                __nlocale_changed = 0;
        }
 
index 292250e..bb5b540 100644 (file)
@@ -25,7 +25,7 @@
  *
  * FreeBSD: src/usr.bin/locale/locale.c,v 1.10 2003/06/26 11:05:56 phantom Exp
  * $NetBSD: locale.c,v 1.5 2006/02/16 19:19:49 tnozaki Exp $
- * $DragonFly: src/usr.bin/locale/locale.c,v 1.1 2006/07/01 10:47:39 eirikn Exp $
+ * $DragonFly: src/usr.bin/locale/locale.c,v 1.2 2007/09/20 07:40:51 hasso Exp $
  */
 
 /*
@@ -56,8 +56,8 @@ void  init_locales_list(void);
 void   list_charmaps(void);
 void   list_locales(void);
 const char *lookup_localecat(int);
-const char *kwval_lconv(int);
-int    kwval_lookup(char *, const char **, int *, int *);
+char   *kwval_lconv(int);
+int    kwval_lookup(char *, char **, int *, int *);
 void   showdetails(char *);
 void   showkeywordslist(void);
 void   showlocale(void);
@@ -473,11 +473,11 @@ showlocale(void)
 /*
  * keyword value lookup helper (via localeconv())
  */
-const char *
+char *
 kwval_lconv(int id)
 {
        struct lconv *lc;
-       const char *rval;
+       char *rval;
 
        rval = NULL;
        lc = localeconv();
@@ -558,7 +558,7 @@ kwval_lconv(int id)
  * keyword value and properties lookup
  */
 int
-kwval_lookup(char *kwname, const char **kwval, int *cat, int *isstr)
+kwval_lookup(char *kwname, char **kwval, int *cat, int *isstr)
 {
        int     rval;
        size_t  i;
@@ -589,7 +589,7 @@ void
 showdetails(char *kw)
 {
        int     isstr, cat, tmpval;
-       const char      *kwval;
+       char    *kwval;
 
        if (kwval_lookup(kw, &kwval, &cat, &isstr) == 0) {
                /*