mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 11:31:08 +02:00
Many warnings fixed for MSVC
This commit is contained in:
@@ -66,7 +66,7 @@ static unsigned int add_stipple1 (lay::LayoutView *view, const std::string &name
|
||||
lay::DitherPatternInfo p;
|
||||
p.set_name (name);
|
||||
if (bits > 0 && ! data.empty ()) {
|
||||
p.set_pattern (&(*data.begin ()), std::min (32u, bits), std::min (size_t (32), data.size ()));
|
||||
p.set_pattern (&(*data.begin ()), std::min (32u, bits), std::min (32u, (unsigned int) data.size ()));
|
||||
}
|
||||
unsigned int index = pattern.add_pattern (p);
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
*/
|
||||
unsigned int size () const
|
||||
{
|
||||
return m_events.size ();
|
||||
return int (m_events.size ());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -427,7 +427,7 @@ bitmaps_to_image_rgb (const std::vector<lay::ViewOp> &view_ops_in,
|
||||
bool transparent,
|
||||
QMutex *mutex)
|
||||
{
|
||||
unsigned int n_in = view_ops_in.size ();
|
||||
unsigned int n_in = (unsigned int) view_ops_in.size ();
|
||||
|
||||
std::vector<unsigned int> bm_map;
|
||||
std::vector<unsigned int> vo_map;
|
||||
@@ -607,7 +607,7 @@ bitmaps_to_image_rgb (const std::vector<lay::ViewOp> &view_ops_in,
|
||||
};
|
||||
|
||||
dptr = dptr_end - nwords + i;
|
||||
for (int j = masks.size () - 1; j >= 0; --j) {
|
||||
for (int j = int (masks.size () - 1); j >= 0; --j) {
|
||||
|
||||
uint32_t d = *dptr;
|
||||
if (d != 0) {
|
||||
@@ -660,7 +660,7 @@ bitmaps_to_image_mono (const std::vector<lay::ViewOp> &view_ops_in,
|
||||
bool use_bitmap_index,
|
||||
QMutex *mutex)
|
||||
{
|
||||
unsigned int n_in = view_ops_in.size ();
|
||||
unsigned int n_in = (unsigned int) view_ops_in.size ();
|
||||
|
||||
std::vector<unsigned int> bm_map;
|
||||
std::vector<unsigned int> vo_map;
|
||||
@@ -820,7 +820,7 @@ bitmaps_to_image_mono (const std::vector<lay::ViewOp> &view_ops_in,
|
||||
uint32_t z = lay::wordones;
|
||||
|
||||
dptr = dptr_end - nwords + i;
|
||||
for (int j = masks.size () - 1; j >= 0; --j) {
|
||||
for (int j = int (masks.size () - 1); j >= 0; --j) {
|
||||
uint32_t d = *dptr;
|
||||
if (d != 0) {
|
||||
uint32_t m = 1;
|
||||
|
||||
@@ -119,7 +119,7 @@ ConfigurationDialog::init (const lay::PluginDeclaration *decl)
|
||||
}
|
||||
|
||||
void
|
||||
ConfigurationDialog::commit () throw (tl::Exception)
|
||||
ConfigurationDialog::commit ()
|
||||
{
|
||||
for (std::vector <lay::ConfigPage *>::iterator p = m_config_pages.begin (); p != m_config_pages.end (); ++p) {
|
||||
(*p)->commit (mp_root);
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
ConfigurationDialog (QWidget *parent, lay::PluginRoot *root, const std::string &plugin_name, const char *name = "");
|
||||
~ConfigurationDialog ();
|
||||
|
||||
void commit () throw (tl::Exception);
|
||||
void commit ();
|
||||
|
||||
public slots:
|
||||
virtual void ok_clicked ();
|
||||
|
||||
@@ -951,13 +951,13 @@ DitherPattern::merge (const DitherPattern &other, std::map<unsigned int, unsigne
|
||||
{
|
||||
// insert the standard pattern into the map (for completeness)
|
||||
for (iterator c = begin (); c != begin_custom (); ++c) {
|
||||
index_map.insert (std::make_pair (std::distance (begin (), c), std::distance (begin (), c)));
|
||||
index_map.insert (std::make_pair ((unsigned int) std::distance (begin (), c), (unsigned int) std::distance (begin (), c)));
|
||||
}
|
||||
|
||||
// build an index of present pattern
|
||||
std::map <DitherPatternInfo, unsigned int, pattern_less_f> patterns;
|
||||
for (iterator c = begin_custom (); c != end (); ++c) {
|
||||
patterns.insert (std::make_pair (*c, std::distance (begin (), c)));
|
||||
patterns.insert (std::make_pair (*c, (unsigned int) std::distance (begin (), c)));
|
||||
}
|
||||
|
||||
// map the pattern of other into *this, possibly creating new ones
|
||||
@@ -970,7 +970,7 @@ DitherPattern::merge (const DitherPattern &other, std::map<unsigned int, unsigne
|
||||
} else {
|
||||
new_index = p->second;
|
||||
}
|
||||
index_map.insert (std::make_pair (std::distance (other.begin (), c), new_index));
|
||||
index_map.insert (std::make_pair ((unsigned int) std::distance (other.begin (), c), new_index));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ Finder::start (lay::LayoutView *view, const lay::CellView &cv, unsigned int cv_i
|
||||
m_path.erase (m_path.begin (), m_path.end ());
|
||||
|
||||
for (std::vector<db::ICplxTrans>::const_iterator t = trans.begin (); t != trans.end (); ++t) {
|
||||
do_find (*cv.cell (), cv.specific_path ().size (), *t * cv.context_trans ());
|
||||
do_find (*cv.cell (), int (cv.specific_path ().size ()), *t * cv.context_trans ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ LayerTreeModel::parent (const QModelIndex &index) const
|
||||
} else {
|
||||
// It is important that the column index of the parent is 0.
|
||||
// Otherwise the tree view will not behave as expected.
|
||||
return createIndex (iter.child_index (), 0, (void *) (iter.uint () + m_id_start));
|
||||
return createIndex (int (iter.child_index ()), 0, (void *) (iter.uint () + m_id_start));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -296,7 +296,7 @@ LayoutView::LayoutView (lay::LayoutView *source, db::Manager *manager, bool edit
|
||||
} else {
|
||||
*m_layer_properties_lists [i] = *source->m_layer_properties_lists [i];
|
||||
}
|
||||
m_layer_properties_lists [i]->attach_view (this, i);
|
||||
m_layer_properties_lists [i]->attach_view (this, (unsigned int) i);
|
||||
}
|
||||
|
||||
if (! m_layer_properties_lists.empty ()) {
|
||||
@@ -434,7 +434,7 @@ LayoutView::init (db::Manager *mgr, lay::PluginRoot *root, QWidget * /*parent*/)
|
||||
m_copy_layerr = -1;
|
||||
|
||||
m_layer_properties_lists.push_back (new LayerPropertiesList ());
|
||||
m_layer_properties_lists.back ()->attach_view (this, m_layer_properties_lists.size () - 1);
|
||||
m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1));
|
||||
m_current_layer_list = 0;
|
||||
|
||||
QVBoxLayout *vbl = new QVBoxLayout (this);
|
||||
@@ -1764,7 +1764,7 @@ LayoutView::set_properties (unsigned int index, const LayerPropertiesList &props
|
||||
return;
|
||||
} else {
|
||||
m_layer_properties_lists.push_back (new LayerPropertiesList ());
|
||||
m_layer_properties_lists.back ()->attach_view (this, m_layer_properties_lists.size () - 1);
|
||||
m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1833,7 +1833,7 @@ LayoutView::replace_layer_node (unsigned int index, const LayerPropertiesConstIt
|
||||
if (*iter != node) {
|
||||
|
||||
if (transacting ()) {
|
||||
manager ()->queue (this, new OpSetLayerPropsNode (index, iter.uint (), *iter, node));
|
||||
manager ()->queue (this, new OpSetLayerPropsNode (index, (unsigned int) iter.uint (), *iter, node));
|
||||
} else if (manager () && ! replaying ()) {
|
||||
manager ()->clear ();
|
||||
}
|
||||
@@ -1867,7 +1867,7 @@ LayoutView::set_properties (unsigned int index, const LayerPropertiesConstIterat
|
||||
if (l != props) {
|
||||
|
||||
if (transacting ()) {
|
||||
manager ()->queue (this, new OpSetLayerProps (index, iter.uint (), l, props));
|
||||
manager ()->queue (this, new OpSetLayerProps (index, (unsigned int) iter.uint (), l, props));
|
||||
} else if (manager () && ! replaying ()) {
|
||||
manager ()->clear ();
|
||||
}
|
||||
@@ -1902,7 +1902,7 @@ const LayerPropertiesNode &
|
||||
LayoutView::insert_layer (unsigned int index, const LayerPropertiesConstIterator &before, const LayerPropertiesNode &node)
|
||||
{
|
||||
if (transacting ()) {
|
||||
manager ()->queue (this, new OpInsertLayerProps (index, before.uint (), node));
|
||||
manager ()->queue (this, new OpInsertLayerProps (index, (unsigned int) before.uint (), node));
|
||||
} else if (manager () && ! replaying ()) {
|
||||
manager ()->clear ();
|
||||
}
|
||||
@@ -1935,7 +1935,7 @@ LayoutView::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter
|
||||
m_layer_properties_lists [index]->erase (LayerPropertiesIterator (*m_layer_properties_lists [index], iter.uint ()));
|
||||
|
||||
if (transacting ()) {
|
||||
manager ()->queue (this, new OpDeleteLayerProps (index, iter.uint (), orig));
|
||||
manager ()->queue (this, new OpDeleteLayerProps (index, (unsigned int) iter.uint (), orig));
|
||||
} else if (manager () && ! replaying ()) {
|
||||
manager ()->clear ();
|
||||
}
|
||||
@@ -3313,12 +3313,12 @@ LayoutView::merge_layer_props (const std::vector<lay::LayerPropertiesList> &prop
|
||||
std::vector<lay::LayerPropertiesList>::const_iterator p = props.begin ();
|
||||
|
||||
if (n < layer_lists ()) {
|
||||
lay::LayerPropertiesList new_props (get_properties (n));
|
||||
lay::LayerPropertiesList new_props (get_properties ((unsigned int) n));
|
||||
new_props.append (*p);
|
||||
if (! p->name ().empty ()) {
|
||||
new_props.set_name (p->name ());
|
||||
}
|
||||
set_properties (n, new_props);
|
||||
set_properties ((unsigned int) n, new_props);
|
||||
} else {
|
||||
|
||||
lay::LayerPropertiesList new_props = p0;
|
||||
@@ -3326,7 +3326,7 @@ LayoutView::merge_layer_props (const std::vector<lay::LayerPropertiesList> &prop
|
||||
if (! p->name ().empty ()) {
|
||||
new_props.set_name (p->name ());
|
||||
}
|
||||
insert_layer_list (n, new_props);
|
||||
insert_layer_list ((unsigned int) n, new_props);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3337,19 +3337,19 @@ LayoutView::merge_layer_props (const std::vector<lay::LayerPropertiesList> &prop
|
||||
for (std::vector<lay::LayerPropertiesList>::const_iterator p = props.begin (); p != props.end (); ++p, ++n) {
|
||||
|
||||
if (n < layer_lists ()) {
|
||||
lay::LayerPropertiesList new_props (get_properties (n));
|
||||
lay::LayerPropertiesList new_props (get_properties ((unsigned int) n));
|
||||
new_props.append (*p);
|
||||
if (! p->name ().empty ()) {
|
||||
new_props.set_name (p->name ());
|
||||
}
|
||||
set_properties (n, new_props);
|
||||
set_properties ((unsigned int) n, new_props);
|
||||
} else {
|
||||
lay::LayerPropertiesList new_props = p0;
|
||||
new_props.append (*p);
|
||||
if (! p->name ().empty ()) {
|
||||
new_props.set_name (p->name ());
|
||||
}
|
||||
insert_layer_list (n, new_props);
|
||||
insert_layer_list ((unsigned int) n, new_props);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3385,7 +3385,7 @@ LayoutView::store_state ()
|
||||
DisplayState state (box (), get_min_hier_levels (), get_max_hier_levels (), m_cellviews);
|
||||
m_display_states.push_back (state);
|
||||
|
||||
m_display_state_ptr = m_display_states.size () - 1;
|
||||
m_display_state_ptr = (unsigned int) (m_display_states.size () - 1);
|
||||
}
|
||||
|
||||
db::DBox
|
||||
|
||||
@@ -520,13 +520,13 @@ LineStyles::merge (const LineStyles &other, std::map<unsigned int, unsigned int>
|
||||
{
|
||||
// insert the standard pattern into the map (for completeness)
|
||||
for (iterator c = begin (); c != begin_custom (); ++c) {
|
||||
index_map.insert (std::make_pair (std::distance (begin (), c), std::distance (begin (), c)));
|
||||
index_map.insert (std::make_pair ((unsigned int) std::distance (begin (), c), (unsigned int) std::distance (begin (), c)));
|
||||
}
|
||||
|
||||
// build an index of present pattern
|
||||
std::map <LineStyleInfo, unsigned int, style_less_f> styles;
|
||||
for (iterator c = begin_custom (); c != end (); ++c) {
|
||||
styles.insert (std::make_pair (*c, std::distance (begin (), c)));
|
||||
styles.insert (std::make_pair (*c, (unsigned int) std::distance (begin (), c)));
|
||||
}
|
||||
|
||||
// map the pattern of other into *this, possibly creating new ones
|
||||
@@ -539,7 +539,7 @@ LineStyles::merge (const LineStyles &other, std::map<unsigned int, unsigned int>
|
||||
} else {
|
||||
new_index = p->second;
|
||||
}
|
||||
index_map.insert (std::make_pair (std::distance (other.begin (), c), new_index));
|
||||
index_map.insert (std::make_pair ((unsigned int) std::distance (other.begin (), c), new_index));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ RedrawThread::commit (const std::vector <lay::RedrawLayerInfo> &layers, const la
|
||||
m_resolution = resolution;
|
||||
|
||||
m_layers = layers;
|
||||
m_nlayers = m_layers.size ();
|
||||
m_nlayers = int (m_layers.size ());
|
||||
for (size_t i = 0; i < m_layers.size (); ++i) {
|
||||
if (m_layers [i].visible) {
|
||||
m_layers [i].enabled = false;
|
||||
@@ -258,7 +258,7 @@ RedrawThread::do_start (bool clear, const db::Vector *shift_vector, const std::v
|
||||
m_layers = *layers;
|
||||
}
|
||||
|
||||
m_nlayers = m_layers.size ();
|
||||
m_nlayers = int (m_layers.size ());
|
||||
|
||||
if (mp_view->cellviews () > 0) {
|
||||
|
||||
|
||||
@@ -2002,8 +2002,8 @@ RedrawThreadWorker::iterate_variants (const std::vector <db::Box> &redraw_region
|
||||
// traversals along the context path bottom up.
|
||||
size_t ctx_path_length = m_cellviews [m_cv_index].specific_path ().size ();
|
||||
if (ctx_path_length > 0) {
|
||||
m_from_level -= ctx_path_length;
|
||||
m_to_level -= ctx_path_length;
|
||||
m_from_level -= int (ctx_path_length);
|
||||
m_to_level -= int (ctx_path_length);
|
||||
trans = trans * m_cellviews [m_cv_index].context_trans ();
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
db::DBox dregion = dworld & db::DBox (px - dd, py - dd, px + dd, py + dd);
|
||||
if (! dregion.empty ()) {
|
||||
|
||||
int ctx_levels = cv.specific_path ().size ();
|
||||
int ctx_levels = int (cv.specific_path ().size ());
|
||||
|
||||
int min_hier_level = view->get_min_hier_levels () - ctx_levels;
|
||||
int max_hier_level = view->get_max_hier_levels () - ctx_levels;
|
||||
|
||||
@@ -93,7 +93,7 @@ StipplePalette::stipple_by_index (unsigned int n) const
|
||||
unsigned int
|
||||
StipplePalette::stipples () const
|
||||
{
|
||||
return m_stipples.size ();
|
||||
return (unsigned int) m_stipples.size ();
|
||||
}
|
||||
|
||||
unsigned int
|
||||
@@ -110,7 +110,7 @@ StipplePalette::standard_stipple_index_by_index (unsigned int n) const
|
||||
unsigned int
|
||||
StipplePalette::standard_stipples () const
|
||||
{
|
||||
return m_standard.size ();
|
||||
return (unsigned int) m_standard.size ();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1006,7 +1006,7 @@ BitmapViewObjectCanvas::plane (const lay::ViewOp &style)
|
||||
if (b == m_fg_bitmap_table.end ()) {
|
||||
|
||||
// we need to create a new plane
|
||||
m_fg_bitmap_table.insert (std::make_pair (style, mp_alloc_bitmaps.size ()));
|
||||
m_fg_bitmap_table.insert (std::make_pair (style, (unsigned int) mp_alloc_bitmaps.size ()));
|
||||
lay::Bitmap *bm = new lay::Bitmap (m_width, m_height, m_resolution);
|
||||
mp_fg_bitmaps.push_back (bm);
|
||||
mp_alloc_bitmaps.push_back (bm);
|
||||
@@ -1026,7 +1026,7 @@ BitmapViewObjectCanvas::plane (const std::vector<lay::ViewOp> &style)
|
||||
if (b == m_fgv_bitmap_table.end ()) {
|
||||
|
||||
// we need to create a new bitmap
|
||||
m_fgv_bitmap_table.insert (std::make_pair (style, mp_alloc_bitmaps.size ()));
|
||||
m_fgv_bitmap_table.insert (std::make_pair (style, (unsigned int) mp_alloc_bitmaps.size ()));
|
||||
lay::Bitmap *bm = new lay::Bitmap (m_width, m_height, m_resolution);
|
||||
mp_alloc_bitmaps.push_back (bm);
|
||||
for (std::vector<lay::ViewOp>::const_iterator s = style.begin (); s != style.end (); ++s) {
|
||||
|
||||
@@ -630,7 +630,7 @@ public:
|
||||
|
||||
if (node) {
|
||||
update_cache (node);
|
||||
return node->children ();
|
||||
return int (node->children ());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ public:
|
||||
int rowCount (const QModelIndex &index) const
|
||||
{
|
||||
if (mp_database && ! index.isValid ()) {
|
||||
return m_item_list.size ();
|
||||
return int (m_item_list.size ());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user