summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2021-08-31 20:30:35 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-05 23:01:27 +0900
commitbdd6d8746f0a07b2c0cc3a6b387bf594569c0bb7 (patch)
treef11d32da65e227763d598d765765a76ddace1a0a /file.c
parent8f752c95d20134bcc0b5394f1cea723a40f1ac8c (diff)
Replace RBOOL macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4791
Diffstat (limited to 'file.c')
-rw-r--r--file.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/file.c b/file.c
index eb10c54c34d..f5d01fda2a0 100644
--- a/file.c
+++ b/file.c
@@ -5794,11 +5794,11 @@ rb_stat_r(VALUE obj)
#endif
#ifdef S_IRUSR
if (rb_stat_owned(obj))
- return st->st_mode & S_IRUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IRUSR);
#endif
#ifdef S_IRGRP
if (rb_stat_grpowned(obj))
- return st->st_mode & S_IRGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IRGRP);
#endif
#ifdef S_IROTH
if (!(st->st_mode & S_IROTH)) return Qfalse;
@@ -5827,11 +5827,11 @@ rb_stat_R(VALUE obj)
#endif
#ifdef S_IRUSR
if (rb_stat_rowned(obj))
- return st->st_mode & S_IRUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IRUSR);
#endif
#ifdef S_IRGRP
if (rb_group_member(get_stat(obj)->st_gid))
- return st->st_mode & S_IRGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IRGRP);
#endif
#ifdef S_IROTH
if (!(st->st_mode & S_IROTH)) return Qfalse;
@@ -5887,11 +5887,11 @@ rb_stat_w(VALUE obj)
#endif
#ifdef S_IWUSR
if (rb_stat_owned(obj))
- return st->st_mode & S_IWUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IWUSR);
#endif
#ifdef S_IWGRP
if (rb_stat_grpowned(obj))
- return st->st_mode & S_IWGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IWGRP);
#endif
#ifdef S_IWOTH
if (!(st->st_mode & S_IWOTH)) return Qfalse;
@@ -5920,11 +5920,11 @@ rb_stat_W(VALUE obj)
#endif
#ifdef S_IWUSR
if (rb_stat_rowned(obj))
- return st->st_mode & S_IWUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IWUSR);
#endif
#ifdef S_IWGRP
if (rb_group_member(get_stat(obj)->st_gid))
- return st->st_mode & S_IWGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IWGRP);
#endif
#ifdef S_IWOTH
if (!(st->st_mode & S_IWOTH)) return Qfalse;
@@ -5979,16 +5979,16 @@ rb_stat_x(VALUE obj)
#ifdef USE_GETEUID
if (geteuid() == 0) {
- return st->st_mode & S_IXUGO ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXUGO);
}
#endif
#ifdef S_IXUSR
if (rb_stat_owned(obj))
- return st->st_mode & S_IXUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXUSR);
#endif
#ifdef S_IXGRP
if (rb_stat_grpowned(obj))
- return st->st_mode & S_IXGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXGRP);
#endif
#ifdef S_IXOTH
if (!(st->st_mode & S_IXOTH)) return Qfalse;
@@ -6011,16 +6011,16 @@ rb_stat_X(VALUE obj)
#ifdef USE_GETEUID
if (getuid() == 0) {
- return st->st_mode & S_IXUGO ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXUGO);
}
#endif
#ifdef S_IXUSR
if (rb_stat_rowned(obj))
- return st->st_mode & S_IXUSR ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXUSR);
#endif
#ifdef S_IXGRP
if (rb_group_member(get_stat(obj)->st_gid))
- return st->st_mode & S_IXGRP ? Qtrue : Qfalse;
+ return RBOOL(st->st_mode & S_IXGRP);
#endif
#ifdef S_IXOTH
if (!(st->st_mode & S_IXOTH)) return Qfalse;