Fix ambiguous type w/pos_type; Silence register kw deprecation

Build on PR #6 from bonki an the additional commit they had on top
of master at commit 43db1608d9.
This commit is contained in:
Paul Kippes 2024-02-19 23:54:12 -08:00
parent 43db1608d9
commit 6278b7bbfa
2 changed files with 11 additions and 2 deletions

View File

@ -7,7 +7,16 @@
cmake_minimum_required(VERSION 3.2)
project(maconv)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
add_compile_options(-Wall)
add_compile_options(-Wextra)
# Register keyword is gone in C++17 and above. Okay
# if we use c++std 14 and just ignore the warning.
add_compile_options(-Wno-deprecated-register)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Compile vendor libraries.
add_subdirectory("vendors/libhfs")

View File

@ -71,7 +71,7 @@ auto RawDataStreamBuf::seekpos(pos_type pos, std::ios_base::openmode which)
if (which & std::ios_base::in)
setg(eback(), eback() + pos, egptr());
if (which & std::ios_base::out)
pbump(pos - (pptr() - eback()));
pbump(pos - static_cast<pos_type>((pptr() - eback())));
return pos;
}