Fix compiler warnings by ensuring variable initialization

This commit is contained in:
Alexander A. Klimov 2023-03-24 18:07:51 +01:00
parent 4019ad5bb7
commit 93b28c02df
3 changed files with 7 additions and 7 deletions

View File

@ -32,8 +32,8 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
{
addrinfo hints;
addrinfo *result;
int error;
const char *func;
int error = 0;
const char *func = nullptr;
memset(&hints, 0, sizeof(hints));
hints.ai_family = family;
@ -126,8 +126,8 @@ void TcpSocket::Connect(const String& node, const String& service)
{
addrinfo hints;
addrinfo *result;
int error;
const char *func;
int error = 0;
const char *func = nullptr;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;

View File

@ -552,7 +552,7 @@ Dictionary::Ptr LegacyTimePeriod::FindNextSegment(const String& daydef, const St
ProcessTimeRanges(timeranges, &iter, segments);
Dictionary::Ptr bestSegment;
double bestBegin;
double bestBegin = 0;
ObjectLock olock(segments);
for (const Dictionary::Ptr& segment : segments) {

View File

@ -26,8 +26,8 @@ do { \
} while (0)
struct lex_buf {
char *buf;
size_t size;
char *buf = NULL;
size_t size = 0;
};
static void lb_init(lex_buf *lb)