formatting, remove unused

This commit is contained in:
john30
2022-09-17 23:57:24 +02:00
parent bb6a05190e
commit ce6ea68f22
20 changed files with 199 additions and 179 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ void clockGettime(struct timespec* t) {
#endif
}
long long clockGetMillis() {
uint64_t clockGetMillis() {
struct timespec t;
clockGettime(&t);
return t.tv_sec*1000LL + t.tv_nsec / 1000000;
+2 -1
View File
@@ -19,6 +19,7 @@
#ifndef LIB_UTILS_CLOCK_H_
#define LIB_UTILS_CLOCK_H_
#include <stdint.h>
#include <time.h>
namespace ebusd {
@@ -34,7 +35,7 @@ void clockGettime(struct timespec* t);
/**
* Get the current system time in milliseconds since the Epoch.
*/
long long clockGetMillis();
uint64_t clockGetMillis();
} // namespace ebusd
+1 -1
View File
@@ -170,7 +170,7 @@ SSLSocket* SSLSocket::connect(const string& host, const uint16_t& port, bool htt
if (isError("ctx_new", ctx)) {
break;
}
bool verifyPeer = !caFile || strcmp(caFile, "#")!=0;
bool verifyPeer = !caFile || strcmp(caFile, "#") != 0;
SSL_CTX_set_verify(ctx, verifyPeer ? SSL_VERIFY_PEER : SSL_VERIFY_NONE, nullptr);
if (verifyPeer) {
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
+2 -2
View File
@@ -98,10 +98,10 @@ bool WaitThread::Wait(int seconds, int millis) {
struct timespec t;
clockGettime(&t);
t.tv_sec += seconds;
long newMillis = t.tv_nsec/1000000 + millis;
long int newMillis = t.tv_nsec/1000000 + millis;
if (newMillis >= 1000) {
t.tv_sec += newMillis / 1000;
t.tv_nsec = (newMillis%1000) * 1000000; // rounds down to whole millis
t.tv_nsec = (newMillis%1000) * 1000000; // rounds down to whole millis
} else {
t.tv_nsec += millis * 1000000;
}