From 8b94ce988b1a000325d47daa02e16dd487c4f27d Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 21 Feb 2019 07:32:24 +0000 Subject: Constified git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'file.c') 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); } -- cgit v1.2.3