summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-08 01:09:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-08 01:09:21 +0000
commit9d83b19896a8fee43150e6287cde0fc95fb7fbf1 (patch)
treee210a48951738fd800515c39b424b18a5233f13a /ext/date
parentb90516659f00a8df6ed85749bdc203de7e3fed6e (diff)
ext/date: constify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/date_core.c2
-rw-r--r--ext/date/date_parse.c6
-rw-r--r--ext/date/date_tmx.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 08c58b1..b99f947 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -6602,7 +6602,7 @@ tmx_m_zone(union DateData *x)
return RSTRING_PTR(m_zone(x));
}
-static struct tmx_funcs tmx_funcs = {
+static const struct tmx_funcs tmx_funcs = {
(VALUE (*)(void *))m_real_year,
(int (*)(void *))m_yday,
(int (*)(void *))m_mon,
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 17ce460..07647eb 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -44,12 +44,12 @@
#define cstr2num(s) rb_cstr_to_inum(s, 10, 0)
#define str2num(s) rb_str_to_inum(s, 10, 0)
-static const char *abbr_days[] = {
+static const char abbr_days[][4] = {
"sun", "mon", "tue", "wed",
"thu", "fri", "sat"
};
-static const char *abbr_months[] = {
+static const char abbr_months[][4] = {
"jan", "feb", "mar", "apr", "may", "jun",
"jul", "aug", "sep", "oct", "nov", "dec"
};
@@ -342,7 +342,7 @@ struct zone {
int offset;
};
-static struct zone zones_source[] = {
+static const struct zone zones_source[] = {
{"ut", 0*3600}, {"gmt", 0*3600}, {"est", -5*3600}, {"edt", -4*3600},
{"cst", -6*3600}, {"cdt", -5*3600}, {"mst", -7*3600}, {"mdt", -6*3600},
{"pst", -8*3600}, {"pdt", -7*3600},
diff --git a/ext/date/date_tmx.h b/ext/date/date_tmx.h
index ed06501..993a153 100644
--- a/ext/date/date_tmx.h
+++ b/ext/date/date_tmx.h
@@ -23,7 +23,7 @@ struct tmx_funcs {
};
struct tmx {
void *dat;
- struct tmx_funcs *funcs;
+ const struct tmx_funcs *funcs;
};
#define tmx_attr(x) (tmx->funcs->x)(tmx->dat)