From f072d4e34a70d79a78d06616aad3658dd6b97141 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 31 May 2008 11:44:49 +0000 Subject: Merge from ruby_1_8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- pack.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'pack.c') diff --git a/pack.c b/pack.c index e5324d1e8e..cf348947f1 100644 --- a/pack.c +++ b/pack.c @@ -366,7 +366,7 @@ num2i32(x) #endif static const char toofew[] = "too few arguments"; -static void encodes _((VALUE,char*,long,int)); +static void encodes _((VALUE,const char*,long,int)); static void qpencode _((VALUE,VALUE,long)); static int uv_to_utf8 _((char*,unsigned long)); @@ -441,13 +441,13 @@ static VALUE pack_pack(ary, fmt) VALUE ary, fmt; { - static char *nul10 = "\0\0\0\0\0\0\0\0\0\0"; - static char *spc10 = " "; + static const char nul10[] = "\0\0\0\0\0\0\0\0\0\0"; + static const char spc10[] = " "; char *p, *pend; VALUE res, from, associates = 0; char type; long items, len, idx, plen; - char *ptr; + const char *ptr; #ifdef NATINT_PACK int natint; /* native integer */ #endif @@ -1004,21 +1004,21 @@ pack_pack(ary, fmt) return res; } -static char uu_table[] = +static const char uu_table[] = "`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; -static char b64_table[] = +static const char b64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static void encodes(str, s, len, type) VALUE str; - char *s; + const char *s; long len; int type; { char *buff = ALLOCA_N(char, len * 4 / 3 + 6); long i = 0; - char *trans = type == 'u' ? uu_table : b64_table; + const char *trans = type == 'u' ? uu_table : b64_table; int padding; if (type == 'u') { @@ -1304,7 +1304,7 @@ static VALUE pack_unpack(str, fmt) VALUE str, fmt; { - static char *hexdigits = "0123456789abcdef0123456789ABCDEFx"; + static const char hexdigits[] = "0123456789abcdef0123456789ABCDEFx"; char *s, *send; char *p, *pend; VALUE ary; @@ -1338,7 +1338,7 @@ pack_unpack(str, fmt) } star = 0; if (*p == '_' || *p == '!') { - char *natstr = "sSiIlL"; + static const char natstr[] = "sSiIlL"; if (strchr(natstr, type)) { #ifdef NATINT_PACK -- cgit v1.2.3