summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/ancdata.c4
-rw-r--r--ext/socket/raddrinfo.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index f8379cc..52f92a1 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -196,7 +196,7 @@ ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
for (i = 0 ; i < argc; i++) {
VALUE obj = argv[i];
- if (TYPE(obj) != T_FILE) {
+ if (!RB_TYPE_P(obj, T_FILE)) {
rb_raise(rb_eTypeError, "IO expected");
}
rb_ary_push(ary, obj);
@@ -1496,7 +1496,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
rb_secure(4);
vopts = Qnil;
- if (0 < argc && TYPE(argv[argc-1]) == T_HASH)
+ if (0 < argc && RB_TYPE_P(argv[argc-1], T_HASH))
vopts = argv[--argc];
rb_scan_args(argc, argv, "03", &vmaxdatlen, &vflags, &vmaxctllen);
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 8c409f1..a7391c9 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -673,25 +673,25 @@ make_inspectname(VALUE node, VALUE service, struct addrinfo *res)
sizeof(hbuf), pbuf, sizeof(pbuf),
NI_NUMERICHOST|NI_NUMERICSERV);
if (ret == 0) {
- if (TYPE(node) == T_STRING && strcmp(hbuf, RSTRING_PTR(node)) == 0)
+ if (RB_TYPE_P(node, T_STRING) && strcmp(hbuf, RSTRING_PTR(node)) == 0)
node = Qnil;
- if (TYPE(service) == T_STRING && strcmp(pbuf, RSTRING_PTR(service)) == 0)
+ if (RB_TYPE_P(service, T_STRING) && strcmp(pbuf, RSTRING_PTR(service)) == 0)
service = Qnil;
- else if (TYPE(service) == T_FIXNUM && atoi(pbuf) == FIX2INT(service))
+ else if (RB_TYPE_P(service, T_FIXNUM) && atoi(pbuf) == FIX2INT(service))
service = Qnil;
}
}
- if (TYPE(node) == T_STRING) {
+ if (RB_TYPE_P(node, T_STRING)) {
inspectname = rb_str_dup(node);
}
- if (TYPE(service) == T_STRING) {
+ if (RB_TYPE_P(service, T_STRING)) {
if (NIL_P(inspectname))
inspectname = rb_sprintf(":%s", StringValueCStr(service));
else
rb_str_catf(inspectname, ":%s", StringValueCStr(service));
}
- else if (TYPE(service) == T_FIXNUM && FIX2INT(service) != 0)
+ else if (RB_TYPE_P(service, T_FIXNUM) && FIX2INT(service) != 0)
{
if (NIL_P(inspectname))
inspectname = rb_sprintf(":%d", FIX2INT(service));