Adjustments for Windows build with MSVC2019 (VC 16.10.31419.357)

1. removed some duplicate symbol linker error
2. removed many compiler warnings (mainly size_t/int compatibility)
3. consistent definition of db::pcell_id_type
4. removed UTF-8 character codes from string constants
5. float constants for float arguments
6. timeout in tlHttp when no openssl lib is found (instead of stalling
   app)
This commit is contained in:
klayoutmatthias
2021-07-17 00:20:55 +02:00
parent 7031c6faf4
commit 1555daf68c
41 changed files with 3216 additions and 3200 deletions
+4 -4
View File
@@ -86,13 +86,13 @@ struct cmp_cell_tree_item_vs_name_f
// --------------------------------------------------------------------
// CellTreeItem implementation
CellTreeItem::CellTreeItem (const db::Layout *layout, bool is_pcell, size_t cell_or_pcell_index, bool flat, CellTreeModel::Sorting s)
CellTreeItem::CellTreeItem (const db::Layout *layout, bool is_pcell, unsigned int cell_or_pcell_index, bool flat, CellTreeModel::Sorting s)
: mp_layout (layout), mp_parent (0), m_sorting (s), m_is_pcell (is_pcell),
m_index (0), m_tree_index (0),
m_children (), m_cell_or_pcell_index (cell_or_pcell_index)
{
if (! flat && ! is_pcell) {
m_child_count = int (mp_layout->cell (cell_or_pcell_index).child_cells ());
m_child_count = int (mp_layout->cell (db::cell_index_type (cell_or_pcell_index)).child_cells ());
} else {
m_child_count = 0;
}
@@ -143,7 +143,7 @@ CellTreeItem::children () const
int
CellTreeItem::children_in (const std::set<const CellTreeItem *> &sel) const
{
size_t count = 0;
int count = 0;
for (std::vector<CellTreeItem *>::const_iterator c = m_children.begin (); c != m_children.end (); ++c) {
if (sel.find (*c) != sel.end ()) {
++count;
@@ -885,7 +885,7 @@ CellTreeModel::rowCount (const QModelIndex &parent) const
}
} else {
if (m_filter_mode && m_is_filtered) {
size_t n = 0;
int n = 0;
for (std::vector <CellTreeItem *>::const_iterator i = m_toplevel.begin (); i != m_toplevel.end (); ++i) {
if (m_visible_cell_set.find (*i) != m_visible_cell_set.end ()) {
++n;
+2 -2
View File
@@ -283,7 +283,7 @@ private:
class CellTreeItem
{
public:
CellTreeItem (const db::Layout *layout, bool is_pcell, size_t cell_or_pcell_index, bool flat, CellTreeModel::Sorting sorting);
CellTreeItem (const db::Layout *layout, bool is_pcell, unsigned int cell_or_pcell_index, bool flat, CellTreeModel::Sorting sorting);
~CellTreeItem ();
int children () const;
@@ -338,7 +338,7 @@ private:
size_t m_index, m_tree_index;
std::vector<CellTreeItem *> m_children;
int m_child_count;
size_t m_cell_or_pcell_index;
unsigned int m_cell_or_pcell_index;
const char *name () const;
void ensure_children ();
+1 -1
View File
@@ -440,7 +440,7 @@ LayerTreeModel::signal_layers_changed ()
for (QModelIndexList::const_iterator i = indexes.begin (); i != indexes.end (); ++i) {
lay::LayerPropertiesConstIterator li = iterator (*i);
if (! li.at_end ()) {
new_indexes.push_back (createIndex (li.child_index (), i->column (), (void *) (li.uint () + m_id_start)));
new_indexes.push_back (createIndex (int (li.child_index ()), i->column (), (void *) (li.uint () + m_id_start)));
} else {
new_indexes.push_back (QModelIndex ());
}
+4 -4
View File
@@ -669,8 +669,8 @@ LibrariesView::do_update_content (int lib_index)
mp_cell_lists.pop_back ();
}
for (unsigned int i = imin; i < m_libraries.size () && i < (unsigned int) mp_selector->count () && i <= imax; ++i) {
mp_selector->setItemText (i, tl::to_qstring (display_string (i)));
for (size_t i = imin; i < m_libraries.size () && i < mp_selector->count () && i <= imax; ++i) {
mp_selector->setItemText (int (i), tl::to_qstring (display_string (int (i))));
}
while (mp_selector->count () < int (m_libraries.size ())) {
mp_selector->addItem (tl::to_qstring (display_string (mp_selector->count ())));
@@ -687,11 +687,11 @@ LibrariesView::do_update_content (int lib_index)
mp_selector->setCurrentIndex (m_active_index);
mp_selector->setVisible (mp_cell_lists.size () > 1 && ! split_mode);
for (unsigned int i = imin; i < m_libraries.size () && i <= imax; ++i) {
for (size_t i = imin; i < m_libraries.size () && i <= imax; ++i) {
if (m_needs_update [i]) {
mp_cell_list_headers [i]->setText (tl::to_qstring (display_string (i)));
mp_cell_list_headers [i]->setText (tl::to_qstring (display_string (int (i))));
// draw the cells in the level of the current cell,
// add an "above" entry if there is a level above.
@@ -257,7 +257,7 @@ static std::string str_from_name (const Obj *obj, bool indicate_empty = false)
}
}
const std::string var_sep (" ");
const std::string var_sep (" \u21D4 ");
template <class Obj>
static std::string str_from_expanded_names (const std::pair<const Obj *, const Obj *> &objs, bool is_single)
@@ -3049,7 +3049,7 @@ NetlistBrowserModel::parent (const QModelIndex &index) const
if (! d || ! d->parent ()) {
return QModelIndex ();
} else {
return createIndex (d->parent ()->index (), 0, (void *) d->parent ());
return createIndex ((int) d->parent ()->index (), 0, (void *) d->parent ());
}
}
@@ -37,7 +37,7 @@ namespace lay
// ----------------------------------------------------------------------------------
// NetlistBrowserTreeModel implementation
const std::string var_sep (" ");
const std::string var_sep (" \u21D4 ");
static inline size_t pop (void *&idp, size_t n)
{
@@ -287,7 +287,7 @@ NetlistBrowserTreeModel::index_from_netpath (const NetlistObjectsPath &path) con
std::pair<const db::Circuit *, const db::Circuit *> cc = mp_indexer->child_circuit_from_index (circuit, n).first;
if (is_compatible (sc, cc)) {
circuit = cc;
idx = index (n, 0, idx);
idx = index (int (n), 0, idx);
break;
}
}
@@ -388,7 +388,7 @@ NetlistBrowserTreeModel::index (int row, int column, const QModelIndex &parent)
{
if (! parent.isValid ()) {
return createIndex (row, column, reinterpret_cast<void *> (row + 1));
return createIndex (row, column, reinterpret_cast<void *> (size_t (row + 1)));
} else {
@@ -253,7 +253,7 @@ TEST (2)
EXPECT_EQ (model->rowCount (QModelIndex ()), 4);
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::UserRole).toString ()), "INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "- INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "- \u21D4 INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, QModelIndex ()), Qt::DisplayRole).toString ()), "");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, QModelIndex ()), Qt::DisplayRole).toString ()), "INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "INV2");
@@ -308,7 +308,7 @@ TEST (2)
// first of nets in INV2 circuit
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::UserRole).toString ()), "$1|1");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::DisplayRole).toString ()), "$1 1");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::DisplayRole).toString ()), "$1 \u21D4 1");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, sn_nets), Qt::DisplayRole).toString ()), "$1 (2)");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, sn_nets), Qt::DisplayRole).toString ()), "1 (2)");
@@ -349,7 +349,7 @@ TEST (2)
// second of nets in INV2 circuit
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, sn_nets), Qt::UserRole).toString ()), "BULK|6");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, sn_nets), Qt::DisplayRole).toString ()), "BULK 6");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, sn_nets), Qt::DisplayRole).toString ()), "BULK \u21D4 6");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, sn_nets), Qt::DisplayRole).toString ()), "BULK (2)");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, sn_nets), Qt::DisplayRole).toString ()), "6 (2)");
@@ -371,13 +371,13 @@ TEST (2)
// first of pins in INV2 circuit
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_pins), Qt::UserRole).toString ()), "$4");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_pins), Qt::DisplayRole).toString ()), "- $4");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_pins), Qt::DisplayRole).toString ()), "- \u21D4 $4");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, sn_pins), Qt::DisplayRole).toString ()), "");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, sn_pins), Qt::DisplayRole).toString ()), "");
// first of nets in INV2 circuit
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::UserRole).toString ()), "$4");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::DisplayRole).toString ()), "$4 -");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::DisplayRole).toString ()), "$4 \u21D4 -");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, sn_nets), Qt::DisplayRole).toString ()), "$4 (3)");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, sn_nets), Qt::DisplayRole).toString ()), "");
@@ -401,7 +401,7 @@ TEST (2)
// The first subcircuit
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::UserRole).toString ()), "OUT|INV2|$1");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::DisplayRole).toString ()), "OUT - / <a href='int:netlist?path=1'>INV2 -</a>");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::DisplayRole).toString ()), "OUT \u21D4 - / <a href='int:netlist?path=1'>INV2 \u21D4 -</a>");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2PairNet0Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=2,2,1'>$1</a>");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2PairNet0Index), Qt::DisplayRole).toString ()), "");
}
@@ -66,7 +66,7 @@ TEST (2)
// two top circuits
EXPECT_EQ (model->rowCount (QModelIndex ()), 2);
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::UserRole).toString ()), "INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "- INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "- \u21D4 INV2PAIRX");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, QModelIndex ()), Qt::UserRole).toString ()), "RINGO|RINGO");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, QModelIndex ()), Qt::DisplayRole).toString ()), "RINGO");
EXPECT_EQ (model->parent (model->index (0, 0, QModelIndex ())).isValid (), false);
@@ -92,9 +92,9 @@ TEST (2)
EXPECT_EQ (model->parent (inv2PairIndex) == ringoIndex, true);
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairIndex), Qt::UserRole).toString ()), "INV2");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairIndex), Qt::DisplayRole).toString ()), "- INV2");
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairIndex), Qt::DisplayRole).toString ()), "- \u21D4 INV2");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairIndex), Qt::UserRole).toString ()), "INV2");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairIndex), Qt::DisplayRole).toString ()), "INV2 -");
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairIndex), Qt::DisplayRole).toString ()), "INV2 \u21D4 -");
EXPECT_EQ (model->hasChildren (model->index (0, 0, inv2PairIndex)), false);
EXPECT_EQ (model->rowCount (model->index (0, 0, inv2PairIndex)), 0);