More reduction of warnings on MSVC

This commit is contained in:
Matthias Köfferlein 2018-08-29 07:28:51 +02:00
parent af50c0f0c3
commit f0f3025f9f
11 changed files with 27 additions and 21 deletions

View File

@ -159,7 +159,7 @@ InstPropertiesPage::display_mode_changed (bool)
void
InstPropertiesPage::back ()
{
m_index = m_selection_ptrs.size ();
m_index = (unsigned int) m_selection_ptrs.size ();
}
void

View File

@ -190,7 +190,7 @@ public:
unsigned int size () const
{
return m_common_inst.size ();
return (unsigned int) m_common_inst.size ();
}
unsigned int cv_index () const

View File

@ -73,7 +73,7 @@ ShapePropertiesPage::setup ()
void
ShapePropertiesPage::back ()
{
m_index = m_selection_ptrs.size ();
m_index = (unsigned int) m_selection_ptrs.size ();
}
void

View File

@ -25,6 +25,8 @@
TEST(1)
{
EXPECT_EQ (1, 1); // avoids a compiler warning because of unreferenced _this
// TODO: add tests for edt specific things
throw tl::CancelException (); // skip this test to indicate that there is nothing yet
}

View File

@ -82,11 +82,11 @@ struct cmp_cell_tree_item_vs_name_f
// --------------------------------------------------------------------
// CellTreeItem implementation
CellTreeItem::CellTreeItem (const db::Layout *layout, CellTreeItem *parent, bool is_pcell, size_t cell_index, bool flat, CellTreeModel::Sorting s)
: mp_layout (layout), mp_parent (parent), m_sorting (s), m_is_pcell (is_pcell), m_index (0), m_children (), m_cell_index (cell_index)
CellTreeItem::CellTreeItem (const db::Layout *layout, CellTreeItem *parent, bool is_pcell, size_t cell_or_pcell_index, bool flat, CellTreeModel::Sorting s)
: mp_layout (layout), mp_parent (parent), m_sorting (s), m_is_pcell (is_pcell), m_index (0), m_children (), m_cell_or_pcell_index (cell_or_pcell_index)
{
if (! flat && ! is_pcell) {
m_child_count = mp_layout->cell (m_cell_index).child_cells ();
m_child_count = int (mp_layout->cell (cell_index ()).child_cells ());
} else {
m_child_count = 0;
}
@ -105,8 +105,8 @@ CellTreeItem::display_text () const
{
if (m_is_pcell) {
return name ();
} else if (mp_layout->is_valid_cell_index (m_cell_index)) {
return mp_layout->cell (m_cell_index).get_display_name ();
} else if (mp_layout->is_valid_cell_index (cell_index ())) {
return mp_layout->cell (cell_index ()).get_display_name ();
} else {
return std::string ();
}
@ -125,7 +125,7 @@ CellTreeItem::child (int index)
// create a list of child sub-item
const db::Cell *cell = & mp_layout->cell (m_cell_index);
const db::Cell *cell = & mp_layout->cell (cell_index ());
m_children.reserve (m_child_count);
@ -148,7 +148,7 @@ CellTreeItem::child (int index)
db::cell_index_type
CellTreeItem::cell_index () const
{
return m_cell_index;
return db::cell_index_type (m_cell_or_pcell_index);
}
CellTreeItem *
@ -161,9 +161,9 @@ const char *
CellTreeItem::name () const
{
if (! m_is_pcell) {
return mp_layout->cell_name (m_cell_index);
return mp_layout->cell_name (cell_index ());
} else {
return mp_layout->pcell_header (m_cell_index)->get_name ().c_str ();
return mp_layout->pcell_header (m_cell_or_pcell_index)->get_name ().c_str ();
}
}
@ -214,7 +214,7 @@ CellTreeItem::by_area_less_than (const CellTreeItem *b) const
return m_is_pcell > b->is_pcell ();
}
// Hint: since mp_layout == b.mp_layout, not conversion to um^2 is required because of different DBU
return mp_layout->cell (m_cell_index).bbox ().area () < b->mp_layout->cell (b->m_cell_index).bbox ().area ();
return mp_layout->cell (cell_index ()).bbox ().area () < b->mp_layout->cell (b->cell_index ()).bbox ().area ();
}
bool
@ -224,7 +224,7 @@ CellTreeItem::by_area_equal_than (const CellTreeItem *b) const
return false;
}
// Hint: since mp_layout == b.mp_layout, not conversion to um^2 is required because of different DBU
return mp_layout->cell (m_cell_index).bbox ().area () == b->mp_layout->cell (b->m_cell_index).bbox ().area ();
return mp_layout->cell (cell_index ()).bbox ().area () == b->mp_layout->cell (b->cell_index ()).bbox ().area ();
}
// --------------------------------------------------------------------

View File

@ -241,7 +241,7 @@ private:
class CellTreeItem
{
public:
CellTreeItem (const db::Layout *layout, CellTreeItem *parent, bool is_pcell, size_t cell_index, bool flat, CellTreeModel::Sorting sorting);
CellTreeItem (const db::Layout *layout, CellTreeItem *parent, bool is_pcell, size_t cell_or_pcell_index, bool flat, CellTreeModel::Sorting sorting);
~CellTreeItem ();
int children () const;
@ -279,7 +279,7 @@ private:
size_t m_index;
std::vector<CellTreeItem *> m_children;
int m_child_count;
size_t m_cell_index;
size_t m_cell_or_pcell_index;
const char *name () const;
};

View File

@ -124,7 +124,7 @@ ColorPalette::color_by_index (unsigned int n) const
unsigned int
ColorPalette::colors () const
{
return m_colors.size ();
return (unsigned int) m_colors.size ();
}
unsigned int
@ -136,7 +136,7 @@ ColorPalette::luminous_color_index_by_index (unsigned int n) const
unsigned int
ColorPalette::luminous_colors () const
{
return m_luminous_color_indices.size ();
return (unsigned int) m_luminous_color_indices.size ();
}
void

View File

@ -326,9 +326,9 @@ public:
int x = p.x (), y = p.y ();
if (halign < 0) {
x -= ff.width () * strlen (t);
x -= ff.width () * int (strlen (t));
} else if (halign == 0) {
x -= ff.width () * strlen (t) / 2;
x -= ff.width () * int (strlen (t)) / 2;
}
if (valign < 0) {

View File

@ -89,7 +89,7 @@ LineStylePalette::style_by_index (unsigned int n) const
unsigned int
LineStylePalette::styles () const
{
return m_styles.size ();
return (unsigned int) m_styles.size ();
}
void

View File

@ -25,6 +25,8 @@
TEST(1)
{
EXPECT_EQ (1, 1); // avoids a compiler warning because of unreferenced _this
// TODO: add tests for lib specific things
throw tl::CancelException (); // skip this test to indicate that there is nothing yet
}

View File

@ -25,6 +25,8 @@
TEST(1)
{
EXPECT_EQ (1, 1); // avoids a compiler warning because of unreferenced _this
// TODO: add tests for lym specific things
throw tl::CancelException (); // skip this test to indicate that there is nothing yet
}