* ext/digest/defs.h, win32/win3.c, win32/win32.h, file.c: remove

useless casts for Borland C.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-01-19 12:28:14 +00:00
parent 22c005569b
commit 224021104d
6 changed files with 24 additions and 43 deletions

View File

@ -1,3 +1,8 @@
Mon Jan 19 21:28:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/digest/defs.h, win32/win3.c, win32/win32.h, file.c: remove
useless casts for Borland C.
Mon Jan 19 17:39:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> Mon Jan 19 17:39:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (NameError::message): internal use only. * error.c (NameError::message): internal use only.

View File

@ -23,12 +23,8 @@
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
# if SIZEOF_LONG == 8 # if SIZEOF_LONG == 8
typedef unsigned long uint64_t; typedef unsigned long uint64_t;
# elif defined(__GNUC__) # elif SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t; typedef unsigned LONG_LONG uint64_t;
# elif defined(_MSC_VER)
typedef unsigned _int64 uint64_t;
# elif defined(__BORLANDC__)
typedef unsigned __int64 uint64_t;
# else # else
# define NO_UINT64_T # define NO_UINT64_T
# endif # endif

24
file.c
View File

@ -231,11 +231,7 @@ static VALUE
rb_stat_mode(self) rb_stat_mode(self)
VALUE self; VALUE self;
{ {
#ifdef __BORLANDC__
return UINT2NUM((unsigned short)(get_stat(self)->st_mode));
#else
return UINT2NUM(get_stat(self)->st_mode); return UINT2NUM(get_stat(self)->st_mode);
#endif
} }
/* /*
@ -838,14 +834,6 @@ test_l(obj, fname)
#ifndef S_ISLNK #ifndef S_ISLNK
# ifdef _S_ISLNK # ifdef _S_ISLNK
# define S_ISLNK(m) _S_ISLNK(m) # define S_ISLNK(m) _S_ISLNK(m)
# elif defined __BORLANDC__
# ifdef _S_IFLNK
# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == _S_IFLNK)
# else
# ifdef S_IFLNK
# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == S_IFLNK)
# endif
# endif
# else # else
# ifdef _S_IFLNK # ifdef _S_IFLNK
# define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK) # define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
@ -882,14 +870,6 @@ test_S(obj, fname)
#ifndef S_ISSOCK #ifndef S_ISSOCK
# ifdef _S_ISSOCK # ifdef _S_ISSOCK
# define S_ISSOCK(m) _S_ISSOCK(m) # define S_ISSOCK(m) _S_ISSOCK(m)
# elif defined __BORLANDC__
# ifdef _S_IFSOCK
# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == _S_IFSOCK)
# else
# ifdef S_IFSOCK
# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == S_IFSOCK)
# endif
# endif
# else # else
# ifdef _S_IFSOCK # ifdef _S_IFSOCK
# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK) # define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
@ -1046,7 +1026,7 @@ test_wr(obj, fname)
if (rb_stat(fname, &st) < 0) return Qnil; if (rb_stat(fname, &st) < 0) return Qnil;
if ((st.st_mode & (S_IROTH)) == S_IROTH) { if ((st.st_mode & (S_IROTH)) == S_IROTH) {
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO)); return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
} }
#endif #endif
return Qnil; return Qnil;
@ -1109,7 +1089,7 @@ test_ww(obj, fname)
if (rb_stat(fname, &st) < 0) return Qfalse; if (rb_stat(fname, &st) < 0) return Qfalse;
if ((st.st_mode & (S_IWOTH)) == S_IWOTH) { if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO)); return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
} }
#endif #endif
return Qnil; return Qnil;

View File

@ -1,3 +1,6 @@
#ifndef RUBY_WIN32_DIR_H
#define RUBY_WIN32_DIR_H
#ifdef __BORLANDC__ #ifdef __BORLANDC__
# ifndef WIN32_DIR_H_ # ifndef WIN32_DIR_H_
# define WIN32_DIR_H_ # define WIN32_DIR_H_
@ -37,3 +40,5 @@ void rb_w32_closedir(DIR *);
#define seekdir rb_w32_seekdir #define seekdir rb_w32_seekdir
#define rewinddir rb_w32_rewinddir #define rewinddir rb_w32_rewinddir
#define closedir rb_w32_closedir #define closedir rb_w32_closedir
#endif /* RUBY_WIN32_DIR_H */

View File

@ -583,7 +583,6 @@ isInternalCmd(const char *cmd, const char *interp)
return 1; return 1;
} }
SOCKET SOCKET
rb_w32_get_osfhandle(int fh) rb_w32_get_osfhandle(int fh)
{ {
@ -1748,12 +1747,7 @@ setgid(int gid)
// //
int int
/* ioctl(int i, unsigned int u, char *data) */ ioctl(int i, int u, ...)
#ifdef __BORLANDC__
ioctl(int i, int u, ...)
#else
ioctl(int i, unsigned int u, long data)
#endif
{ {
return -1; return -1;
} }
@ -2489,6 +2483,9 @@ rb_w32_getcwd(buffer, size)
char *bp; char *bp;
#undef getcwd #undef getcwd
#ifndef __BORLANDC__
#define getcwd _getcwd
#endif
if (getcwd(buffer, size) == NULL) { if (getcwd(buffer, size) == NULL) {
return NULL; return NULL;
} }

View File

@ -57,7 +57,7 @@ extern "C++" {
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#if !defined(__BORLANDC__) #ifdef HAVE_SYS_UTIME_H
# include <sys/utime.h> # include <sys/utime.h>
#else #else
# include <utime.h> # include <utime.h>
@ -188,7 +188,7 @@ extern pid_t rb_w32_getpid(void);
#endif #endif
#endif #endif
#ifdef __BORLANDC__ #if 0 && defined __BORLANDC__
#undef S_ISDIR #undef S_ISDIR
#undef S_ISFIFO #undef S_ISFIFO
#undef S_ISBLK #undef S_ISBLK
@ -240,9 +240,7 @@ extern pid_t rb_w32_getpid(void);
// //
// stubs // stubs
// //
#if !defined(__BORLANDC__) extern int ioctl (int, int, ...);
extern int ioctl (int, unsigned int, long);
#endif
extern UIDTYPE getuid (void); extern UIDTYPE getuid (void);
extern UIDTYPE geteuid (void); extern UIDTYPE geteuid (void);
extern GIDTYPE getgid (void); extern GIDTYPE getgid (void);