Fix jsonparse compiler warnings, clangformat updates
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
3fda636e70
commit
c4e544856a
@ -388,7 +388,7 @@ void json_import_ports(Context *ctx, const string &modname,
|
|||||||
// Find an update, or create a net to connect
|
// Find an update, or create a net to connect
|
||||||
// to this port.
|
// to this port.
|
||||||
//
|
//
|
||||||
NetInfo *this_net;
|
NetInfo *this_net = nullptr;
|
||||||
bool is_bus;
|
bool is_bus;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -411,12 +411,11 @@ void json_import_ports(Context *ctx, const string &modname,
|
|||||||
port_info.name.c_str(ctx), obj_name.c_str());
|
port_info.name.c_str(ctx), obj_name.c_str());
|
||||||
|
|
||||||
} else
|
} else
|
||||||
for (int index = 0; index < wire_group_node->data_array.size();
|
for (int index = 0; index < int(wire_group_node->data_array.size());
|
||||||
index++) {
|
index++) {
|
||||||
//
|
//
|
||||||
JsonNode *wire_node;
|
JsonNode *wire_node;
|
||||||
PortInfo this_port;
|
PortInfo this_port;
|
||||||
bool const_input = false;
|
|
||||||
IdString net_id;
|
IdString net_id;
|
||||||
//
|
//
|
||||||
wire_node = wire_group_node->data_array[index];
|
wire_node = wire_group_node->data_array[index];
|
||||||
@ -434,7 +433,7 @@ void json_import_ports(Context *ctx, const string &modname,
|
|||||||
|
|
||||||
// A simple net, specified by a number
|
// A simple net, specified by a number
|
||||||
net_num = wire_node->data_number;
|
net_num = wire_node->data_number;
|
||||||
if (net_num < netnames.size())
|
if (net_num < int(netnames.size()))
|
||||||
net_id = netnames.at(net_num);
|
net_id = netnames.at(net_num);
|
||||||
else
|
else
|
||||||
net_id = ctx->id(std::to_string(net_num));
|
net_id = ctx->id(std::to_string(net_num));
|
||||||
@ -475,7 +474,6 @@ void json_import_ports(Context *ctx, const string &modname,
|
|||||||
this_net = new NetInfo;
|
this_net = new NetInfo;
|
||||||
this_net->name =
|
this_net->name =
|
||||||
ctx->id("$const_" + std::to_string(const_net_idx++));
|
ctx->id("$const_" + std::to_string(const_net_idx++));
|
||||||
const_input = (this_port.type == PORT_IN);
|
|
||||||
|
|
||||||
if (wire_node->data_string.compare(string("0")) == 0) {
|
if (wire_node->data_string.compare(string("0")) == 0) {
|
||||||
|
|
||||||
@ -623,8 +621,8 @@ void json_import_cell(Context *ctx, string modname,
|
|||||||
dir_node = pdir_node->data_dict.at(port_name);
|
dir_node = pdir_node->data_dict.at(port_name);
|
||||||
wire_group_node = connections->data_dict.at(port_name);
|
wire_group_node = connections->data_dict.at(port_name);
|
||||||
|
|
||||||
json_import_ports(ctx, modname, netnames, cell->name, port_name,
|
json_import_ports(ctx, modname, netnames, cell->name.str(ctx),
|
||||||
dir_node, wire_group_node,
|
port_name, dir_node, wire_group_node,
|
||||||
[cell, ctx](PortType type, const std::string &name,
|
[cell, ctx](PortType type, const std::string &name,
|
||||||
NetInfo *net) {
|
NetInfo *net) {
|
||||||
cell->ports[ctx->id(name)] =
|
cell->ports[ctx->id(name)] =
|
||||||
@ -747,7 +745,7 @@ void json_import(Context *ctx, string modname, JsonNode *node)
|
|||||||
size_t num_bits = bits->data_array.size();
|
size_t num_bits = bits->data_array.size();
|
||||||
for (size_t i = 0; i < num_bits; i++) {
|
for (size_t i = 0; i < num_bits; i++) {
|
||||||
int netid = bits->data_array.at(i)->data_number;
|
int netid = bits->data_array.at(i)->data_number;
|
||||||
if (netid >= netnames.size())
|
if (netid >= int(netnames.size()))
|
||||||
netnames.resize(netid + 1);
|
netnames.resize(netid + 1);
|
||||||
netnames.at(netid) = ctx->id(
|
netnames.at(netid) = ctx->id(
|
||||||
basename +
|
basename +
|
||||||
@ -768,9 +766,7 @@ void json_import(Context *ctx, string modname, JsonNode *node)
|
|||||||
//
|
//
|
||||||
for (int cellid = 0; cellid < GetSize(cell_parent->data_dict_keys);
|
for (int cellid = 0; cellid < GetSize(cell_parent->data_dict_keys);
|
||||||
cellid++) {
|
cellid++) {
|
||||||
JsonNode *cell_type, *here, *param_node;
|
JsonNode *here = cell_parent->data_dict.at(
|
||||||
|
|
||||||
here = cell_parent->data_dict.at(
|
|
||||||
cell_parent->data_dict_keys[cellid]);
|
cell_parent->data_dict_keys[cellid]);
|
||||||
json_import_cell(ctx, modname, netnames, here,
|
json_import_cell(ctx, modname, netnames, here,
|
||||||
cell_parent->data_dict_keys[cellid]);
|
cell_parent->data_dict_keys[cellid]);
|
||||||
@ -785,7 +781,7 @@ void json_import(Context *ctx, string modname, JsonNode *node)
|
|||||||
// Loop through all ports
|
// Loop through all ports
|
||||||
for (int portid = 0; portid < GetSize(ports_parent->data_dict_keys);
|
for (int portid = 0; portid < GetSize(ports_parent->data_dict_keys);
|
||||||
portid++) {
|
portid++) {
|
||||||
JsonNode *here, *param_node;
|
JsonNode *here;
|
||||||
|
|
||||||
here = ports_parent->data_dict.at(
|
here = ports_parent->data_dict.at(
|
||||||
ports_parent->data_dict_keys[portid]);
|
ports_parent->data_dict_keys[portid]);
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
#include "place_sa.h"
|
#include "place_sa.h"
|
||||||
#include "pybindings.h"
|
#include "pybindings.h"
|
||||||
#include "route.h"
|
#include "route.h"
|
||||||
#include "version.h"
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
void svg_dump_el(const GraphicElement &el)
|
void svg_dump_el(const GraphicElement &el)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user