diff --git a/Source/build.cpp b/Source/build.cpp index 1630bdb9..39413a9d 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -467,7 +467,7 @@ int CEXEBuild::add_string(const TCHAR *string, int process/*=1*/, UINT codepage/ if (!string || !*string) return 0; build_lockedunicodetarget = true; init_shellconstantvalues(); - if (-2 == codepage) + if ((unsigned)-2 == codepage) { assert(curlinereader); codepage = curlinereader->StreamEncoding().GetCodepage(); diff --git a/Source/lang.cpp b/Source/lang.cpp index c5ef1c49..91e5ac26 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -932,7 +932,11 @@ LanguageTable * CEXEBuild::LoadLangFile(TCHAR *filename) { // Check header TCHAR buf[NSIS_MAX_STRLEN]; - if (!GetNextNLFLine(lr, buf, NSIS_MAX_STRLEN, errlr)) goto l_readerr; + if (!GetNextNLFLine(lr, buf, NSIS_MAX_STRLEN, errlr)) { +l_readerr: + ERROR_MSG(lr.GetErrorMessage(errlr).c_str()); + return 0; + } if (_tcsncmp(buf, _T("NLF v"), 5)) { ERROR_MSG(_T("Error: Invalid language file.\n")); return 0; @@ -1151,10 +1155,6 @@ LanguageTable * CEXEBuild::LoadLangFile(TCHAR *filename) { nlf->m_bLoaded = true; return table; - -l_readerr: - ERROR_MSG(lr.GetErrorMessage(errlr).c_str()); - return 0; } void CEXEBuild::DeleteLangTable(LanguageTable *table) { diff --git a/Source/strlist.cpp b/Source/strlist.cpp index 17a09456..50570d20 100644 --- a/Source/strlist.cpp +++ b/Source/strlist.cpp @@ -165,7 +165,7 @@ int ExeHeadStringList::add(const TCHAR *str, WORD codepage, bool processed) char *bufMB = 0; unsigned int pos = find(str,codepage,processed,m_wide ? 0 : &bufMB); - if (-1 != pos) + if ((unsigned)-1 != pos) { delete[] bufMB; return pos; diff --git a/Source/strlist.h b/Source/strlist.h index a14ebe71..c9b8e413 100644 --- a/Source/strlist.h +++ b/Source/strlist.h @@ -143,7 +143,7 @@ public: bool get(unsigned int offset, tstring&str) const; unsigned int getnum() const; unsigned int gettotalsize() const { return m_gr.get() ? m_gr.getlen() : (m_wide ? 2 : 1); } - void* getstorageptr() const { return m_gr.get() ? m_gr.get() : L""; } + void* getstorageptr() const { return m_gr.get() ? m_gr.get() : (void*)L""; } protected: unsigned int find(const void *str, unsigned int cchF, WORD codepage, bool processed, char**ppBufMB) const; diff --git a/Source/utf.cpp b/Source/utf.cpp index ac0f499d..c9bfb80a 100644 --- a/Source/utf.cpp +++ b/Source/utf.cpp @@ -37,7 +37,7 @@ UINT StrLenUTF16LE(const void*str) bool StrSetUTF16LE(tstring&dest, const void*src) { #ifdef _WIN32 - dest = (unsigned short *) src; + dest = (wchar_t*) src; #else #error TODO: UTF16LE to wchar_t #endif @@ -155,7 +155,8 @@ WORD GetEncodingFromString(const TCHAR*s) void NStreamEncoding::GetCPDisplayName(WORD CP, TCHAR*Buf) { - TCHAR mybuf[10], *p = mybuf; + TCHAR mybuf[10]; + const TCHAR *p = mybuf; switch(CP) { case ACP: p = _T("ACP"); break; diff --git a/Source/util.cpp b/Source/util.cpp index 491a5c21..ef8f1687 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -591,7 +591,7 @@ size_t ExpandoStrFmtVaList(wchar_t*Stack, size_t cchStack, wchar_t**ppMalloc, co for(;;) { cch = ExpandoStrFmtVaList_vsnwprintf(dest, cchAvail, FmtStr, Args); - if (-1 == cch) + if ((unsigned)-1 == cch) { cch = 0; if (cansizecalc) break; // vswprintf error, abort!