Skip to content

Commit

Permalink
Enable -Wconversion in minimal-mdns records. (#25406)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 18, 2023
1 parent 8c2cca8 commit 1952272
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/lib/dnssd/minimal_mdns/records/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ static_library("records") {
"${chip_root}/src/lib/dnssd/minimal_mdns/core",
"${chip_root}/src/platform",
]

cflags = [ "-Wconversion" ]
}
6 changes: 3 additions & 3 deletions src/lib/dnssd/minimal_mdns/records/ResourceRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ bool ResourceRecord::Append(HeaderRef & hdr, ResourceType asType, RecordWriter &
switch (asType)
{
case ResourceType::kAdditional:
hdr.SetAdditionalCount(hdr.GetAdditionalCount() + 1);
hdr.SetAdditionalCount(static_cast<uint16_t>(hdr.GetAdditionalCount() + 1));
break;
case ResourceType::kAuthority:
hdr.SetAuthorityCount(hdr.GetAuthorityCount() + 1);
hdr.SetAuthorityCount(static_cast<uint16_t>(hdr.GetAuthorityCount() + 1));
break;
case ResourceType::kAnswer:
hdr.SetAnswerCount(hdr.GetAnswerCount() + 1);
hdr.SetAnswerCount(static_cast<uint16_t>(hdr.GetAnswerCount() + 1));
break;
}
}
Expand Down

0 comments on commit 1952272

Please sign in to comment.