summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c20
1 files changed, 10 insertions, 10 deletions
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