Author: bapt
Date: Sat Nov  7 20:29:23 2015
New Revision: 290511
URL: https://svnweb.freebsd.org/changeset/base/290511

Log:
  Use const where needed instead of using pragmas to work around the warnings

Modified:
  head/usr.bin/localedef/charmap.c
  head/usr.bin/localedef/localedef.h

Modified: head/usr.bin/localedef/charmap.c
==============================================================================
--- head/usr.bin/localedef/charmap.c    Sat Nov  7 20:27:31 2015        
(r290510)
+++ head/usr.bin/localedef/charmap.c    Sat Nov  7 20:29:23 2015        
(r290511)
@@ -68,11 +68,8 @@ RB_GENERATE_STATIC(cmap_wc, charmap, rb_
  * Array of POSIX specific portable characters.
  */
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
-
 static const struct {
-       char    *name;
+       const char *name;
        int     ch;
 } portable_chars[] = {
        { "NUL",                '\0' },
@@ -189,8 +186,6 @@ static const struct {
        { NULL, 0 }
 };
 
-#pragma GCC diagnostic pop
-
 static int
 cmap_compare_sym(const void *n1, const void *n2)
 {
@@ -220,7 +215,7 @@ init_charmap(void)
 }
 
 static void
-add_charmap_impl(char *sym, wchar_t wc, int nodups)
+add_charmap_impl(const char *sym, wchar_t wc, int nodups)
 {
        charmap_t       srch;
        charmap_t       *n = NULL;
@@ -260,7 +255,7 @@ add_charmap_impl(char *sym, wchar_t wc, 
 }
 
 void
-add_charmap(char *sym, int c)
+add_charmap(const char *sym, int c)
 {
        add_charmap_impl(sym, c, 1);
 }
@@ -322,7 +317,7 @@ add_charmap_range(char *s, char *e, int 
 }
 
 void
-add_charmap_char(char *name, int val)
+add_charmap_char(const char *name, int val)
 {
        add_charmap_impl(name, val, 0);
 }

Modified: head/usr.bin/localedef/localedef.h
==============================================================================
--- head/usr.bin/localedef/localedef.h  Sat Nov  7 20:27:31 2015        
(r290510)
+++ head/usr.bin/localedef/localedef.h  Sat Nov  7 20:29:23 2015        
(r290511)
@@ -76,11 +76,11 @@ wchar_t *get_wcs(void);
 
 /* charmap.c - CHARMAP handling */
 void init_charmap(void);
-void add_charmap(char *, int);
+void add_charmap(const char *, int);
 void add_charmap_undefined(char *);
 void add_charmap_posix(void);
 void add_charmap_range(char *, char *, int);
-void add_charmap_char(char *name, int val);
+void add_charmap_char(const char *name, int val);
 int lookup_charmap(const char *, wchar_t *);
 int check_charmap_undefined(char *);
 int check_charmap(wchar_t);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to