summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-13 03:01:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-13 03:01:12 +0000
commit53360bd50ade682d5e1c0542d366745fe69e336d (patch)
tree36249dca8d057e1631b6c7afd15c73f120933f0f /file.c
parentb36c91b6b51fbfc213e627975881dd8ce6fdbdf0 (diff)
* file.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/file.c b/file.c
index f105a77d76..1630ac1676 100644
--- a/file.c
+++ b/file.c
@@ -72,25 +72,25 @@ int flock(int, int);
/* define system APIs */
#ifdef _WIN32
-#define STAT(p, s) rb_w32_ustati64(p, s)
+#define STAT(p, s) rb_w32_ustati64((p), (s))
#undef lstat
-#define lstat(p, s) rb_w32_ustati64(p, s)
+#define lstat(p, s) rb_w32_ustati64((p), (s))
#undef access
-#define access(p, m) rb_w32_uaccess(p, m)
+#define access(p, m) rb_w32_uaccess((p), (m))
#undef chmod
-#define chmod(p, m) rb_w32_uchmod(p, m)
+#define chmod(p, m) rb_w32_uchmod((p), (m))
#undef chown
-#define chown(p, o, g) rb_w32_uchown(p, o, g)
+#define chown(p, o, g) rb_w32_uchown((p), (o), (g))
#undef utime
-#define utime(p, t) rb_w32_uutime(p, t)
+#define utime(p, t) rb_w32_uutime((p), (t))
#undef link
-#define link(f, t) rb_w32_ulink(f, t)
+#define link(f, t) rb_w32_ulink((f), (t))
#undef unlink
#define unlink(p) rb_w32_uunlink(p)
#undef rename
-#define rename(f, t) rb_w32_urename(f, t)
+#define rename(f, t) rb_w32_urename((f), (t))
#else
-#define STAT(p, s) stat(p, s)
+#define STAT(p, s) stat((p), (s))
#endif
#if defined(__BEOS__) || defined(__HAIKU__) /* should not change ID if -1 */
@@ -124,7 +124,7 @@ VALUE rb_cFile;
VALUE rb_mFileTest;
VALUE rb_cStat;
-#define insecure_obj_p(obj, level) (level >= 4 || (level > 0 && OBJ_TAINTED(obj)))
+#define insecure_obj_p(obj, level) ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj)))
static VALUE
file_path_convert(VALUE name)
@@ -1099,7 +1099,7 @@ VALUE
rb_file_directory_p(VALUE obj, VALUE fname)
{
#ifndef S_ISDIR
-# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
struct stat st;
@@ -1121,7 +1121,7 @@ rb_file_pipe_p(VALUE obj, VALUE fname)
{
#ifdef S_IFIFO
# ifndef S_ISFIFO
-# define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# endif
struct stat st;
@@ -1148,10 +1148,10 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
# define S_ISLNK(m) _S_ISLNK(m)
# else
# ifdef _S_IFLNK
-# define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
+# define S_ISLNK(m) (((m) & S_IFMT) == _S_IFLNK)
# else
# ifdef S_IFLNK
-# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# endif
# endif
# endif
@@ -1185,10 +1185,10 @@ rb_file_socket_p(VALUE obj, VALUE fname)
# define S_ISSOCK(m) _S_ISSOCK(m)
# else
# ifdef _S_IFSOCK
-# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
+# define S_ISSOCK(m) (((m) & S_IFMT) == _S_IFSOCK)
# else
# ifdef S_IFSOCK
-# define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# endif
# endif
# endif
@@ -1216,7 +1216,7 @@ rb_file_blockdev_p(VALUE obj, VALUE fname)
{
#ifndef S_ISBLK
# ifdef S_IFBLK
-# define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK)
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
# define S_ISBLK(m) (0) /* anytime false */
# endif
@@ -1242,7 +1242,7 @@ static VALUE
rb_file_chardev_p(VALUE obj, VALUE fname)
{
#ifndef S_ISCHR
-# define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
struct stat st;
@@ -1443,7 +1443,7 @@ rb_file_executable_real_p(VALUE obj, VALUE fname)
}
#ifndef S_ISREG
-# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
/*
@@ -3171,8 +3171,8 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
#define EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2)
#define check_expand_path_args(fname, dname) \
- ((fname = rb_get_path(fname)), \
- (void)(NIL_P(dname) ? dname : (dname = rb_get_path(dname))))
+ (((fname) = rb_get_path(fname)), \
+ (void)(NIL_P(dname) ? (dname) : ((dname) = rb_get_path(dname))))
static VALUE
file_expand_path_1(VALUE fname)
@@ -5011,7 +5011,7 @@ path_check_0(VALUE path, int execpath)
#endif
#if ENABLE_PATH_CHECK
-#define fpath_check(path) path_check_0(path, FALSE)
+#define fpath_check(path) path_check_0((path), FALSE)
#else
#define fpath_check(path) 1
#endif