mirror of
https://github.com/saymrwulf/uhd.git
synced 2026-05-16 21:10:10 +00:00
lib: Fix various type-conversion compiler warnings
This makes more type-conversions explicit, to reduce the number of warnings specifically for MSVC.
This commit is contained in:
parent
4047f692d4
commit
d23df2d941
5 changed files with 9 additions and 7 deletions
|
|
@ -63,7 +63,7 @@ public:
|
|||
boost::mutex::scoped_lock lock(_mutex);
|
||||
this->send_pkt(addr, data, timestamp);
|
||||
return this->wait_for_ack(
|
||||
readback, bool(timestamp) ? MASSIVE_TIMEOUT : ACK_TIMEOUT);
|
||||
readback, bool(timestamp != 0) ? MASSIVE_TIMEOUT : ACK_TIMEOUT);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -169,8 +169,10 @@ public:
|
|||
if (stream_cmd.stream_mode == uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
|
||||
or stream_cmd.stream_mode
|
||||
== uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE) {
|
||||
size_t decimation = get_arg<double>("input_rate", chan)
|
||||
/ get_arg<double>("output_rate", chan);
|
||||
const size_t decimation =
|
||||
static_cast<size_t>(
|
||||
get_arg<double>("input_rate", chan)
|
||||
/ get_arg<double>("output_rate", chan));
|
||||
stream_cmd.num_samps *= decimation;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ expression_literal::expression_literal(
|
|||
_bool_val = true;
|
||||
} else {
|
||||
// lexical cast to bool is too picky
|
||||
_bool_val = bool(std::stoi(_val));
|
||||
_bool_val = (std::stoi(_val) != 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ private:
|
|||
P.expr_stack.top()->set_combiner_safe(
|
||||
expression_container::COMBINE_OR);
|
||||
}
|
||||
} catch (const uhd::syntax_error& e) {
|
||||
} catch (const uhd::syntax_error&) {
|
||||
P.error = str(boost::format("Operator %s is mixing operator "
|
||||
"types within this container.")
|
||||
% val);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ byte_vector_t i2c_iface::read_eeprom(
|
|||
byte_vector_t bytes;
|
||||
for (size_t i = 0; i < num_bytes; i++){
|
||||
//do a zero byte write to start read cycle
|
||||
this->write_i2c(addr, byte_vector_t(1, offset+i));
|
||||
this->write_i2c(addr, byte_vector_t(1, narrow_cast<uint8_t>(offset+i)));
|
||||
bytes.push_back(this->read_i2c(addr, 1).at(0));
|
||||
}
|
||||
return bytes;
|
||||
|
|
@ -105,7 +105,7 @@ struct eeprom16_impl : i2c_iface
|
|||
uint16_t offset,
|
||||
const byte_vector_t &bytes
|
||||
){
|
||||
for (size_t i = 0; i < bytes.size(); i++)
|
||||
for (uint16_t i = 0; i < bytes.size(); i++)
|
||||
{
|
||||
//write a byte at a time, its easy that way
|
||||
uint16_t offset_i = offset+i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue