src/UDPConnection.cpp
)
-set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-missing-braces")
-set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D NDEBUG")
+add_compile_options(
+ -Wall -Wextra -Wpedantic -Wno-missing-braces
+ $<$<COMPILE_LANGUAGE:CXX>:-Weffc++>
+ $<$<CONFIG:DEBUG>:-O0>
+)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug', none was specified.")
unsigned long *msize);
~TSLQIter();
+ // Disallow copy.
+ TSLQIter(const TSLQIter &) = delete;
+ TSLQIter& operator=(const TSLQIter &) = delete;
+
std::unique_ptr<T> current();
bool next();
bool prev();
template <typename T>
TSLQueue<T>::TSLQueue() :
+ mutex(),
head(std::shared_ptr<TSLQNode>(new TSLQNode())),
tail(std::shared_ptr<TSLQNode>(new TSLQNode())),
msize(0)
template <typename T>
TSLQueue<T>::TSLQNode::TSLQNode() :
+next(),
+prev(),
+data(),
type(TSLQN_Type::TSLQN_NORMAL)
{}
toggleTimer(std::chrono::steady_clock::duration::zero()),
toggledTimer(std::chrono::steady_clock::duration::zero()),
addr({0}),
+scope_id(0),
port(0),
sentPkts(),
sendPkts(),
priorityPkts(),
+sentInfoMap(),
received(std::chrono::steady_clock::now()),
sent(std::chrono::steady_clock::now()),
-rtt(std::chrono::steady_clock::duration::zero())
+rtt(std::chrono::steady_clock::duration::zero()),
+verifyMessage()
{
flags.set(0);
flags.reset(1);
sentPkts(),
sendPkts(),
priorityPkts(),
+sentInfoMap(),
received(std::chrono::steady_clock::now()),
sent(std::chrono::steady_clock::now()),
-rtt(std::chrono::steady_clock::duration::zero())
+rtt(std::chrono::steady_clock::duration::zero()),
+verifyMessage()
{
flags.set(3);
if(isServer) {
#else
loggingType(UDPC_WARNING),
#endif
+authPolicy(UDPC_AUTH_POLICY_FALLBACK),
+#if UDPC_PLATFORM == UPDC_PLATFORM_WINDOWS
+socketHandle(INVALID_SOCKET),
+#else
+socketHandle(0),
+#endif
+socketInfo(),
+lastUpdated(),
+conMap(),
+addrConMap(),
+idMap(),
+deletionMap(),
+peerPKWhitelist(),
receivedPkts(),
+receivedPktsMutex(),
cSendPkts(),
+internalEvents(),
+internalEventsMutex(),
+externalEvents(),
+externalEventsMutex(),
rng_engine(),
+thread(),
+threadRunning(),
conMapMutex(),
peerPKWhitelistMutex(),
+threadedSleepTime(std::chrono::milliseconds(UDPC_UPDATE_MS_DEFAULT)),
+keysSet(),
+atostrBufIndexMutex(),
atostrBufIndex(0)
{
std::memset(atostrBuf, 0, UDPC_ATOSTR_SIZE);
if(isLibSodiumEnabled && whitelist_pk_files_index > 0) {
puts("Enabling pubkey whitelist...");
for(unsigned int i = 0; i < whitelist_pk_files_index; ++i) {
- if(UDPC_add_whitelist_pk(context, whitelist_pks[i]) != i + 1) {
+ if((unsigned int)UDPC_add_whitelist_pk(context, whitelist_pks[i]) != i + 1) {
puts("Failed to add pubkey to whitelist");
return 1;
}
unsigned int tick = 0;
unsigned int temp = 0;
- unsigned int temp2, temp3;
+ unsigned int temp2;
int temp4;
unsigned long size;
UDPC_ConnectionId *list = NULL;