mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Fix compiler warnings (-Wlogical-op)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
This commit is contained in:
parent
78f2232012
commit
f6f2d27b85
@ -160,7 +160,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
#add_compiler_flags(5.1 "-Wsuggest-final-types")
|
||||
|
||||
add_compiler_flags(6.1 "-Wduplicated-cond")
|
||||
#add_compiler_flags(6.1 "-Wlogical-op")
|
||||
add_compiler_flags(6.1 "-Wlogical-op")
|
||||
add_compiler_flags(6.1 "-Wnull-dereference")
|
||||
|
||||
add_compiler_flags(7.1 "-Wduplicated-branches")
|
||||
|
@ -115,7 +115,19 @@ v_io_size Connection::write(const void *buff, v_buff_size count, async::Action&
|
||||
|
||||
if(result < 0) {
|
||||
auto e = errno;
|
||||
if(e == EAGAIN || e == EWOULDBLOCK){
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
bool retry = ((e == EAGAIN) || (e == EWOULDBLOCK));
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if(retry){
|
||||
if(m_mode == data::stream::ASYNCHRONOUS) {
|
||||
action = oatpp::async::Action::createIOWaitAction(m_handle, oatpp::async::Action::IOEventType::IO_EVENT_WRITE);
|
||||
}
|
||||
@ -173,7 +185,19 @@ v_io_size Connection::read(void *buff, v_buff_size count, async::Action& action)
|
||||
|
||||
if(result < 0) {
|
||||
auto e = errno;
|
||||
if(e == EAGAIN || e == EWOULDBLOCK){
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
bool retry = ((e == EAGAIN) || (e == EWOULDBLOCK));
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if(retry){
|
||||
if(m_mode == data::stream::ASYNCHRONOUS) {
|
||||
action = oatpp::async::Action::createIOWaitAction(m_handle, oatpp::async::Action::IOEventType::IO_EVENT_READ);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user