* intern.h, struct.c (rb_struct_iv_get): constified.

* marshal.c: avoid one VC++6 warning for implicit conversion
  from int to char.

* ruby.h: ANSI styled.

* bcc32/Makefile.sub (HAVE_HYPOT): added.

* ext/socket/extconf.rb: BeOS is only one platform should call
  closesocket, so check __BEOS__ macro directly. (I was worried
  accidently HAVE_CLOSESOCKET is defined on windows again because
  it has it)

* ext/socket/{getaddrinfo.c,socket.c}: ditto.

... these are all cosmetic changes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-10-21 06:46:41 +00:00
Родитель b4236d6e71
Коммит 73f94bb851
9 изменённых файлов: 33 добавлений и 30 удалений

Просмотреть файл

@ -1,3 +1,23 @@
Fri Oct 21 15:42:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* intern.h, struct.c (rb_struct_iv_get): constified.
* marshal.c: avoid one VC++6 warning for implicit conversion
from int to char.
* ruby.h: ANSI styled.
* bcc32/Makefile.sub (HAVE_HYPOT): added.
* ext/socket/extconf.rb: BeOS is only one platform should call
closesocket, so check __BEOS__ macro directly. (I was worried
accidently HAVE_CLOSESOCKET is defined on windows again because
it has it)
* ext/socket/{getaddrinfo.c,socket.c}: ditto.
... these are all cosmetic changes.
Fri Oct 21 15:23:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bignum.c (bignew_1): convertion from `int' to `char' discards

Просмотреть файл

@ -255,6 +255,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)bcc32/Makefile.sub
\#define HAVE_VSNPRINTF 1
\#define HAVE_ISNAN 1
\#define HAVE_FINITE 1
\#define HAVE_HYPOT 1
\#define HAVE_FMOD 1
\#define HAVE_WAITPID 1
\#define HAVE_FSYNC 1

Просмотреть файл

@ -9,7 +9,6 @@ when /cygwin/
when /beos/
test_func = "socket"
have_library("net", "socket")
have_func("closesocket")
when /i386-os2_emx/
test_func = "socket"
have_library("socket", "socket")

Просмотреть файл

@ -437,7 +437,7 @@ getaddrinfo(hostname, servname, hints, res)
s = socket(afd->a_af, SOCK_DGRAM, 0);
if (s < 0)
continue;
#if defined(HAVE_CLOSESOCKET)
#if defined(__BEOS__)
closesocket(s);
#else
close(s);

Просмотреть файл

@ -193,7 +193,7 @@ ruby_getaddrinfo__aix(nodename, servname, hints, res)
#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__aix((node),(serv),(hints),(res))
#endif
#ifdef HAVE_CLOSESOCKET
#ifdef __BEOS__
#undef close
#define close closesocket
#endif

Просмотреть файл

@ -518,7 +518,7 @@ VALUE rb_struct_alloc(VALUE, VALUE);
VALUE rb_struct_aref(VALUE, VALUE);
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
VALUE rb_struct_getmember(VALUE, ID);
VALUE rb_struct_iv_get(VALUE, char*);
VALUE rb_struct_iv_get(VALUE, const char*);
VALUE rb_struct_s_members(VALUE);
VALUE rb_struct_members(VALUE);
/* time.c */

Просмотреть файл

@ -116,7 +116,7 @@ class2path(VALUE klass)
static void w_long(long, struct dump_arg*);
static void
w_nbyte(char *s, int n, struct dump_arg *arg)
w_nbyte(const char *s, int n, struct dump_arg *arg)
{
VALUE buf = arg->str;
rb_str_buf_cat(buf, s, n);
@ -134,7 +134,7 @@ w_byte(char c, struct dump_arg *arg)
}
static void
w_bytes(char *s, int n, struct dump_arg *arg)
w_bytes(const char *s, int n, struct dump_arg *arg)
{
w_long(n, arg);
w_nbyte(s, n, arg);
@ -319,7 +319,7 @@ w_symbol(ID id, struct dump_arg *arg)
}
static void
w_unique(char *s, struct dump_arg *arg)
w_unique(const char *s, struct dump_arg *arg)
{
if (s[0] == '#') {
rb_raise(rb_eTypeError, "can't dump anonymous class %s", s);
@ -358,7 +358,7 @@ w_extended(VALUE klass, struct dump_arg *arg, int check)
}
static void
w_class(int type, VALUE obj, struct dump_arg *arg, int check)
w_class(char type, VALUE obj, struct dump_arg *arg, int check)
{
char *path;
@ -908,7 +908,7 @@ r_ivar(VALUE obj, struct load_arg *arg)
}
static VALUE
path2class(char *path)
path2class(const char *path)
{
VALUE v = rb_path2class(path);
@ -919,7 +919,7 @@ path2class(char *path)
}
static VALUE
path2module(char *path)
path2module(const char *path)
{
VALUE v = rb_path2class(path);

15
ruby.h
Просмотреть файл

@ -655,12 +655,7 @@ RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
RUBY_EXTERN VALUE ruby_errinfo;
static inline VALUE
#if defined(HAVE_PROTOTYPES)
rb_class_of(VALUE obj)
#else
rb_class_of(obj)
VALUE obj;
#endif
{
if (IMMEDIATE_P(obj)) {
if (FIXNUM_P(obj)) return rb_cFixnum;
@ -675,12 +670,7 @@ rb_class_of(obj)
}
static inline int
#if defined(HAVE_PROTOTYPES)
rb_type(VALUE obj)
#else
rb_type(obj)
VALUE obj;
#endif
{
if (IMMEDIATE_P(obj)) {
if (FIXNUM_P(obj)) return T_FIXNUM;
@ -696,12 +686,7 @@ rb_type(obj)
}
static inline int
#if defined(HAVE_PROTOTYPES)
rb_special_const_p(VALUE obj)
#else
rb_special_const_p(obj)
VALUE obj;
#endif
{
if (SPECIAL_CONST_P(obj)) return Qtrue;
return Qfalse;

Просмотреть файл

@ -17,7 +17,7 @@ VALUE rb_cStruct;
static VALUE struct_alloc(VALUE);
VALUE
rb_struct_iv_get(VALUE c, char *name)
rb_struct_iv_get(VALUE c, const char *name)
{
ID id;
@ -123,9 +123,9 @@ static VALUE rb_struct_ref7(VALUE obj) {return RSTRUCT(obj)->ptr[7];}
static VALUE rb_struct_ref8(VALUE obj) {return RSTRUCT(obj)->ptr[8];}
static VALUE rb_struct_ref9(VALUE obj) {return RSTRUCT(obj)->ptr[9];}
#define N_REF_FUNC (sizeof(ref_func) / sizeof(VALUE (*)()))
#define N_REF_FUNC (sizeof(ref_func) / sizeof(ref_func[0]))
static VALUE (*ref_func[])() = {
static VALUE (*ref_func[])(VALUE) = {
rb_struct_ref0,
rb_struct_ref1,
rb_struct_ref2,
@ -214,8 +214,6 @@ make_struct(VALUE name, VALUE members, VALUE klass)
return nstr;
}
#include <stdarg.h>
VALUE
rb_struct_define(const char *name, ...)
{