From 567969bcfbc5e9f00f0a5133afa2b8b1c2945f53 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 31 Aug 2018 13:24:21 +0200 Subject: [PATCH] Resolve overlapping variable name warnings --- include/WinStd/COM.h | 4 ++-- include/WinStd/Common.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/WinStd/COM.h b/include/WinStd/COM.h index 4fd8d0f4..56d87c4c 100644 --- a/include/WinStd/COM.h +++ b/include/WinStd/COM.h @@ -968,9 +968,9 @@ namespace winstd /// /// \sa [VariantChangeType function](https://msdn.microsoft.com/en-us/library/windows/desktop/ms221258.aspx) /// - inline HRESULT change_type(_In_ VARTYPE vt, _In_opt_ USHORT wFlags = 0) + inline HRESULT change_type(_In_ VARTYPE _vt, _In_opt_ USHORT wFlags = 0) { - return VariantChangeType(this, this, wFlags, vt); + return VariantChangeType(this, this, wFlags, _vt); } private: diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index a5a03af7..b48116bb 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -1727,10 +1727,10 @@ inline int vsprintf(_Out_ std::basic_string<_Elem, _Traits, _Ax> &str, _In_z_ _P } else { for (size_t capacity = 2*WINSTD_STACK_BUFFER_BYTES/sizeof(_Elem);; capacity *= 2) { // Allocate on heap and retry. - std::unique_ptr<_Elem[]> buf(new _Elem[capacity]); - count = vsnprintf(buf.get(), capacity - 1, format, arg); + std::unique_ptr<_Elem[]> buf_dyn(new _Elem[capacity]); + count = vsnprintf(buf_dyn.get(), capacity - 1, format, arg); if (count >= 0) { - str.assign(buf.get(), count); + str.assign(buf_dyn.get(), count); break; } }