From 10eb212c1d1d1386cb2d7c57f34565802da19a74 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 21 Jun 2007 11:22:13 +0200 Subject: [PATCH] licharset: added const qualifiers --- charset/charconv.h | 2 +- charset/mp-charconv.c | 2 +- charset/mp-charconv.h | 6 +++--- charset/setnames.c | 6 +++--- charset/stk-charconv.c | 2 +- charset/stk-charconv.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/charset/charconv.h b/charset/charconv.h index ed775b13..78b3ac73 100644 --- a/charset/charconv.h +++ b/charset/charconv.h @@ -78,7 +78,7 @@ unsigned int conv_x_count(void); /* Charset names */ -int find_charset_by_name(char *); +int find_charset_by_name(const char *); char *charset_name(int); #endif diff --git a/charset/mp-charconv.c b/charset/mp-charconv.c index ef0adf95..7c18d40f 100644 --- a/charset/mp-charconv.c +++ b/charset/mp-charconv.c @@ -13,7 +13,7 @@ #include byte * -mp_strconv(struct mempool *mp, byte *s, uns in_cs, uns out_cs) +mp_strconv(struct mempool *mp, const byte *s, uns in_cs, uns out_cs) { if (in_cs == out_cs) return mp_strdup(mp, s); diff --git a/charset/mp-charconv.h b/charset/mp-charconv.h index f33cd373..ab6f65d9 100644 --- a/charset/mp-charconv.h +++ b/charset/mp-charconv.h @@ -13,14 +13,14 @@ #include "lib/mempool.h" #include "charset/charconv.h" -byte *mp_strconv(struct mempool *mp, byte *s, uns cs_in, uns cs_out); +byte *mp_strconv(struct mempool *mp, const byte *s, uns cs_in, uns cs_out); static inline byte * -mp_strconv_to_utf8(struct mempool *mp, byte *s, uns cs_in) +mp_strconv_to_utf8(struct mempool *mp, const byte *s, uns cs_in) { return mp_strconv(mp, s, cs_in, CONV_CHARSET_UTF8); } static inline byte * -mp_strconv_from_utf8(struct mempool *mp, byte *s, uns cs_out) +mp_strconv_from_utf8(struct mempool *mp, const byte *s, uns cs_out) { return mp_strconv(mp, s, CONV_CHARSET_UTF8, cs_out); } #endif diff --git a/charset/setnames.c b/charset/setnames.c index 02dd6a3c..94c7d17e 100644 --- a/charset/setnames.c +++ b/charset/setnames.c @@ -14,7 +14,7 @@ /* Names according to RFC 1345 (see http://www.iana.org/assignments/character-sets) */ -static char *cs_names[] = { +static const char *cs_names[] = { "US-ASCII", "ISO-8859-1", "ISO-8859-2", @@ -43,7 +43,7 @@ static char *cs_names[] = { }; int -find_charset_by_name(char *c) +find_charset_by_name(const char *c) { unsigned int i; @@ -59,5 +59,5 @@ charset_name(int i) if (i < 0 || i > CONV_NUM_CHARSETS) return "x-unknown"; else - return cs_names[i]; + return (char *)cs_names[i]; } diff --git a/charset/stk-charconv.c b/charset/stk-charconv.c index d5f55fed..a40a7edb 100644 --- a/charset/stk-charconv.c +++ b/charset/stk-charconv.c @@ -15,7 +15,7 @@ #define INITIAL_SCALE 2 uns -stk_strconv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) +stk_strconv_init(struct conv_context *c, const byte *s, uns in_cs, uns out_cs) { uns l = strlen(s); if (in_cs == out_cs) diff --git a/charset/stk-charconv.h b/charset/stk-charconv.h index 3b47940f..1eb368d1 100644 --- a/charset/stk-charconv.h +++ b/charset/stk-charconv.h @@ -24,7 +24,7 @@ /* Internals */ -uns stk_strconv_init(struct conv_context *c, byte *s, uns cs_in, uns cs_out); +uns stk_strconv_init(struct conv_context *c, const byte *s, uns cs_in, uns cs_out); uns stk_strconv_step(struct conv_context *c, byte *buf, uns len); #endif -- 2.39.2