[前][次][番号順一覧][スレッド一覧]

ruby-changes:6658

From: nobu <ko1@a...>
Date: Wed, 23 Jul 2008 04:19:15 +0900 (JST)
Subject: [ruby-changes:6658] Ruby:r18174 (ruby_1_8): * ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename),

nobu	2008-07-23 04:17:45 +0900 (Wed, 23 Jul 2008)

  New Revision: 18174

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18174

  Log:
    * ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename),
      (options): constified.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/nkf/nkf-utf8/nkf.c
    branches/ruby_1_8/ext/nkf/nkf.c

Index: ruby_1_8/ext/nkf/nkf.c
===================================================================
--- ruby_1_8/ext/nkf/nkf.c	(revision 18173)
+++ ruby_1_8/ext/nkf/nkf.c	(revision 18174)
@@ -82,7 +82,7 @@
     const char* arg;
 {
     int count = 0;
-    char option[256];
+    unsigned char option[256];
     int i = 0, j = 0;
     int is_escaped = FALSE;
     int is_single_quoted = FALSE;
Index: ruby_1_8/ext/nkf/nkf-utf8/nkf.c
===================================================================
--- ruby_1_8/ext/nkf/nkf-utf8/nkf.c	(revision 18173)
+++ ruby_1_8/ext/nkf/nkf-utf8/nkf.c	(revision 18174)
@@ -320,7 +320,7 @@
 #endif
 
 struct input_code{
-    char *name;
+    const char *name;
     nkf_char stat;
     nkf_char score;
     nkf_char index;
@@ -330,7 +330,7 @@
     int _file_stat;
 };
 
-static char *input_codename = "";
+static const char *input_codename = "";
 
 #ifndef PERL_XS
 static const char *CopyRight = COPY_RIGHT;
@@ -436,7 +436,7 @@
 static  void    usage(void);
 static  void    version(void);
 #endif
-static  void    options(unsigned char *c);
+static  void    options(const unsigned char *c);
 #if defined(PERL_XS) || defined(WIN32DLL)
 static  void    reinit(void);
 #endif
@@ -538,7 +538,7 @@
 #if !defined PERL_XS
 static  void    print_guessed_code(char *filename);
 #endif
-static  void    set_input_codename(char *codename);
+static  void    set_input_codename(const char *codename);
 static int is_inputcode_mixed = FALSE;
 static int is_inputcode_set   = FALSE;
 
@@ -1153,11 +1153,11 @@
 
 static int option_mode = 0;
 
-void options(unsigned char *cp)
+void options(const unsigned char *cp)
 {
     nkf_char i, j;
-    unsigned char *p;
-    unsigned char *cp_back = NULL;
+    const unsigned char *p;
+    const unsigned char *cp_back = NULL;
     char codeset[32];
 
     if (option_mode==1)
@@ -4588,7 +4588,7 @@
            c1 = fv[c1-0x20];
            c2 =  0;
            if (alpha_f&0x8) {
-               char *entity = 0;
+               const char *entity = 0;
                switch (c1){
                  case '>': entity = "&gt;"; break;
                  case '<': entity = "&lt;"; break;
@@ -4925,7 +4925,7 @@
 }
 #endif
 
-void set_input_codename(char *codename)
+void set_input_codename(const char *codename)
 {
     if (guess_f && 
         is_inputcode_set &&
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 18173)
+++ ruby_1_8/ChangeLog	(revision 18174)
@@ -1,3 +1,8 @@
+Wed Jul 23 04:17:42 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename),
+	  (options): constified.
+
 Wed Jul 23 04:16:38 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/openssl: suppress warnings.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]