Fixed some build problems

This commit is contained in:
Matthias Koefferlein 2025-05-17 17:26:59 +02:00
parent 113c701345
commit ca53d8718b
4 changed files with 17 additions and 16 deletions

View File

@ -229,19 +229,19 @@ RNetExtractor::create_via_ports (const RExtractorTech &tech,
}
}
static inline size_t make_id (size_t index, unsigned int type)
static inline size_t make_id (unsigned int index, unsigned int type)
{
return (index << 2) + type;
return (size_t (index) << 2) + type;
}
static inline size_t index_from_id (size_t id)
static inline unsigned int index_from_id (size_t id)
{
return id >> 2;
return (unsigned int) (id >> 2);
}
static inline unsigned int type_from_id (size_t id)
{
return id & 3;
return (unsigned int) (id & 3);
}
namespace

View File

@ -50,7 +50,7 @@ class RNetwork;
* RNode object cannot be created directly. Use "create_node"
* from RNetwork.
*/
struct PEX_PUBLIC RNode
class PEX_PUBLIC RNode
: public tl::list_node<RNode>
{
public:
@ -139,9 +139,10 @@ private:
* RElement objects cannot be created directly. Use "create_element"
* from RNetwork.
*/
struct PEX_PUBLIC RElement
class PEX_PUBLIC RElement
: public tl::list_node<RElement>
{
public:
/**
* @brief The conductance value
*/

View File

@ -226,7 +226,7 @@ SquareCountingRExtractor::extract (const db::Polygon &polygon, const std::vector
for (size_t j = 0; j < p->size (); ++j) {
const db::plc::Edge *e = p->edge (j);
const db::plc::Edge *e = p->edge (int (j));
if (e->left () && e->right ()) {
auto ip = internal_ports.find (e);
@ -262,7 +262,7 @@ SquareCountingRExtractor::extract (const db::Polygon &polygon, const std::vector
// 1. internal ports
for (auto i = ip_indexes.begin (); i != ip_indexes.end (); ++i) {
db::Box loc = (inv_trans * internal_port_edges [*i]->edge ()).bbox ();
ports.push_back (std::make_pair (PortDefinition (pex::RNode::Internal, loc, *i), (pex::RNode *) 0));
ports.push_back (std::make_pair (PortDefinition (pex::RNode::Internal, loc, (unsigned int) *i), (pex::RNode *) 0));
}
// 2. vertex ports
@ -278,7 +278,7 @@ SquareCountingRExtractor::extract (const db::Polygon &polygon, const std::vector
// (NOTE: here we only take the center of the bounding box)
for (auto i = pp_indexes.begin (); i != pp_indexes.end (); ++i) {
db::Box loc = polygon_ports [*i].box ();
ports.push_back (std::make_pair (PortDefinition (pex::RNode::PolygonPort, loc, *i), (pex::RNode *) 0));
ports.push_back (std::make_pair (PortDefinition (pex::RNode::PolygonPort, loc, (unsigned int) *i), (pex::RNode *) 0));
}
// create nodes for the ports

View File

@ -133,7 +133,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
for (size_t iv = 0; iv < p->size (); ++iv) {
const db::plc::Vertex *vertex = p->vertex (iv);
const db::plc::Vertex *vertex = p->vertex (int (iv));
if (vertex2node.find (vertex) != vertex2node.end ()) {
continue;
}
@ -148,7 +148,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
if (pn != pport_nodes.end ()) {
n = pn->second;
} else {
n = rnetwork.create_node (pex::RNode::PolygonPort, port_index, 0);
n = rnetwork.create_node (pex::RNode::PolygonPort, (unsigned int) port_index, 0);
pport_nodes.insert (std::make_pair (port_index, n));
n->location = trans * polygon_ports [port_index].box ();
}
@ -158,7 +158,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
for (auto pi = vertex->ids ().begin (); pi != vertex->ids ().end (); ++pi) {
size_t port_index = size_t (*pi);
if (port_index < vertex_ports.size ()) {
RNode *nn = rnetwork.create_node (pex::RNode::VertexPort, port_index, 0);
RNode *nn = rnetwork.create_node (pex::RNode::VertexPort, (unsigned int) port_index, 0);
nn->location = db::DBox (*vertex, *vertex);
if (n) {
// in case of multiple vertexes on the same spot, short them
@ -172,7 +172,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
} else {
n = rnetwork.create_node (pex::RNode::Internal, internal_node_id++, 0);
n = rnetwork.create_node (pex::RNode::Internal, (unsigned int) internal_node_id++, 0);
n->location = db::DBox (*vertex, *vertex);
}
@ -204,7 +204,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
if (ip != pport_nodes.end ()) {
// create a new vertex port and short it to the polygon port
auto n = rnetwork.create_node (pex::RNode::VertexPort, iv, 0);
auto n = rnetwork.create_node (pex::RNode::VertexPort, (unsigned int) iv, 0);
n->location = db::DBox (trans * vp, trans * vp);
rnetwork.create_element (pex::RElement::short_value (), n, ip->second);
@ -283,7 +283,7 @@ TriangulationRExtractor::eliminate_all (RNetwork &rnetwork)
size_t nn = n->elements ().size ();
if (nn <= nmax) {
to_eliminate.push_back (const_cast<pex::RNode *> (n.operator-> ()));
} else if (nmax_next == 0 or nn < nmax_next) {
} else if (nmax_next == 0 || nn < nmax_next) {
nmax_next = nn;
}
}