summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-08 02:37:47 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-08 02:37:47 +0000
commit5c54eb4045eb9864a5b728f136229b4f00b2f2f3 (patch)
treefe21ce016e7ff83ee799600f56da2e05c001afe6 /pack.c
parentce89a1c0816df5d1e1e7d69a58f197a7b501b2e2 (diff)
* dir.c, pack.c, ruby.c, struct.c, vm_eval.c: use RARRAY_CONST_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index aba976aad7..71dd6afcb3 100644
--- a/pack.c
+++ b/pack.c
@@ -1798,12 +1798,13 @@ pack_unpack(VALUE str, VALUE fmt)
s += sizeof(char *);
if (t) {
- VALUE a, *p, *pend;
+ VALUE a;
+ const VALUE *p, *pend;
if (!(a = rb_str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
- p = RARRAY_PTR(a);
+ p = RARRAY_CONST_PTR(a);
pend = p + RARRAY_LEN(a);
while (p < pend) {
if (RB_TYPE_P(*p, T_STRING) && RSTRING_PTR(*p) == t) {
@@ -1840,12 +1841,13 @@ pack_unpack(VALUE str, VALUE fmt)
s += sizeof(char *);
if (t) {
- VALUE a, *p, *pend;
+ VALUE a;
+ const VALUE *p, *pend;
if (!(a = rb_str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
- p = RARRAY_PTR(a);
+ p = RARRAY_CONST_PTR(a);
pend = p + RARRAY_LEN(a);
while (p < pend) {
if (RB_TYPE_P(*p, T_STRING) && RSTRING_PTR(*p) == t) {