From aad866369888600a65b607c386c3238c6c4f70e8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Nov 2016 17:59:27 +0100 Subject: [PATCH] Avoid harmless warning about shadowing a parameter Rename GetSysErrorMsg() buffer size parameter introduced in the recent commit 343318d73ed24b1d94ddeaafa9339c38c947dcbd to avoid clash with the local variable of the same name. See https://github.com/wxWidgets/wxWidgets/pull/343 --- src/common/log.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index 137c05a0cc..fc74921b8d 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1057,7 +1057,7 @@ unsigned long wxSysErrorCode() #endif //Win/Unix } -static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t len, unsigned long nErrCode) +static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long nErrCode) { if ( nErrCode == 0 ) nErrCode = wxSysErrorCode(); @@ -1087,7 +1087,7 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t len, unsigned long nEr // Crashes on SmartPhone (FIXME) if( lpMsgBuf != 0 ) { - wxStrlcpy(szBuf, (const wxChar *)lpMsgBuf, len); + wxStrlcpy(szBuf, (const wxChar *)lpMsgBuf, sizeBuf); LocalFree(lpMsgBuf); @@ -1121,10 +1121,10 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t len, unsigned long nEr // at this point errorMsg might not point to buffer anymore szBuf[0] = wxS('\0'); #if wxUSE_UNICODE - wxConvCurrent->MB2WC(szBuf, errorMsg, len - 1); - szBuf[len - 1] = wxS('\0'); + wxConvCurrent->MB2WC(szBuf, errorMsg, sizeBuf - 1); + szBuf[sizeBuf - 1] = wxS('\0'); #else - wxStrlcpy(szBuf, errorMsg, len); + wxStrlcpy(szBuf, errorMsg, sizeBuf); #endif return szBuf; #endif // __WINDOWS__/!__WINDOWS__