Skip to content

Commit 3e8eef1

Browse files
committed
Fix MSVC C4927 on error_code conversions
1 parent 8095703 commit 3e8eef1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/boost/http/parser.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ read_header(Stream& stream)
528528
co_return {};
529529

530530
if(ec != condition::need_more_input)
531-
co_return {ec};
531+
co_return {std::error_code(ec)};
532532

533533
auto mbs = prepare();
534534

@@ -556,7 +556,7 @@ read(Stream& stream)
556556
co_return {};
557557

558558
if(ec && ec != condition::need_more_input)
559-
co_return {ec};
559+
co_return {std::error_code(ec)};
560560

561561
if(ec == condition::need_more_input)
562562
{
@@ -737,7 +737,7 @@ read(capy::ReadStream auto& stream, Sink&& sink)
737737
}
738738

739739
if(ec)
740-
co_return {ec};
740+
co_return {std::error_code(ec)};
741741
}
742742
}
743743

include/boost/http/serializer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ class serializer::sink
659659
{
660660
if(cbs.error() == error::need_data)
661661
break;
662-
co_return {cbs.error()};
662+
co_return {std::error_code(cbs.error())};
663663
}
664664

665665
if(capy::buffer_empty(*cbs))
@@ -709,7 +709,7 @@ class serializer::sink
709709
{
710710
if(cbs.error() == error::need_data)
711711
continue;
712-
co_return {cbs.error()};
712+
co_return {std::error_code(cbs.error())};
713713
}
714714

715715
if(capy::buffer_empty(*cbs))
@@ -906,7 +906,7 @@ class serializer::sink
906906
{
907907
if(cbs.error() == error::need_data)
908908
continue;
909-
co_return {cbs.error()};
909+
co_return {std::error_code(cbs.error())};
910910
}
911911

912912
if(capy::buffer_empty(*cbs))

0 commit comments

Comments
 (0)