Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bocchino committed Mar 3, 2025
1 parent b3650e8 commit 2706672
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Os/Posix/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ PosixFile::Status PosixFile::preallocate(FwSignedSizeType offset, FwSignedSizeTy
// an attempt will be made to called posix_fallocate, and should that still return NOT_SUPPORTED then fallback
// code is engaged to synthesize this behavior.
#if _POSIX_C_SOURCE >= 200112L
PlatformIntType errno_status = ::posix_fallocate(this->m_handle.m_file_descriptor, static_cast<off_t>(offset), length);
PlatformIntType errno_status = ::posix_fallocate(this->m_handle.m_file_descriptor, static_cast<off_t>(offset), static_cast<off_t>(length));

Check notice

Code scanning / CodeQL

Use of basic integral type Note

errno_status uses the basic integral type int rather than a typedef with size and signedness.

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter offset has not been checked.

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter length has not been checked.
status = Os::Posix::errno_to_file_status(errno_status);
#endif
// When the operation is not supported or posix-API is not sufficient, fallback to a slower algorithm
Expand Down Expand Up @@ -186,7 +186,7 @@ PosixFile::Status PosixFile::preallocate(FwSignedSizeType offset, FwSignedSizeTy
PosixFile::Status PosixFile::seek(FwSignedSizeType offset, PosixFile::SeekType seekType) {
Status status = OP_OK;
off_t actual =
::lseek(this->m_handle.m_file_descriptor, offset, (seekType == SeekType::ABSOLUTE) ? SEEK_SET : SEEK_CUR);
::lseek(this->m_handle.m_file_descriptor, static_cast<off_t>(offset), (seekType == SeekType::ABSOLUTE) ? SEEK_SET : SEEK_CUR);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter offset has not been checked.
PlatformIntType errno_store = errno;
if (actual == PosixFileHandle::ERROR_RETURN_VALUE) {
status = Os::Posix::errno_to_file_status(errno_store);
Expand Down
4 changes: 2 additions & 2 deletions Ref/SignalGen/test/ut/SignalGenTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ namespace Ref {
//! By default, (1) call pushProductGetEntry; (2) do not allocate a buffer
//! and return FAILURE. You can override this behavior, e.g., to call
//! pushProductGetEntry, allocate a buffer and return SUCCESS.
virtual Fw::Success::T productGet_handler(
virtual Fw::Success::T productGet_handler (

Check warning

Code scanning / CppCheck

"virtual" is redundant since function is already declared as "override" Warning test

"virtual" is redundant since function is already declared as "override"
FwDpIdType id, //!< The container ID (input)
FwSizeType dataSize, //!< The data size of the requested buffer (input)
Fw::Buffer& buffer //!< The buffer (output)
);
) override;


// ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Svc/PosixTime/test/ut/PosixTimeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ namespace Svc {
ASSERT_LE(time.getUSeconds(), 999999U);
}

};
}
2 changes: 1 addition & 1 deletion Svc/PosixTime/test/ut/PosixTimeTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ namespace Svc {

};

};
}

#endif

0 comments on commit 2706672

Please sign in to comment.