Add some missing consts in character set handling.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 16 Sep 2011 19:18:52 +0000 (19:18 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 16 Sep 2011 19:18:52 +0000 (19:18 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@9291 cda61777-01e9-0310-a592-d414129be87e

charset/charset.h
charset/fromucs.c
charset/toucs.c
putty.h
unix/gtkwin.c
unix/uxucs.c
windows/winucs.c

index 5f83edd..bf17032 100644 (file)
@@ -98,7 +98,8 @@ typedef struct {
  * U+FFFD (REPLACEMENT CHARACTER).
  */
 
-int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen,
+int charset_to_unicode(const char **input, int *inlen,
+                       wchar_t *output, int outlen,
                       int charset, charset_state *state,
                       const wchar_t *errstr, int errlen);
 
@@ -121,7 +122,8 @@ int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen,
  * output charset).
  */
 
-int charset_from_unicode(wchar_t **input, int *inlen, char *output, int outlen,
+int charset_from_unicode(const wchar_t **input, int *inlen,
+                         char *output, int outlen,
                         int charset, charset_state *state,
                         const char *errstr, int errlen);
 
index f08375f..6ccdb86 100644 (file)
@@ -40,7 +40,8 @@ static void charset_emit(void *ctx, long int output)
     }
 }
 
-int charset_from_unicode(wchar_t **input, int *inlen, char *output, int outlen,
+int charset_from_unicode(const wchar_t **input, int *inlen,
+                         char *output, int outlen,
                         int charset, charset_state *state,
                         const char *errstr, int errlen)
 {
index 4a6c12f..1df788a 100644 (file)
@@ -46,7 +46,8 @@ static void unicode_emit(void *ctx, long int output)
     }
 }
 
-int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen,
+int charset_to_unicode(const char **input, int *inlen,
+                       wchar_t *output, int outlen,
                       int charset, charset_state *state,
                       const wchar_t *errstr, int errlen)
 {
diff --git a/putty.h b/putty.h
index 79731b1..377bf6b 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -1080,9 +1080,9 @@ extern char ver[];
 #endif
 /* void init_ucs(void); -- this is now in platform-specific headers */
 int is_dbcs_leadbyte(int codepage, char byte);
-int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
+int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen,
             wchar_t *wcstr, int wclen);
-int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
+int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
             char *mbstr, int mblen, char *defchr, int *defused,
             struct unicode_data *ucsdata);
 wchar_t xlat_uskbd2cyrllic(int ch);
index a8be624..303052a 100644 (file)
@@ -690,7 +690,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
         */
        output_charset = CS_UTF8;
        {
-           wchar_t widedata[32], *wp;
+           wchar_t widedata[32];
+            const wchar_t *wp;
            int wlen;
            int ulen;
 
@@ -1638,7 +1639,7 @@ void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_des
      * if we aren't in direct-to-font mode using the D800 hack.
      */
     if (!inst->direct_to_font) {
-       wchar_t *tmp = data;
+       const wchar_t *tmp = data;
        int tmplen = len;
        XTextProperty tp;
        char *list[1];
index 071ecfc..20f25d4 100644 (file)
@@ -21,7 +21,7 @@ int is_dbcs_leadbyte(int codepage, char byte)
     return 0;                         /* we don't do DBCS */
 }
 
-int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
+int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen,
             wchar_t *wcstr, int wclen)
 {
     if (codepage == DEFAULT_CODEPAGE) {
@@ -59,7 +59,7 @@ int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
                                  NULL, NULL, 0);
 }
 
-int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
+int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
             char *mbstr, int mblen, char *defchr, int *defused,
             struct unicode_data *ucsdata)
 {
@@ -162,7 +162,8 @@ int init_ucs(struct unicode_data *ucsdata, char *linecharset,
      * in the line codepage into Unicode.
      */
     for (i = 0; i < 256; i++) {
-       char c[1], *p;
+       char c[1];
+        const char *p;
        wchar_t wc[1];
        int len;
        c[0] = i;
@@ -216,7 +217,8 @@ int init_ucs(struct unicode_data *ucsdata, char *linecharset,
      * simply CP437.
      */
     for (i = 0; i < 256; i++) {
-       char c[1], *p;
+       char c[1];
+        const char *p;
        wchar_t wc[1];
        int len;
        c[0] = i;
index 9abd83c..6886a8f 100644 (file)
@@ -1204,7 +1204,7 @@ void get_unitab(int codepage, wchar_t * unitab, int ftype)
     }
 }
 
-int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
+int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
             char *mbstr, int mblen, char *defchr, int *defused,
             struct unicode_data *ucsdata)
 {
@@ -1242,7 +1242,7 @@ int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
                                   mbstr, mblen, defchr, defused);
 }
 
-int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
+int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen,
             wchar_t *wcstr, int wclen)
 {
     return MultiByteToWideChar(codepage, flags, mbstr, mblen, wcstr, wclen);