Work around gcc -Wmissing-field-initializers warning

Use wxZeroMemory() instead of just initializing CREDENTIAL struct with 0
(which probably more efficient, but almost certainly insignificantly so).
This commit is contained in:
Vadim Zeitlin
2016-06-06 00:30:42 +02:00
parent 82a0e285d8
commit e9a836c9dc

View File

@@ -31,8 +31,9 @@
// Somewhat surprisingly, wincred.h is not self-contained and relies on some // Somewhat surprisingly, wincred.h is not self-contained and relies on some
// standard Windows macros being defined without including the headers defining // standard Windows macros being defined without including the headers defining
// them on its own. // them on its own, so we must include <windows.h> (from our private header)
#include "wx/msw/wrapwin.h" // before including it.
#include "wx/msw/private.h"
#include <wincred.h> #include <wincred.h>
namespace namespace
@@ -65,7 +66,8 @@ public:
{ {
const wxString target = MakeTargetName(service, user); const wxString target = MakeTargetName(service, user);
CREDENTIAL cred = { 0 }; CREDENTIAL cred;
wxZeroMemory(cred);
cred.Type = CRED_TYPE_GENERIC; cred.Type = CRED_TYPE_GENERIC;
cred.TargetName = const_cast<TCHAR*>(target.t_str()); cred.TargetName = const_cast<TCHAR*>(target.t_str());
cred.UserName = const_cast<TCHAR*>(user.t_str()); cred.UserName = const_cast<TCHAR*>(user.t_str());