}
log_assert(block != NULL);
- log_assert(variables.count(str));
+ log_assert(variables.count(str) != 0);
while (!block->children.empty())
{
counter.QuadPart *= 1000000;
counter.QuadPart /= freq.QuadPart;
- tv->tv_sec = counter.QuadPart / 1000000;
+ tv->tv_sec = long(counter.QuadPart / 1000000);
tv->tv_usec = counter.QuadPart % 1000000;
return 0;
bool RTLIL::Cell::hasParam(RTLIL::IdString paramname) const
{
- return parameters.count(paramname);
+ return parameters.count(paramname) != 0;
}
void RTLIL::Cell::unsetParam(RTLIL::IdString paramname)
if (lhs.chunks_.size() == 1) {
char *p = (char*)str.c_str(), *endptr;
- long long int val = strtoll(p, &endptr, 10);
+ long int val = strtol(p, &endptr, 10);
if (endptr && endptr != p && *endptr == 0) {
sig = RTLIL::SigSpec(val, lhs.width_);
cover("kernel.rtlil.sigspec.parse.rhs_dec");
while (1) {
for (int i = 0; i < 6; i++) {
static std::string y = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
- static uint32_t x = 314159265 ^ time(NULL);
+ static uint32_t x = 314159265 ^ uint32_t(time(NULL));
x ^= x << 13, x ^= x >> 17, x ^= x << 5;
template_str[pos+i] = y[x % y.size()];
}
for (int i = 0; i < 64; i++) {
int j = i < int(vec1.size()) ? i : vec1.size()-1;
if (modelMap.at(vec1[j]))
- value |= 1 << i;
+ value |= int64_t(1) << i;
}
return value;
}
modelMap[modelExpressions[i]] = modelValues[i];
for (int i = 0; i < int(vec1.size()); i++)
if (modelMap.at(vec1[i]))
- value |= 1 << i;
+ value |= uint64_t(1) << i;
return value;
}
if (regs.check_any(s1) != regs.check_any(s2))
return regs.check_any(s2);
if (direct_wires.count(w1) != direct_wires.count(w2))
- return direct_wires.count(w2);
+ return direct_wires.count(w2) != 0;
if (conns.check_any(s1) != conns.check_any(s2))
return conns.check_any(s2);
}
forbidden_controls_cache[cell].insert(bits.begin(), bits.end());
}
- log_assert(recursion_state.count(cell));
+ log_assert(recursion_state.count(cell) != 0);
recursion_state.erase(cell);
return forbidden_controls_cache[cell];
activation_patterns_cache[cell].insert(c_patterns.begin(), c_patterns.end());
}
- log_assert(recursion_state.count(cell));
+ log_assert(recursion_state.count(cell) != 0);
recursion_state.erase(cell);
optimize_activation_patterns(activation_patterns_cache[cell]);
LibertyAst *best_cell = NULL;
std::map<std::string, char> best_cell_ports;
int best_cell_pins = 0;
- float best_cell_area = 0;
+ double best_cell_area = 0;
if (ast->id != "library")
log_error("Format error in liberty file.\n");
this_cell_ports[cell_rst_pin] = 'R';
this_cell_ports[cell_next_pin] = 'D';
- float area = 0;
+ double area = 0;
LibertyAst *ar = cell->find("area");
if (ar != NULL && !ar->value.empty())
area = atof(ar->value.c_str());
LibertyAst *best_cell = NULL;
std::map<std::string, char> best_cell_ports;
int best_cell_pins = 0;
- float best_cell_area = 0;
+ double best_cell_area = 0;
if (ast->id != "library")
log_error("Format error in liberty file.\n");
this_cell_ports[cell_clr_pin] = 'R';
this_cell_ports[cell_next_pin] = 'D';
- float area = 0;
+ double area = 0;
LibertyAst *ar = cell->find("area");
if (ar != NULL && !ar->value.empty())
area = atof(ar->value.c_str());