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

ruby-changes:49763

From: normal <ko1@a...>
Date: Wed, 17 Jan 2018 14:03:48 +0900 (JST)
Subject: [ruby-changes:49763] normal:r61881 (trunk): time.c: use "unsigned int" for bitfields

normal	2018-01-17 14:03:43 +0900 (Wed, 17 Jan 2018)

  New Revision: 61881

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

  Log:
    time.c: use "unsigned int" for bitfields
    
    Followup to r61870

  Modified files:
    trunk/time.c
Index: time.c
===================================================================
--- time.c	(revision 61880)
+++ time.c	(revision 61881)
@@ -1597,18 +1597,12 @@ localtimew(wideval_t timew, struct vtm * https://github.com/ruby/ruby/blob/trunk/time.c#L1597
     return result;
 }
 
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#define bits_t uint8_t
-#else
-#define bits_t unsigned int
-#endif
 PACKED_STRUCT_UNALIGNED(struct time_object {
     wideval_t timew; /* time_t value * TIME_SCALE.  possibly Rational. */
     struct vtm vtm;
-    bits_t gmt:3; /* 0:localtime 1:utc 2:fixoff 3:init */
-    bits_t tm_got:1;
+    unsigned int gmt:3; /* 0:localtime 1:utc 2:fixoff 3:init */
+    unsigned int tm_got:1;
 });
-#undef bits_t
 
 #define GetTimeval(obj, tobj) ((tobj) = get_timeval(obj))
 #define GetNewTimeval(obj, tobj) ((tobj) = get_new_timeval(obj))

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

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