diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index 3d9d1cd2..bcd2f1ed 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -1334,4 +1334,3 @@ void SetCompressor(NCOMPRESSOR compressor) ResetObjects(); } } - diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index 3ec632e9..f09b86fc 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -1135,4 +1135,4 @@ void EnableUICommand(UINT Id, INT_PTR Enabled) { EnableToolBarButton(Id, !!Enabled); EnableMenuItem(g_sdata.menu, Id, Enabled ? MF_ENABLED : MF_GRAYED); -} \ No newline at end of file +} diff --git a/Contrib/UserInfo/UserInfo.c b/Contrib/UserInfo/UserInfo.c index d4c46770..e2a7c54d 100644 --- a/Contrib/UserInfo/UserInfo.c +++ b/Contrib/UserInfo/UserInfo.c @@ -35,13 +35,7 @@ struct group TCHAR *name; }; -// Jim Park: Moved this array from inside the func to the outside. While it -// was probably "safe" for this array to be inside because the strings are in -// the .data section and so the pointer to the string returned is probably -// safe, this is a bad practice to have as that's making an assumption on what -// the compiler will do. Besides which, other types of data returned would -// actually fail as the local vars would be popped off the stack. -struct group groups[] = +static const struct group groups[] = { {DOMAIN_ALIAS_RID_USERS, _T("User")}, // every user belongs to the users group, hence users come before guests diff --git a/Source/Platform.h b/Source/Platform.h index a2c8761a..487e2031 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -1097,9 +1097,9 @@ FORCEINLINE BOOL NoDepr_GetVersionExW(OSVERSIONINFOW*p) { __pragma(warning(push) #ifdef __cplusplus -namespace STLHelpers +namespace STL { - template struct mapped_type_helper { typedef typename M::value_type::second_type type; }; // VC6 uses referent_type and not mapped_type + template struct mapped_type { typedef typename M::value_type::second_type type; }; // VC6 uses referent_type and not mapped_type } #endif //~ __cplusplus diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp index ff4750c4..5e4f4dee 100644 --- a/Source/Plugins.cpp +++ b/Source/Plugins.cpp @@ -266,7 +266,7 @@ bool Plugins::IsPluginCallSyntax(const tstring& token) struct PrintPluginDirsHelper { template static void print(const C&c, const char*indent = "") { - std::/*unordered_*/set::type + std::/*unordered_*/set::type #ifdef _WIN32 , Plugins::strnocasecmp #endif diff --git a/Source/Plugins.h b/Source/Plugins.h index 4c93f00f..cee54e4a 100644 --- a/Source/Plugins.h +++ b/Source/Plugins.h @@ -22,7 +22,7 @@ #include #include "tstring.h" -namespace STLHelpers +namespace STL { template struct string_nocasecmpless : std::binary_function @@ -44,7 +44,7 @@ namespace STLHelpers class Plugins { public: - typedef STLHelpers::string_nocasecmpless strnocasecmp; + typedef STL::string_nocasecmpless strnocasecmp; Plugins() : m_initialized(false) {} diff --git a/Source/build.h b/Source/build.h index d745c0c7..855f162d 100644 --- a/Source/build.h +++ b/Source/build.h @@ -170,14 +170,13 @@ namespace MakensisAPI { #define FLAG_OFFSET(flag) (FIELD_OFFSET(exec_flags_t, flag)/sizeof(int)) class DiagState { - template struct mapped_type_helper { typedef typename STLHelpers::mapped_type_helper::type type; }; template void insert_or_assign(C&c, const K&k, V val) { typename C::value_type item(k, val); std::pair ret = c.insert(item); if (!ret.second) ret.first->second = val; } - template typename mapped_type_helper::type get_paired_value(const C&c, const K&k, typename mapped_type_helper::type defval) const + template typename STL::mapped_type::type get_paired_value(const C&c, const K&k, typename STL::mapped_type::type defval) const { typename C::const_iterator it = c.find(k); return c.end() == it ? defval : it->second; diff --git a/Source/script.cpp b/Source/script.cpp index c7628db5..98daa19c 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2291,18 +2291,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) { manifest_sosl.deleteall(); if (2 == line.getnumtokens()) - { switch(line.gettoken_enum(1,_T("none\0all\0"))) { case 0: return PS_OK; case 1: return manifest_sosl.addall() ? PS_OK : PS_ERROR; } - } for(int argi = 1; argi < line.getnumtokens(); ++argi) - { if (!manifest_sosl.append(line.gettoken_str(argi))) PRINTHELP(); - } } return PS_OK; case TOK_MANIFEST_DISABLEWINDOWFILTERING: diff --git a/Source/scriptpp.cpp b/Source/scriptpp.cpp index 17513a8d..d04b2bc5 100644 --- a/Source/scriptpp.cpp +++ b/Source/scriptpp.cpp @@ -1010,8 +1010,8 @@ int CEXEBuild::pp_define(LineParser&line) int CEXEBuild::pp_undef(LineParser&line) { - UINT noerr = false, stopswitch = false, ti = 1, handled = 0; - for (; ti < line.getnumtokens(); ++ti) + UINT noerr = false, stopswitch = false, handled = 0; + for (int ti = 1; ti < line.getnumtokens(); ++ti) { const TCHAR *name = line.gettoken_str(ti); if (!stopswitch && !_tcsicmp(name, _T("/noerrors")))