Skip to content

Commit

Permalink
Codefix: Explicitly cast size_t result to uint32_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed Dec 21, 2024
1 parent 01addcc commit c8acce2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,15 @@ void Sample::SetOffset(uint32_t offset)

uint32_t Sample::GetNextOffset() const
{
return this->offset +
return static_cast<uint32_t>(
this->offset +
1 + // length of the name
(this->name.length() + 1) + // the name + '\0'
this->size + // size of the data
1 + // the delimiter
1 + // length of the filename
(this->filename.length() + 1); // the filename + '\0'
(this->filename.length() + 1) // the filename + '\0'
);
}

uint32_t Sample::GetOffset() const
Expand Down

0 comments on commit c8acce2

Please sign in to comment.