-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Issue 3285 reducing signed size type in os file #3402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 3285 reducing signed size type in os file #3402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
f268213 to
aa79c5f
Compare
| return this->m_delegate.seek(offset, seekType); | ||
| } | ||
|
|
||
| File::Status File::seek_absolute(FwSizeType offset) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } | ||
|
|
||
| File::Status File::read(U8* buffer, FwSignedSizeType &size, File::WaitType wait) { | ||
| File::Status File::read(U8* buffer, FwSizeType &size, File::WaitType wait) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
|
|
||
|
|
||
| File::Status File::write(const U8* buffer, FwSignedSizeType &size, File::WaitType wait) { | ||
| File::Status File::write(const U8* buffer, FwSizeType &size, File::WaitType wait) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } | ||
|
|
||
| File::Status File::incrementalCrc(FwSignedSizeType &size) { | ||
| File::Status File::incrementalCrc(FwSizeType &size) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
|
|
||
| File::Status File::readline(U8* buffer, FwSignedSizeType &size, File::WaitType wait) { | ||
| const FwSignedSizeType requested_size = size; | ||
| File::Status File::readline(U8* buffer, FwSizeType &size, File::WaitType wait) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } | ||
|
|
||
| FileSystem::Status FileSystem::getFileSize(const char* path, FwSignedSizeType& size) { | ||
| FileSystem::Status FileSystem::getFileSize(const char* path, FwSizeType& size) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } // end handleFileError | ||
|
|
||
| FileSystem::Status FileSystem::copyFileData(File& source, File& destination, FwSignedSizeType size) { | ||
| FileSystem::Status FileSystem::copyFileData(File& source, File& destination, FwSizeType size) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
|
|
||
| PosixFile::Status PosixFile::size(FwSignedSizeType& size_result) { | ||
| FwSignedSizeType current_position = 0; | ||
| PosixFile::Status PosixFile::size(FwSizeType& size_result) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } | ||
|
|
||
| PosixFile::Status PosixFile::position(FwSignedSizeType& position_result) { | ||
| PosixFile::Status PosixFile::position(FwSizeType& position_result) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| } | ||
|
|
||
| PosixFile::Status PosixFile::preallocate(FwSignedSizeType offset, FwSignedSizeType length) { | ||
| PosixFile::Status PosixFile::preallocate(FwSizeType offset, FwSizeType length) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
38b4ec8 to
795d993
Compare
kevin-f-ortega
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice work!
| File::Status File::readline(U8* buffer, FwSignedSizeType &size, File::WaitType wait) { | ||
| const FwSignedSizeType requested_size = size; | ||
| File::Status File::readline(U8* buffer, FwSizeType &size, File::WaitType wait) { | ||
| const FwSizeType requested_size = size; |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| // Read hash from checksum file: | ||
| unsigned char savedHash[HASH_DIGEST_LENGTH]; | ||
| FwSignedSizeType size = static_cast<FwSignedSizeType>(hashBuffer.getBuffCapacity()); | ||
| FwSizeType size = static_cast<FwSizeType>(hashBuffer.getBuffCapacity()); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // Write out the hash | ||
| FwSignedSizeType size = static_cast<FwSignedSizeType>(hashBuffer.getBuffLength()); | ||
| FwSizeType size = static_cast<FwSizeType>(hashBuffer.getBuffLength()); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| { | ||
| FW_ASSERT((length > 0) and (length <= std::numeric_limits<FwSignedSizeType>::max()), static_cast<FwAssertArgType>(length)); | ||
| FwSignedSizeType size = static_cast<FwSignedSizeType>(length); | ||
| FwSizeType size = length; |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| ) | ||
| { | ||
| FwSignedSizeType size = length; | ||
| FwSizeType size = length; |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| } | ||
|
|
||
| FwSignedSizeType intSize = size; | ||
| FwSizeType intSize = size; |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| } | ||
|
|
||
| FwSignedSizeType intLength = length; | ||
| FwSizeType intLength = length; |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // Read checksum file | ||
| FwSignedSizeType checksum_from_file_size = static_cast<FwSignedSizeType>(sizeof(checksum_from_file)); | ||
| FwSizeType checksum_from_file_size = static_cast<FwSizeType>(sizeof(checksum_from_file)); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
* Remove FwSignedSizeType from file * Restoring FwSignedSizeType to seek offsets * Fixing usages and UTs * Fixes on Linux * CI fix * CI round 3 * CI rev 4 * Fixing code scan errors * Review fixes - pt 1 * Failed to save
Change Description
Changing
FwSignedSizeTypeinOs::Filecalls toFwSizeTypeto be in-line with other sizes in the system.