diff --git a/uppsrc/Core/CharSet.cpp b/uppsrc/Core/CharSet.cpp index a6839e385..9bf5b1d34 100644 --- a/uppsrc/Core/CharSet.cpp +++ b/uppsrc/Core/CharSet.cpp @@ -1784,6 +1784,7 @@ inline void CharSetData::FromUnicode(char *t, const wchar *s, const wchar *end, } CharSetData::CharSetData() + :table(NULL) { for(int i = 0; i < 16; i++) line[i] = 0; diff --git a/uppsrc/Core/CoWork.cpp b/uppsrc/Core/CoWork.cpp index 08f7c5411..29da9dc68 100644 --- a/uppsrc/Core/CoWork.cpp +++ b/uppsrc/Core/CoWork.cpp @@ -362,6 +362,7 @@ int CoWork::GetWorkerIndex() } CoWork::CoWork() + :looper_count(1) { LLOG("CoWork constructed " << FormatHex(this)); todo = 0; diff --git a/uppsrc/Core/Inet.h b/uppsrc/Core/Inet.h index 3e475026e..413a11250 100644 --- a/uppsrc/Core/Inet.h +++ b/uppsrc/Core/Inet.h @@ -34,11 +34,11 @@ String MIMEToFileExt(const String& mime); class IpAddrInfo { enum { COUNT = 128 }; struct Entry { - const char *host; - const char *port; - int family; - int status; - addrinfo *addr; + const char *host; + const char *port; + int family; + int volatile status; + addrinfo *addr; }; static Entry pool[COUNT]; diff --git a/uppsrc/Core/LangInfo.cpp b/uppsrc/Core/LangInfo.cpp index 3fdef5001..deffecea5 100644 --- a/uppsrc/Core/LangInfo.cpp +++ b/uppsrc/Core/LangInfo.cpp @@ -236,6 +236,7 @@ LCID GetLanguageLCID(int language) #endif LanguageInfo::LanguageInfo() + :language(0) { getindexletter = DefaultGetIndexLetter; compare = DefaultLanguageCompare; diff --git a/uppsrc/Core/LocalProcess.h b/uppsrc/Core/LocalProcess.h index b000da837..e8612041a 100644 --- a/uppsrc/Core/LocalProcess.h +++ b/uppsrc/Core/LocalProcess.h @@ -85,7 +85,7 @@ public: LocalProcess() { Init(); } LocalProcess(const char *cmdline, const char *envptr = NULL) { Init(); Start(cmdline, envptr); } LocalProcess(const char *cmdline, const Vector& arg, const char *envptr = NULL) { Init(); Start(cmdline, arg, envptr); } - virtual ~LocalProcess() { Kill(); } + virtual ~LocalProcess() { LocalProcess::Kill(); } }; int Sys(const char *cmdline, String& out, bool convertcharset = true); diff --git a/uppsrc/Core/Mem.h b/uppsrc/Core/Mem.h index b57dba5b4..b63f9a1aa 100644 --- a/uppsrc/Core/Mem.h +++ b/uppsrc/Core/Mem.h @@ -313,7 +313,7 @@ bool memeq8__(const void *p, const void *q, size_t count) auto Cmp128 = [&](size_t at) { return i16x8(s + at) == i16x8(t + at); }; - if(!AllTrue(Cmp128(count - 16) & Cmp128(0))) // tail & alignment, also <= 32 + if( !AllTrue( Cmp128(count - 16) & Cmp128(0) ) ) // tail & alignment, also <= 32 return false; if(count <= 32) diff --git a/uppsrc/Core/Parser.h b/uppsrc/Core/Parser.h index 084697e5d..4db3155f3 100644 --- a/uppsrc/Core/Parser.h +++ b/uppsrc/Core/Parser.h @@ -80,7 +80,7 @@ public: int GetColumn(int tabsize = 4) const; - Pos(const char *ptr = NULL, int line = 1, String fn = Null) : ptr(ptr), line(line), fn(fn) {} + Pos(const char *ptr = NULL, int line = 1, String fn = Null) : ptr(ptr), line(line), fn(fn), wspc(NULL), lineptr(NULL) {} }; const char *GetPtr() const { return (const char *)term; } diff --git a/uppsrc/Core/Path.cpp b/uppsrc/Core/Path.cpp index edfa2afe4..5f620f46b 100644 --- a/uppsrc/Core/Path.cpp +++ b/uppsrc/Core/Path.cpp @@ -920,6 +920,7 @@ FileSystemInfo::FileInfo::FileInfo() , is_folder(false), is_file(false), is_symlink(false), is_archive(false) , is_compressed(false), is_hidden(false), is_read_only(false), is_system(false) , is_temporary(false), root_style(ROOT_NO_ROOT_DIR) + , unix_mode(0) {} FileSystemInfo& StdFileSystemInfo() diff --git a/uppsrc/Core/Path.h b/uppsrc/Core/Path.h index df6cd61e8..e0dcc7bdd 100644 --- a/uppsrc/Core/Path.h +++ b/uppsrc/Core/Path.h @@ -180,7 +180,7 @@ public: Iterator begin() { Iterator h; h.ff = *this ? this : nullptr; return h; } Iterator end() { Iterator h; h.ff = nullptr; return h; } - FindFile() { file = false; dir = NULL; } + FindFile() :statis(false) { file = false; dir = NULL; } FindFile(const char *name); ~FindFile() { Close(); } }; diff --git a/uppsrc/Core/SHA1.cpp b/uppsrc/Core/SHA1.cpp index 2500fd14c..ec7683e70 100644 --- a/uppsrc/Core/SHA1.cpp +++ b/uppsrc/Core/SHA1.cpp @@ -157,7 +157,10 @@ void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; - memset(block, '\0', sizeof(block)); + + char *bl = reinterpret_cast(&block[0]); + for (int c=sizeof(block); c--; ++bl) + *bl = 0; } /* SHA1Init - Initialize new context */ diff --git a/uppsrc/Core/Stream.cpp b/uppsrc/Core/Stream.cpp index 92e9df196..5b61853ac 100644 --- a/uppsrc/Core/Stream.cpp +++ b/uppsrc/Core/Stream.cpp @@ -76,7 +76,7 @@ void Stream::Close() {} void Stream::Flush() {} -Stream::Stream() { +Stream::Stream() :errorcode(0) { pos = style = 0; buffer = NULL; ptr = rdlim = wrlim = NULL; diff --git a/uppsrc/Core/Stream.h b/uppsrc/Core/Stream.h index e0a02240c..70e75d086 100644 --- a/uppsrc/Core/Stream.h +++ b/uppsrc/Core/Stream.h @@ -535,7 +535,7 @@ private: public: TeeStream(Stream& a, Stream& b) : a(a), b(b) {} - ~TeeStream() { Close(); } + ~TeeStream() { TeeStream::Close(); } }; class FileMapping diff --git a/uppsrc/Core/Value.cpp b/uppsrc/Core/Value.cpp index 9cefd47b8..870f4a339 100644 --- a/uppsrc/Core/Value.cpp +++ b/uppsrc/Core/Value.cpp @@ -340,7 +340,7 @@ INITBLOCK { void Value::Serialize(Stream& s) { RegisterStd(); - dword type; + dword type = 0; if(s.IsLoading()) { s / type; if(type >= 0x8000000) diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index f630b5668..863b49bc8 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -135,8 +135,8 @@ protected: Void *&ptr() { ASSERT(IsRef()); return *(Void **)&data; } Void *ptr() const { ASSERT(IsRef()); return *(Void **)&data; } - void SetRefType(dword type) { ASSERT(IsRef()); ((int *)&data)[2] = type; } - dword GetRefType() const { ASSERT(IsRef()); return ((int *)&data)[2]; } + void SetRefType(dword type) { ASSERT(IsRef() && data.GetLength() >= 3*sizeof(int)); ((int *)&data)[2] = type; } + dword GetRefType() const { ASSERT(IsRef() && data.GetLength() >= 3*sizeof(int)); return ((int *)&data)[2]; } bool IsString() const { return !data.IsSpecial(); } bool Is(byte v) const { return data.IsSpecial(v); } diff --git a/uppsrc/Core/Vcont.h b/uppsrc/Core/Vcont.h index b2be51014..f92168624 100644 --- a/uppsrc/Core/Vcont.h +++ b/uppsrc/Core/Vcont.h @@ -309,7 +309,7 @@ public: T& DoIndex(int i, const T& x) { return At(i, x); } T& AddPick(T&& x) { return items < alloc ? *(::new(Rdd()) T(pick(x))) : GrowAdd(pick(x)); } int GetIndex(const T& item) const; - T& InsertPick(int i, T&& x) { Insert(i, pick(x)); } + void InsertPick(int i, T&& x) { Insert(i, pick(x)); } void InsertPick(int i, Vector&& x) { Insert(i, pick(x)); } void AppendPick(Vector&& x) { InsertPick(GetCount(), pick(x)); } typedef T *Iterator; diff --git a/uppsrc/Core/z.h b/uppsrc/Core/z.h index 39cdc3f99..70e255296 100644 --- a/uppsrc/Core/z.h +++ b/uppsrc/Core/z.h @@ -94,7 +94,7 @@ public: ZCompressStream() {} ZCompressStream(Stream& out) { Open(out); } - ~ZCompressStream() { Close(); } + ~ZCompressStream() { ZCompressStream::Close(); } }; class ZDecompressStream : public InFilterStream { @@ -117,7 +117,7 @@ public: ZDecompressStream() {} ZDecompressStream(Stream& out) { Open(out); } - ~ZDecompressStream() { Close(); } + ~ZDecompressStream() { ZDecompressStream::Close(); } }; int64 CopyStream(Stream& dest, Stream& src, int64 count, Gate progress, int chunk_size = 65536); diff --git a/uppsrc/CppBase/Internal.h b/uppsrc/CppBase/Internal.h index 3ba8e2c0c..3d61af5e2 100644 --- a/uppsrc/CppBase/Internal.h +++ b/uppsrc/CppBase/Internal.h @@ -12,7 +12,7 @@ const Index& GetNamespaceEndMacros(); struct CppMacro : Moveable { String param; - String body; + String body = "\x7f"; byte md5[16]; String Define(const char *s); @@ -51,7 +51,7 @@ struct PPMacro : Moveable { void Serialize(Stream& s) { s % macro % segment_id % line % undef_segment_id; } String ToString() const { return AsString(macro) + " " + AsString(segment_id); } - PPMacro() { segment_id = undef_segment_id = 0; } + PPMacro() :macro(), line(0) { segment_id = undef_segment_id = 0; } }; struct PPFile { // contains "macro extract" of file, only info about macros defined and namespaces diff --git a/uppsrc/CppBase/cpplex.cpp b/uppsrc/CppBase/cpplex.cpp index 7306767f8..1154779dc 100644 --- a/uppsrc/CppBase/cpplex.cpp +++ b/uppsrc/CppBase/cpplex.cpp @@ -83,6 +83,7 @@ void LexSymbolStat::Merge(const LexSymbolStat & other) Lex::Lex() : statsCollected(false) +, ptr(NULL), pos(NULL), grounding(false) { const char **cppk = CppKeyword(); for(int i = 0; cppk[i]; i++)