aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-21 07:32:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-21 07:32:24 +0000
commit8b94ce988b1a000325d47daa02e16dd487c4f27d (patch)
tree043a72ddeb9958bccd93ca5fdd404dd7bcaae363 /file.c
parent936b61d4acffc632608d1c1990b02e6a791107d0 (diff)
downloadruby-8b94ce988b1a000325d47daa02e16dd487c4f27d.tar.gz
Constified
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/file.c b/file.c
index b558705e13..676be5a020 100644
--- a/file.c
+++ b/file.c
@@ -495,7 +495,7 @@ get_stat(VALUE self)
return st;
}
-static struct timespec stat_mtimespec(struct stat *st);
+static struct timespec stat_mtimespec(const struct stat *st);
/*
* call-seq:
@@ -820,7 +820,7 @@ rb_stat_blocks(VALUE self)
}
static struct timespec
-stat_atimespec(struct stat *st)
+stat_atimespec(const struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_atime;
@@ -837,14 +837,14 @@ stat_atimespec(struct stat *st)
}
static VALUE
-stat_atime(struct stat *st)
+stat_atime(const struct stat *st)
{
struct timespec ts = stat_atimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
}
static struct timespec
-stat_mtimespec(struct stat *st)
+stat_mtimespec(const struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_mtime;
@@ -861,14 +861,14 @@ stat_mtimespec(struct stat *st)
}
static VALUE
-stat_mtime(struct stat *st)
+stat_mtime(const struct stat *st)
{
struct timespec ts = stat_mtimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
}
static struct timespec
-stat_ctimespec(struct stat *st)
+stat_ctimespec(const struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_ctime;
@@ -885,7 +885,7 @@ stat_ctimespec(struct stat *st)
}
static VALUE
-stat_ctime(struct stat *st)
+stat_ctime(const struct stat *st)
{
struct timespec ts = stat_ctimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
@@ -894,9 +894,9 @@ stat_ctime(struct stat *st)
#define HAVE_STAT_BIRTHTIME
#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC)
static VALUE
-stat_birthtime(struct stat *st)
+stat_birthtime(const struct stat *st)
{
- struct timespec *ts = &st->st_birthtimespec;
+ const struct timespec *ts = &st->st_birthtimespec;
return rb_time_nano_new(ts->tv_sec, ts->tv_nsec);
}
#elif defined(_WIN32)
@@ -1194,7 +1194,7 @@ rb_statx(VALUE file, struct statx *stx, unsigned int mask)
}
static VALUE
-statx_birthtime(struct statx *stx)
+statx_birthtime(const struct statx *stx)
{
return rb_time_nano_new(stx->stx_btime.tv_sec, stx->stx_btime.tv_nsec);
}