ruby-changes:71939
From: Nobuyoshi <ko1@a...>
Date: Tue, 24 May 2022 17:23:56 +0900 (JST)
Subject: [ruby-changes:71939] 78785fb990 (master): [ruby/date] Constify gperf-generated table
https://git.ruby-lang.org/ruby.git/commit/?id=78785fb990 From 78785fb99041521fc5da01ffa6ab3f4f3936ce06 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 24 May 2022 17:23:23 +0900 Subject: [ruby/date] Constify gperf-generated table https://github.com/ruby/date/commit/6d7ab08ffc --- ext/date/zonetab.h | 2 +- tool/gperf.sed | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/date/zonetab.h b/ext/date/zonetab.h index d82b011dc1..39a435db16 100644 --- a/ext/date/zonetab.h +++ b/ext/date/zonetab.h @@ -49,7 +49,7 @@ struct zone; https://github.com/ruby/ruby/blob/trunk/ext/date/zonetab.h#L49 #ifndef GPERF_DOWNCASE #define GPERF_DOWNCASE 1 -static unsigned char gperf_downcase[256] = +static const unsigned char gperf_downcase[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, diff --git a/tool/gperf.sed b/tool/gperf.sed index 6b3e1980be..52915f80d5 100644 --- a/tool/gperf.sed +++ b/tool/gperf.sed @@ -20,3 +20,4 @@ s/(int)([a-z_]*)&((struct \([a-zA-Z_0-9][a-zA-Z_0-9]*\)_t *\*)0)->\1_str\([1-9][ https://github.com/ruby/ruby/blob/trunk/tool/gperf.sed#L20 s/ hval = / hval = (unsigned int)/ s/ return / return (unsigned int)/ } +s/^\(static\) \(unsigned char gperf_downcase\)/\1 const \2/ -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/