Skip to content

Commit

Permalink
Fix CRAN warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0x17 committed Sep 24, 2024
1 parent 1d38171 commit 9ed0d10
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif ()

if (UNIX)
# -fsanitize=undefined -fno-inline
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wreturn-type -Wmissing-declarations -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wreturn-type -Wmissing-declarations -Wno-unknown-pragmas -pedantic")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -funsigned-char") # aggressive signage warnings
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DZ_HAVE_UNISTD_H")
if (NOT APPLE AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
Expand Down
2 changes: 1 addition & 1 deletion src/gdlib/gmsstrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ bool TBufferedFileStream::FlushBuffer()
}
else
{
unsigned long Len { CBufSize - sizeof( TCompressHeader ) };
auto Len { static_cast<long unsigned int>(CBufSize - sizeof( TCompressHeader )) };
compress( &CBufPtr->cxData, &Len, BufPtr.data(), NrWritten );
if( Len < NrWritten )
{
Expand Down
4 changes: 2 additions & 2 deletions src/rtl/sysutils_p3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ double FileDateToDateTime( int fd )
LongRec rec;
static_assert( sizeof( int ) == sizeof( LongRec ) );
std::memcpy( &rec, &fd, sizeof( int ) );
return EncodeDate( ( rec.hi >> 9 ) + 1980, ( rec.hi >> 5 ) & 15, rec.hi & 31 ) +
EncodeTime(rec.lo >> 11, (rec.lo >> 5) & 63, (rec.lo & 31) << 1, 0);
return EncodeDate( ( rec.parts.hi >> 9 ) + 1980, ( rec.parts.hi >> 5 ) & 15, rec.parts.hi & 31 ) +
EncodeTime(rec.parts.lo >> 11, (rec.parts.lo >> 5) & 63, (rec.parts.lo & 31) << 1, 0);
#else
tm ut {};
time_t tim;
Expand Down
2 changes: 1 addition & 1 deletion src/rtl/sysutils_p3.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int DateTimeToFileDate( double dt );
union LongRec {
struct {
uint16_t lo, hi;
};
} parts;
uint8_t bytes[4];
};

Expand Down

0 comments on commit 9ed0d10

Please sign in to comment.