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

ruby-changes:51108

From: normal <ko1@a...>
Date: Wed, 2 May 2018 05:55:46 +0900 (JST)
Subject: [ruby-changes:51108] normal:r63315 (trunk): cont.c: cleanup needless cast

normal	2018-05-02 05:55:39 +0900 (Wed, 02 May 2018)

  New Revision: 63315

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63315

  Log:
    cont.c: cleanup needless cast
    
    It seems like leftover development step from r59557
    ("refactoring Fiber status").
    
    I will make fiber_status use BITFIELD macro in a future
    commit.
    
    * cont.c (struct rb_fiber_struct): drop const from fiber_status
      (fiber_status_set): remove cast
      [ruby-core:86788] [Misc #14720]

  Modified files:
    trunk/cont.c
Index: cont.c
===================================================================
--- cont.c	(revision 63314)
+++ cont.c	(revision 63315)
@@ -156,7 +156,7 @@ struct rb_fiber_struct { https://github.com/ruby/ruby/blob/trunk/cont.c#L156
     rb_context_t cont;
     VALUE first_proc;
     struct rb_fiber_struct *prev;
-    const enum fiber_status status;
+    enum fiber_status status;
     /* If a fiber invokes "transfer",
      * then this fiber can't "resume" any more after that.
      * You shouldn't mix "transfer" and "resume".
@@ -223,13 +223,13 @@ rb_ec_verify(const rb_execution_context_ https://github.com/ruby/ruby/blob/trunk/cont.c#L223
 #endif
 
 static void
-fiber_status_set(const rb_fiber_t *fib, enum fiber_status s)
+fiber_status_set(rb_fiber_t *fib, enum fiber_status s)
 {
     if (0) fprintf(stderr, "fib: %p, status: %s -> %s\n", (void *)fib, fiber_status_name(fib->status), fiber_status_name(s));
     VM_ASSERT(!FIBER_TERMINATED_P(fib));
     VM_ASSERT(fib->status != s);
     fiber_verify(fib);
-    *((enum fiber_status *)&fib->status) = s;
+    fib->status = s;
 }
 
 void

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

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