Skip to content

Commit

Permalink
Fix NDRange construction from int64_t on 32 bit platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Sep 17, 2024
1 parent 8e097d0 commit 65a518c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/nd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,19 @@ StringName nd::ellipsis() {
}

Ref<NDRange> nd::from(int64_t start) {
return {memnew(NDRange(start, xt::placeholders::xtuph{}, xt::placeholders::xtuph{}))};
return {memnew(NDRange(
static_cast<std::ptrdiff_t>(start),
xt::placeholders::xtuph{},
xt::placeholders::xtuph{}
))};
}

Ref<NDRange> nd::to(int64_t stop) {
return {memnew(NDRange(xt::placeholders::xtuph{}, stop, xt::placeholders::xtuph{}))};
return {memnew(NDRange(
xt::placeholders::xtuph{},
static_cast<std::ptrdiff_t>(stop),
xt::placeholders::xtuph{}
))};
}

Ref<NDRange> nd::range(Variant start_or_stop, Variant stop, Variant step) {
Expand Down

0 comments on commit 65a518c

Please sign in to comment.