mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
fix. (#302)
This commit is contained in:
parent
fb3c9a0399
commit
4e5021089c
@ -99,12 +99,12 @@ struct type_caster<T, std::enable_if_t<is_floating_point_v<T>>> {
|
|||||||
|
|
||||||
bool load(handle src, bool convert) {
|
bool load(handle src, bool convert) {
|
||||||
if(isinstance<pkbind::float_>(src)) {
|
if(isinstance<pkbind::float_>(src)) {
|
||||||
data = py_tofloat(src.ptr());
|
data = static_cast<T>(py_tofloat(src.ptr()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(convert && isinstance<pkbind::int_>(src)) {
|
if(convert && isinstance<pkbind::int_>(src)) {
|
||||||
data = py_toint(src.ptr());
|
data = static_cast<T>(py_toint(src.ptr()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user