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

ruby-changes:49887

From: normal <ko1@a...>
Date: Mon, 22 Jan 2018 09:40:19 +0900 (JST)
Subject: [ruby-changes:49887] normal:r62005 (trunk): time.c: constify compat_* tables

normal	2018-01-22 09:40:11 +0900 (Mon, 22 Jan 2018)

  New Revision: 62005

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

  Log:
    time.c: constify compat_* tables
    
    compat_common_month_table and compat_leap_month_table should
    not be writable.

  Modified files:
    trunk/time.c
Index: time.c
===================================================================
--- time.c	(revision 62004)
+++ time.c	(revision 62005)
@@ -1211,7 +1211,7 @@ static struct tm *localtime_with_gmtoff_ https://github.com/ruby/ruby/blob/trunk/time.c#L1211
  *  }
  *
  */
-static int compat_common_month_table[12][7] = {
+static const int compat_common_month_table[12][7] = {
   /* Sun   Mon   Tue   Wed   Thu   Fri   Sat */
   { 2034, 2035, 2036, 2031, 2032, 2027, 2033 }, /* January */
   { 2026, 2027, 2033, 2034, 2035, 2030, 2031 }, /* February */
@@ -1252,7 +1252,7 @@ static int compat_common_month_table[12] https://github.com/ruby/ruby/blob/trunk/time.c#L1252
  *    puts
  *  }
  */
-static int compat_leap_month_table[7] = {
+static const int compat_leap_month_table[7] = {
 /* Sun   Mon   Tue   Wed   Thu   Fri   Sat */
   2032, 2016, 2028, 2012, 2024, 2036, 2020, /* February */
 };

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

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