Skip to content
Snippets Groups Projects
Verified Commit 6580c5d4 authored by Pavel Doležal's avatar Pavel Doležal
Browse files

Use unsigned loop index when comparing to unsigned bound

parent 118a1b16
No related branches found
No related tags found
1 merge request!29Add Python bindings generated by pybind11
......@@ -238,7 +238,7 @@ void CDNS::CdnsDecoder::skip_item()
}
else {
uint64_t item_count = read_int(item_length);
for (int i = 0; i < item_count; i++) {
for (unsigned i = 0; i < item_count; i++) {
skip_item();
if (cbor_type == CborType::MAP)
skip_item();
......@@ -285,7 +285,7 @@ std::string CDNS::CdnsDecoder::read_string(CborType cbor_type, uint64_t length,
if (!indef) {
ret.reserve(length);
for (int i = 0; i < length; i++) {
for (unsigned i = 0; i < length; i++) {
read_to_buffer();
ret.push_back(m_p[0]);
m_p++;
......@@ -306,7 +306,7 @@ std::string CDNS::CdnsDecoder::read_string(CborType cbor_type, uint64_t length,
uint64_t chunk_length = read_int(chunk_length_value);
ret.reserve(ret.size() + chunk_length);
for (int i = 0; i < chunk_length; i++) {
for (unsigned i = 0; i < chunk_length; i++) {
read_to_buffer();
ret.push_back(m_p[0]);
m_p++;
......
......@@ -59,7 +59,7 @@ void CDNS::Timestamp::read(CdnsDecoder& dec)
bool indef = false;
uint64_t length = dec.read_array_start(indef);
for (int i = 0; (i < length) || indef; i++) {
for (unsigned i = 0; (i < length) || indef; i++) {
if (indef && dec.peek_type() == CborType::BREAK) {
dec.read_break();
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment