Skip to content

Commit

Permalink
Merge pull request cppfastio#767 from trcrsired/master
Browse files Browse the repository at this point in the history
Fix const_cast missing
  • Loading branch information
trcrsired authored Jul 1, 2024
2 parents b81f0a4 + 7689128 commit 545552c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions include/fast_io_core_impl/operations/readimpl/scatterbytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ inline constexpr io_scatter_status_t scatter_read_some_bytes_cold_impl(instmtype
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
return ::fast_io::details::scatter_read_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters),
return ::fast_io::details::scatter_read_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)),
n);
}
else if constexpr (::fast_io::operations::decay::defines::has_input_or_io_stream_seek_bytes_define<instmtype> &&
Expand All @@ -72,7 +72,7 @@ inline constexpr io_scatter_status_t scatter_read_some_bytes_cold_impl(instmtype
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
auto ret{scatter_pread_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters), n, 0)};
auto ret{scatter_pread_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)), n, 0)};
::fast_io::operations::decay::input_stream_seek_decay(insm, ::fast_io::fposoffadd_scatters(0, pscatters, ret),
::fast_io::seekdir::cur);
return ret;
Expand Down Expand Up @@ -220,7 +220,7 @@ inline constexpr void scatter_read_all_bytes_cold_impl(instmtype insm, io_scatte
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
::fast_io::details::scatter_read_all_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters), n);
::fast_io::details::scatter_read_all_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)), n);
}
else if constexpr (::fast_io::operations::decay::defines::has_input_or_io_stream_seek_bytes_define<instmtype> &&
(::fast_io::operations::decay::defines::has_any_of_pread_bytes_operations<instmtype>))
Expand All @@ -238,7 +238,7 @@ inline constexpr void scatter_read_all_bytes_cold_impl(instmtype insm, io_scatte
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
scatter_pread_all_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters), n, 0);
scatter_pread_all_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)), n, 0);
::fast_io::operations::decay::input_stream_seek_decay(
insm, ::fast_io::fposoffadd_scatters(0, pscatters, {n, 0}), ::fast_io::seekdir::cur);
}
Expand Down
6 changes: 3 additions & 3 deletions include/fast_io_core_impl/operations/readimpl/scatterpbytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ inline constexpr io_scatter_status_t scatter_pread_some_bytes_cold_impl(instmtyp
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
return ::fast_io::details::scatter_pread_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters),
return ::fast_io::details::scatter_pread_some_cold_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)),
n, off);
}
else if constexpr (::fast_io::operations::decay::defines::has_input_or_io_stream_seek_bytes_define<instmtype> &&
Expand Down Expand Up @@ -97,7 +97,7 @@ inline constexpr io_scatter_status_t scatter_pread_some_bytes_impl(instmtype ins
::fast_io::operations::decay::stream_ref_decay_lock_guard lg{
::fast_io::operations::decay::input_stream_mutex_ref_decay(insm)};
return ::fast_io::details::scatter_pread_some_bytes_impl(
::fast_io::operations::decay::input_stream_unlocked_ref_decay(insm), pscatters, n, off);
::fast_io::operations::decay::input_stream_unlocked_ref_decay(insm), const_cast<::fast_io::io_scatter_t *>(pscatters), n, off);
}
else
{
Expand Down Expand Up @@ -176,7 +176,7 @@ inline constexpr void scatter_pread_all_bytes_cold_impl(instmtype insm, io_scatt
[[__gnu__::__may_alias__]]
#endif
= basic_io_scatter_t<char_type> *;
::fast_io::details::scatter_pread_all_impl(insm, reinterpret_cast<scattermayalias_ptr>(pscatters), n, off);
::fast_io::details::scatter_pread_all_impl(insm, reinterpret_cast<scattermayalias_ptr>(const_cast<::fast_io::io_scatter_t *>(pscatters)), n, off);
}
else if constexpr (::fast_io::operations::decay::defines::has_input_or_io_stream_seek_bytes_define<instmtype> &&
(::fast_io::operations::decay::defines::has_any_of_read_bytes_operations<instmtype>))
Expand Down

0 comments on commit 545552c

Please sign in to comment.