Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
ruby
提交
d8720eb7
R
ruby
项目概览
张重言
/
ruby
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
ruby
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d8720eb7
编写于
4月 08, 2020
作者:
N
Nobuyoshi Nakada
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Suppress -Wshorten-64-to-32 warnings
上级
6163a4e1
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
35 addition
and
35 deletion
+35
-35
ext/bigdecimal/bigdecimal.c
ext/bigdecimal/bigdecimal.c
+5
-5
ext/digest/digest.c
ext/digest/digest.c
+3
-3
ext/etc/etc.c
ext/etc/etc.c
+2
-2
ext/openssl/ossl_ssl.c
ext/openssl/ossl_ssl.c
+1
-1
ext/psych/psych.c
ext/psych/psych.c
+3
-3
ext/psych/psych_parser.c
ext/psych/psych_parser.c
+17
-17
ext/strscan/strscan.c
ext/strscan/strscan.c
+3
-3
spec/ruby/optional/capi/ext/numeric_spec.c
spec/ruby/optional/capi/ext/numeric_spec.c
+1
-1
未找到文件。
ext/bigdecimal/bigdecimal.c
浏览文件 @
d8720eb7
...
...
@@ -343,8 +343,8 @@ BigDecimal_prec(VALUE self)
VALUE
obj
;
GUARD_OBJ
(
p
,
GetVpValue
(
self
,
1
));
obj
=
rb_assoc_new
(
IN
T2NUM
(
p
->
Prec
*
VpBaseFig
()),
IN
T2NUM
(
p
->
MaxPrec
*
VpBaseFig
()));
obj
=
rb_assoc_new
(
SIZE
T2NUM
(
p
->
Prec
*
VpBaseFig
()),
SIZE
T2NUM
(
p
->
MaxPrec
*
VpBaseFig
()));
return
obj
;
}
...
...
@@ -2132,7 +2132,7 @@ BigDecimal_split(VALUE self)
rb_ary_push
(
obj
,
str
);
rb_str_resize
(
str
,
strlen
(
psz1
));
rb_ary_push
(
obj
,
INT2FIX
(
10
));
rb_ary_push
(
obj
,
IN
T2NUM
(
e
));
rb_ary_push
(
obj
,
SSIZE
T2NUM
(
e
));
return
obj
;
}
...
...
@@ -2145,7 +2145,7 @@ static VALUE
BigDecimal_exponent
(
VALUE
self
)
{
ssize_t
e
=
VpExponent10
(
GetVpValue
(
self
,
1
));
return
IN
T2NUM
(
e
);
return
SSIZE
T2NUM
(
e
);
}
/* Returns a string representation of self.
...
...
@@ -2765,7 +2765,7 @@ static VALUE
BigDecimal_limit
(
int
argc
,
VALUE
*
argv
,
VALUE
self
)
{
VALUE
nFig
;
VALUE
nCur
=
IN
T2NUM
(
VpGetPrecLimit
());
VALUE
nCur
=
SIZE
T2NUM
(
VpGetPrecLimit
());
if
(
rb_scan_args
(
argc
,
argv
,
"01"
,
&
nFig
)
==
1
)
{
int
nf
;
...
...
ext/digest/digest.c
浏览文件 @
d8720eb7
...
...
@@ -406,7 +406,7 @@ rb_digest_instance_digest_length(VALUE self)
/* never blindly assume that #digest() returns a string */
StringValue
(
digest
);
return
INT
2NUM
(
RSTRING_LEN
(
digest
));
return
LONG
2NUM
(
RSTRING_LEN
(
digest
));
}
/*
...
...
@@ -725,7 +725,7 @@ rb_digest_base_digest_length(VALUE self)
algo
=
get_digest_obj_metadata
(
self
);
return
IN
T2NUM
(
algo
->
digest_len
);
return
SIZE
T2NUM
(
algo
->
digest_len
);
}
/*
...
...
@@ -740,7 +740,7 @@ rb_digest_base_block_length(VALUE self)
algo
=
get_digest_obj_metadata
(
self
);
return
IN
T2NUM
(
algo
->
block_len
);
return
SIZE
T2NUM
(
algo
->
block_len
);
}
void
...
...
ext/etc/etc.c
浏览文件 @
d8720eb7
...
...
@@ -142,7 +142,7 @@ setup_passwd(struct passwd *pwd)
safe_setup_filesystem_str
(
pwd
->
pw_dir
),
safe_setup_filesystem_str
(
pwd
->
pw_shell
),
#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
IN
T2NUM
(
pwd
->
pw_change
),
TIME
T2NUM
(
pwd
->
pw_change
),
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_QUOTA
INT2NUM
(
pwd
->
pw_quota
),
...
...
@@ -157,7 +157,7 @@ setup_passwd(struct passwd *pwd)
safe_setup_locale_str
(
pwd
->
pw_comment
),
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
IN
T2NUM
(
pwd
->
pw_expire
),
TIME
T2NUM
(
pwd
->
pw_expire
),
#endif
0
/*dummy*/
);
...
...
ext/openssl/ossl_ssl.c
浏览文件 @
d8720eb7
...
...
@@ -2324,7 +2324,7 @@ ossl_ssl_get_verify_result(VALUE self)
GetSSL
(
self
,
ssl
);
return
INT
2NUM
(
SSL_get_verify_result
(
ssl
));
return
LONG
2NUM
(
SSL_get_verify_result
(
ssl
));
}
/*
...
...
ext/psych/psych.c
浏览文件 @
d8720eb7
...
...
@@ -11,9 +11,9 @@ static VALUE libyaml_version(VALUE module)
yaml_get_version
(
&
major
,
&
minor
,
&
patch
);
list
[
0
]
=
INT2NUM
(
(
long
)
major
);
list
[
1
]
=
INT2NUM
(
(
long
)
minor
);
list
[
2
]
=
INT2NUM
(
(
long
)
patch
);
list
[
0
]
=
INT2NUM
(
major
);
list
[
1
]
=
INT2NUM
(
minor
);
list
[
2
]
=
INT2NUM
(
patch
);
return
rb_ary_new4
((
long
)
3
,
list
);
}
...
...
ext/psych/psych_parser.c
浏览文件 @
d8720eb7
...
...
@@ -27,7 +27,7 @@ static ID id_event_location;
static
int
io_reader
(
void
*
data
,
unsigned
char
*
buf
,
size_t
size
,
size_t
*
read
)
{
VALUE
io
=
(
VALUE
)
data
;
VALUE
string
=
rb_funcall
(
io
,
id_read
,
1
,
IN
T2NUM
(
size
));
VALUE
string
=
rb_funcall
(
io
,
id_read
,
1
,
SIZE
T2NUM
(
size
));
*
read
=
0
;
...
...
@@ -89,9 +89,9 @@ static VALUE make_exception(yaml_parser_t * parser, VALUE path)
return
rb_funcall
(
ePsychSyntaxError
,
rb_intern
(
"new"
),
6
,
path
,
IN
T2NUM
(
line
),
IN
T2NUM
(
column
),
IN
T2NUM
(
parser
->
problem_offset
),
SIZE
T2NUM
(
line
),
SIZE
T2NUM
(
column
),
SIZE
T2NUM
(
parser
->
problem_offset
),
parser
->
problem
?
rb_usascii_str_new2
(
parser
->
problem
)
:
Qnil
,
parser
->
context
?
rb_usascii_str_new2
(
parser
->
context
)
:
Qnil
);
}
...
...
@@ -303,10 +303,10 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
rb_exc_raise
(
exception
);
}
start_line
=
INT2NUM
((
long
)
event
.
start_mark
.
line
);
start_column
=
INT2NUM
((
long
)
event
.
start_mark
.
column
);
end_line
=
INT2NUM
((
long
)
event
.
end_mark
.
line
);
end_column
=
INT2NUM
((
long
)
event
.
end_mark
.
column
);
start_line
=
SIZET2NUM
(
event
.
start_mark
.
line
);
start_column
=
SIZET2NUM
(
event
.
start_mark
.
column
);
end_line
=
SIZET2NUM
(
event
.
end_mark
.
line
);
end_column
=
SIZET2NUM
(
event
.
end_mark
.
column
);
event_args
[
0
]
=
handler
;
event_args
[
1
]
=
start_line
;
...
...
@@ -321,7 +321,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE
args
[
2
];
args
[
0
]
=
handler
;
args
[
1
]
=
INT2NUM
(
(
long
)
event
.
data
.
stream_start
.
encoding
);
args
[
1
]
=
INT2NUM
(
event
.
data
.
stream_start
.
encoding
);
rb_protect
(
protected_start_stream
,
(
VALUE
)
args
,
&
state
);
}
break
;
...
...
@@ -334,8 +334,8 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE
version
=
event
.
data
.
document_start
.
version_directive
?
rb_ary_new3
(
(
long
)
2
,
INT2NUM
(
(
long
)
event
.
data
.
document_start
.
version_directive
->
major
),
INT2NUM
(
(
long
)
event
.
data
.
document_start
.
version_directive
->
minor
)
INT2NUM
(
event
.
data
.
document_start
.
version_directive
->
major
),
INT2NUM
(
event
.
data
.
document_start
.
version_directive
->
minor
)
)
:
rb_ary_new
();
if
(
event
.
data
.
document_start
.
tag_directives
.
start
)
{
...
...
@@ -418,7 +418,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
quoted_implicit
=
event
.
data
.
scalar
.
quoted_implicit
==
0
?
Qfalse
:
Qtrue
;
style
=
INT2NUM
(
(
long
)
event
.
data
.
scalar
.
style
);
style
=
INT2NUM
(
event
.
data
.
scalar
.
style
);
args
[
0
]
=
handler
;
args
[
1
]
=
val
;
...
...
@@ -450,7 +450,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
implicit
=
event
.
data
.
sequence_start
.
implicit
==
0
?
Qfalse
:
Qtrue
;
style
=
INT2NUM
(
(
long
)
event
.
data
.
sequence_start
.
style
);
style
=
INT2NUM
(
event
.
data
.
sequence_start
.
style
);
args
[
0
]
=
handler
;
args
[
1
]
=
anchor
;
...
...
@@ -483,7 +483,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
implicit
=
event
.
data
.
mapping_start
.
implicit
==
0
?
Qfalse
:
Qtrue
;
style
=
INT2NUM
(
(
long
)
event
.
data
.
mapping_start
.
style
);
style
=
INT2NUM
(
event
.
data
.
mapping_start
.
style
);
args
[
0
]
=
handler
;
args
[
1
]
=
anchor
;
...
...
@@ -527,9 +527,9 @@ static VALUE mark(VALUE self)
TypedData_Get_Struct
(
self
,
yaml_parser_t
,
&
psych_parser_type
,
parser
);
mark_klass
=
rb_const_get_at
(
cPsychParser
,
rb_intern
(
"Mark"
));
args
[
0
]
=
IN
T2NUM
(
parser
->
mark
.
index
);
args
[
1
]
=
IN
T2NUM
(
parser
->
mark
.
line
);
args
[
2
]
=
IN
T2NUM
(
parser
->
mark
.
column
);
args
[
0
]
=
SIZE
T2NUM
(
parser
->
mark
.
index
);
args
[
1
]
=
SIZE
T2NUM
(
parser
->
mark
.
line
);
args
[
2
]
=
SIZE
T2NUM
(
parser
->
mark
.
column
);
return
rb_class_new_instance
(
3
,
args
,
mark_klass
);
}
...
...
ext/strscan/strscan.c
浏览文件 @
d8720eb7
...
...
@@ -447,7 +447,7 @@ strscan_get_charpos(VALUE self)
GET_SCANNER
(
self
,
p
);
substr
=
rb_funcall
(
p
->
str
,
id_byteslice
,
2
,
INT2FIX
(
0
),
INT
2NUM
(
p
->
curr
));
substr
=
rb_funcall
(
p
->
str
,
id_byteslice
,
2
,
INT2FIX
(
0
),
LONG
2NUM
(
p
->
curr
));
return
rb_str_length
(
substr
);
}
...
...
@@ -473,7 +473,7 @@ strscan_set_pos(VALUE self, VALUE v)
if
(
i
<
0
)
rb_raise
(
rb_eRangeError
,
"index out of range"
);
if
(
i
>
S_LEN
(
p
))
rb_raise
(
rb_eRangeError
,
"index out of range"
);
p
->
curr
=
i
;
return
INT
2NUM
(
i
);
return
LONG
2NUM
(
i
);
}
static
inline
UChar
*
...
...
@@ -1107,7 +1107,7 @@ strscan_matched_size(VALUE self)
GET_SCANNER
(
self
,
p
);
if
(
!
MATCHED_P
(
p
))
return
Qnil
;
return
INT
2NUM
(
p
->
regs
.
end
[
0
]
-
p
->
regs
.
beg
[
0
]);
return
LONG
2NUM
(
p
->
regs
.
end
[
0
]
-
p
->
regs
.
beg
[
0
]);
}
static
int
...
...
spec/ruby/optional/capi/ext/numeric_spec.c
浏览文件 @
d8720eb7
...
...
@@ -54,7 +54,7 @@ static VALUE numeric_spec_NUM2INT(VALUE self, VALUE num) {
}
static
VALUE
numeric_spec_INT2NUM
(
VALUE
self
,
VALUE
num
)
{
return
INT2NUM
(
NUM2
LONG
(
num
));
return
INT2NUM
(
NUM2
INT
(
num
));
}
static
VALUE
numeric_spec_NUM2LONG
(
VALUE
self
,
VALUE
num
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录