mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-06 05:56:37 +08:00
Handle possible narrowing of data type between unsigned long and signed long
This commit is contained in:
parent
f68231cdd9
commit
5431b5c2c5
@ -950,7 +950,13 @@ void Plater::set_number_of_copies() {
|
||||
long copies = -1;
|
||||
copies = wxGetNumberFromUser("", _("Enter the number of copies of the selected object:"), _("Copies"), model_object->instances.size(), 0, 1000, this);
|
||||
if (copies < 0) return;
|
||||
long diff {copies - model_object->instances.size() };
|
||||
long instance_count = 0;
|
||||
if (model_object->instances.size() <= LONG_MAX) {
|
||||
instance_count = static_cast<long>(model_object->instances.size());
|
||||
} else {
|
||||
instance_count = LONG_MAX;
|
||||
}
|
||||
long diff {copies - instance_count };
|
||||
|
||||
if (diff == 0) { this->resume_background_process(); }
|
||||
else if (diff > 0) { this->increase(diff); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user