Fixed compiler warnings on return values and null args.

This commit is contained in:
ravinsp
2020-09-26 21:47:28 +05:30
parent 4d920a9219
commit 6599fa32ca
4 changed files with 9 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wreturn-type")
# We have 2 executable build outputs: appbill and hpcore

View File

@@ -459,7 +459,7 @@ int pass_through_mode(int argc, char** argv) {
fclose(f);
execv(argv[1], argv+1);
return 128;
}

View File

@@ -172,6 +172,7 @@ namespace comm
{
std::string_view sv(reinterpret_cast<const char *>(message.data()), message.size());
send(sv);
return 0;
}
/**
@@ -302,7 +303,7 @@ namespace comm
writer_thread.join();
LOG_DEBUG << (session_type == SESSION_TYPE::PEER ? "Peer" : "User") << " session closed: "
<< uniqueid.substr(0, 10) << (is_inbound ? "[in]" : "[out]") << (is_self ? "[self]" : "");
<< uniqueid.substr(0, 10) << (is_inbound ? "[in]" : "[out]") << (is_self ? "[self]" : "");
}
/**

View File

@@ -298,7 +298,7 @@ namespace msg::fbuf::p2pmsg
builder.Finish(message); // Finished building message content to get serialised content.
// Now that we have built the content message
create_containermsg_from_content(container_builder, builder, nullptr, false);
create_containermsg_from_content(container_builder, builder, {}, false);
}
/**
@@ -321,7 +321,7 @@ namespace msg::fbuf::p2pmsg
// Now that we have built the content message,
// we need to sign it and place it inside a container message.
create_containermsg_from_content(container_builder, builder, nullptr, true);
create_containermsg_from_content(container_builder, builder, {}, true);
}
void create_msg_from_nonunl_proposal(flatbuffers::FlatBufferBuilder &container_builder, const p2p::nonunl_proposal &nup)
@@ -338,7 +338,7 @@ namespace msg::fbuf::p2pmsg
// Now that we have built the content message,
// we need to sign it and place it inside a container message.
create_containermsg_from_content(container_builder, builder, nullptr, false);
create_containermsg_from_content(container_builder, builder, {}, false);
}
/**
@@ -412,7 +412,7 @@ namespace msg::fbuf::p2pmsg
// Now that we have built the content message,
// we need to sign it and place it inside a container message.
create_containermsg_from_content(container_builder, builder, nullptr, true);
create_containermsg_from_content(container_builder, builder, {}, true);
}
/**
@@ -435,7 +435,7 @@ namespace msg::fbuf::p2pmsg
// Now that we have built the content message,
// we need to sign it and place it inside a container message.
create_containermsg_from_content(container_builder, builder, nullptr, true);
create_containermsg_from_content(container_builder, builder, {}, true);
}
/**