1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/socket.c: constified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-09 09:51:21 +00:00
parent 5a647a3f5f
commit f8ef02adc4

View file

@ -766,9 +766,9 @@ bsock_do_not_rev_lookup_set(VALUE self, VALUE val)
return val;
}
NORETURN(static void raise_socket_error(char *, int));
NORETURN(static void raise_socket_error(const char *, int));
static void
raise_socket_error(char *reason, int error)
raise_socket_error(const char *reason, int error)
{
#ifdef EAI_SYSTEM
if (error == EAI_SYSTEM) rb_sys_fail(reason);
@ -1239,7 +1239,7 @@ init_inetsock_internal(struct inetsock_arg *arg)
int type = arg->type;
struct addrinfo *res;
int fd, status = 0;
char *syscall;
const char *syscall;
arg->remote.res = sock_addrinfo(arg->remote.host, arg->remote.serv, SOCK_STREAM,
(type == INET_SERVER) ? AI_PASSIVE : 0);
@ -1870,7 +1870,7 @@ unix_init(VALUE sock, VALUE path)
return init_unixsock(sock, path, 0);
}
static char*
static const char*
unixpath(struct sockaddr_un *sockaddr, socklen_t len)
{
if (sockaddr->sun_path < (char*)sockaddr + len)
@ -3462,7 +3462,7 @@ static VALUE
sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
{
struct sockaddr_un * sockaddr;
char *sun_path;
const char *sun_path;
VALUE path;
sockaddr = (struct sockaddr_un*)StringValuePtr(addr);
@ -3488,7 +3488,7 @@ sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
static VALUE mConst;
static void
sock_define_const(char *name, int value)
sock_define_const(const char *name, int value)
{
rb_define_const(rb_cSocket, name, INT2FIX(value));
rb_define_const(mConst, name, INT2FIX(value));