summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-10 03:34:25 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-10 03:34:25 +0000
commitd3650ccc7e78e434a30290aa4cd312f382ca9728 (patch)
tree668dba99cc709a3bdd22de08a5b4233d13a8c6da /cont.c
parent27535987bedec229294a8f6f7d1d6668b7a3e697 (diff)
downloadruby-d3650ccc7e78e434a30290aa4cd312f382ca9728.tar.gz
constify some variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cont.c b/cont.c
index 91fdc2daf3..83ee5557d5 100644
--- a/cont.c
+++ b/cont.c
@@ -240,8 +240,8 @@ cont_mark(void *ptr)
}
else {
/* fiber */
- rb_thread_t *th = rb_thread_ptr(cont->saved_thread.self);
- rb_fiber_t *fib = (rb_fiber_t*)cont;
+ const rb_thread_t *th = rb_thread_ptr(cont->saved_thread.self);
+ const rb_fiber_t *fib = (rb_fiber_t*)cont;
if ((th->fiber != fib) && FIBER_SUSPENDED_P(fib)) {
rb_gc_mark_locations(cont->machine.stack,
@@ -274,7 +274,7 @@ cont_free(void *ptr)
}
else {
/* fiber */
- rb_fiber_t *fib = (rb_fiber_t*)cont;
+ const rb_fiber_t *fib = (rb_fiber_t*)cont;
const rb_thread_t *const th = GET_THREAD();
#ifdef _WIN32
if (th && th->fiber != fib && cont->type != ROOT_FIBER_CONTEXT) {
@@ -362,7 +362,7 @@ fiber_verify(const rb_fiber_t *fib)
}
void
-rb_fiber_mark_self(rb_fiber_t *fib)
+rb_fiber_mark_self(const rb_fiber_t *fib)
{
if (fib)
rb_gc_mark(fib->cont.self);
@@ -585,7 +585,7 @@ cont_restore_thread(rb_context_t *cont)
/* restore thread context */
if (cont->type == CONTINUATION_CONTEXT) {
/* continuation */
- rb_fiber_t *fib;
+ const rb_fiber_t *fib;
th->fiber = sth->fiber;
fib = th->fiber ? th->fiber : th->root_fiber;
@@ -1607,7 +1607,7 @@ rb_fiber_reset_root_local_storage(VALUE thval)
VALUE
rb_fiber_alive_p(VALUE fibval)
{
- rb_fiber_t *fib;
+ const rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
return FIBER_TERMINATED_P(fib) ? Qfalse : Qtrue;
}