mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Fixed many warnings in following files:
src/slic3r/Config/Snapshot.cpp src/slic3r/GUI/Field.cpp src/slic3r/GUI/GLToolbar.cpp src/slic3r/GUI/GUI_ObjectList.cpp src/slic3r/GUI/GUI_ObjectList.hpp src/slic3r/GUI/Plater.cpp src/slic3r/GUI/Plater.hpp src/slic3r/GUI/PresetBundle.cpp src/slic3r/GUI/Tab.cpp src/slic3r/GUI/wxExtensions.cpp
This commit is contained in:
parent
4585618aea
commit
86b258f727
10 changed files with 57 additions and 59 deletions
|
@ -940,7 +940,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
// node can be deleted by the Delete, let's check its type while we safely can
|
||||
bool is_instance_root = (node->m_type & itInstanceRoot);
|
||||
|
||||
for (int i = node->GetChildCount() - 1; i >= (is_instance_root ? 1 : 0); i--)
|
||||
for (int i = int(node->GetChildCount() - 1); i >= (is_instance_root ? 1 : 0); i--)
|
||||
Delete(wxDataViewItem(node->GetNthChild(i)));
|
||||
|
||||
return parent;
|
||||
|
@ -1020,7 +1020,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
{
|
||||
int vol_cnt = 0;
|
||||
int vol_idx = 0;
|
||||
for (int i = 0; i < node_parent->GetChildCount(); ++i) {
|
||||
for (size_t i = 0; i < node_parent->GetChildCount(); ++i) {
|
||||
if (node_parent->GetNthChild(i)->GetType() == itVolume) {
|
||||
vol_idx = i;
|
||||
vol_cnt++;
|
||||
|
@ -1059,7 +1059,7 @@ wxDataViewItem ObjectDataViewModel::Delete(const wxDataViewItem &item)
|
|||
else
|
||||
{
|
||||
auto it = find(m_objects.begin(), m_objects.end(), node);
|
||||
auto id = it - m_objects.begin();
|
||||
size_t id = it - m_objects.begin();
|
||||
if (it != m_objects.end())
|
||||
{
|
||||
// Delete all sub-items
|
||||
|
@ -1230,7 +1230,7 @@ void ObjectDataViewModel::DeleteSettings(const wxDataViewItem& parent)
|
|||
|
||||
wxDataViewItem ObjectDataViewModel::GetItemById(int obj_idx)
|
||||
{
|
||||
if (obj_idx >= m_objects.size())
|
||||
if (size_t(obj_idx) >= m_objects.size())
|
||||
{
|
||||
printf("Error! Out of objects range.\n");
|
||||
return wxDataViewItem(0);
|
||||
|
@ -1241,7 +1241,7 @@ wxDataViewItem ObjectDataViewModel::GetItemById(int obj_idx)
|
|||
|
||||
wxDataViewItem ObjectDataViewModel::GetItemByVolumeId(int obj_idx, int volume_idx)
|
||||
{
|
||||
if (obj_idx >= m_objects.size() || obj_idx < 0) {
|
||||
if (size_t(obj_idx) >= m_objects.size()) {
|
||||
printf("Error! Out of objects range.\n");
|
||||
return wxDataViewItem(0);
|
||||
}
|
||||
|
@ -1265,7 +1265,7 @@ wxDataViewItem ObjectDataViewModel::GetItemByVolumeId(int obj_idx, int volume_id
|
|||
|
||||
wxDataViewItem ObjectDataViewModel::GetItemById(const int obj_idx, const int sub_obj_idx, const ItemType parent_type)
|
||||
{
|
||||
if (obj_idx >= m_objects.size() || obj_idx < 0) {
|
||||
if (size_t(obj_idx) >= m_objects.size()) {
|
||||
printf("Error! Out of objects range.\n");
|
||||
return wxDataViewItem(0);
|
||||
}
|
||||
|
@ -1294,7 +1294,7 @@ wxDataViewItem ObjectDataViewModel::GetItemByLayerId(int obj_idx, int layer_idx)
|
|||
|
||||
wxDataViewItem ObjectDataViewModel::GetItemByLayerRange(const int obj_idx, const t_layer_height_range& layer_range)
|
||||
{
|
||||
if (obj_idx >= m_objects.size() || obj_idx < 0) {
|
||||
if (size_t(obj_idx) >= m_objects.size()) {
|
||||
printf("Error! Out of objects range.\n");
|
||||
return wxDataViewItem(0);
|
||||
}
|
||||
|
@ -1411,13 +1411,13 @@ int ObjectDataViewModel::GetRowByItem(const wxDataViewItem& item) const
|
|||
|
||||
int row_num = 0;
|
||||
|
||||
for (int i = 0; i < m_objects.size(); i++)
|
||||
for (size_t i = 0; i < m_objects.size(); i++)
|
||||
{
|
||||
row_num++;
|
||||
if (item == wxDataViewItem(m_objects[i]))
|
||||
return row_num;
|
||||
|
||||
for (int j = 0; j < m_objects[i]->GetChildCount(); j++)
|
||||
for (size_t j = 0; j < m_objects[i]->GetChildCount(); j++)
|
||||
{
|
||||
row_num++;
|
||||
ObjectDataViewModelNode* cur_node = m_objects[i]->GetNthChild(j);
|
||||
|
@ -1429,7 +1429,7 @@ int ObjectDataViewModel::GetRowByItem(const wxDataViewItem& item) const
|
|||
if (cur_node->m_type == itInstanceRoot)
|
||||
{
|
||||
row_num++;
|
||||
for (int t = 0; t < cur_node->GetChildCount(); t++)
|
||||
for (size_t t = 0; t < cur_node->GetChildCount(); t++)
|
||||
{
|
||||
row_num++;
|
||||
if (item == wxDataViewItem(cur_node->GetNthChild(t)))
|
||||
|
@ -1503,7 +1503,7 @@ bool ObjectDataViewModel::SetValue(const wxVariant &variant, const wxDataViewIte
|
|||
|
||||
bool ObjectDataViewModel::SetValue(const wxVariant &variant, const int item_idx, unsigned int col)
|
||||
{
|
||||
if (item_idx < 0 || item_idx >= m_objects.size())
|
||||
if (size_t(item_idx) >= m_objects.size())
|
||||
return false;
|
||||
|
||||
return m_objects[item_idx]->SetValue(variant, col);
|
||||
|
@ -1662,7 +1662,7 @@ wxDataViewItem ObjectDataViewModel::GetItemByType(const wxDataViewItem &parent_i
|
|||
if (node->GetChildCount() == 0)
|
||||
return wxDataViewItem(0);
|
||||
|
||||
for (int i = 0; i < node->GetChildCount(); i++) {
|
||||
for (size_t i = 0; i < node->GetChildCount(); i++) {
|
||||
if (node->GetNthChild(i)->m_type == type)
|
||||
return wxDataViewItem((void*)node->GetNthChild(i));
|
||||
}
|
||||
|
@ -2145,7 +2145,7 @@ void DoubleSlider::draw_scroll_line(wxDC& dc, const int lower_pos, const int hig
|
|||
wxCoord segm_end_x = is_horizontal() ? higher_pos : width*0.5 - 1;
|
||||
wxCoord segm_end_y = is_horizontal() ? height*0.5 - 1 : higher_pos-1;
|
||||
|
||||
for (int id = 0; id < m_line_pens.size(); id++)
|
||||
for (size_t id = 0; id < m_line_pens.size(); id++)
|
||||
{
|
||||
dc.SetPen(*m_line_pens[id]);
|
||||
dc.DrawLine(line_beg_x, line_beg_y, line_end_x, line_end_y);
|
||||
|
@ -2494,7 +2494,7 @@ void DoubleSlider::draw_colored_band(wxDC& dc)
|
|||
dc.SetBrush(clr);
|
||||
dc.DrawRectangle(main_band);
|
||||
|
||||
int i = 1;
|
||||
size_t i = 1;
|
||||
for (auto tick : m_ticks)
|
||||
{
|
||||
if (i == colors_cnt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue