Work around "possibly uninitialized variable" warning in wxFileName.
Initialize multiplier to its default value in GetHumanReadableSize() to avoid a "warning: 'multiplier' may be used uninitialized in this function" from g++. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2656,17 +2656,18 @@ wxString wxFileName::GetHumanReadableSize(const wxULongLong &bs,
|
|||||||
|
|
||||||
// depending on the convention used the multiplier may be either 1000 or
|
// depending on the convention used the multiplier may be either 1000 or
|
||||||
// 1024 and the binary infix may be empty (for "KB") or "i" (for "KiB")
|
// 1024 and the binary infix may be empty (for "KB") or "i" (for "KiB")
|
||||||
double multiplier;
|
double multiplier = 1024.;
|
||||||
wxString biInfix;
|
wxString biInfix;
|
||||||
|
|
||||||
switch ( conv )
|
switch ( conv )
|
||||||
{
|
{
|
||||||
|
case wxSIZE_CONV_TRADITIONAL:
|
||||||
|
// nothing to do, this corresponds to the default values of both
|
||||||
|
// the multiplier and infix string
|
||||||
|
break;
|
||||||
|
|
||||||
case wxSIZE_CONV_IEC:
|
case wxSIZE_CONV_IEC:
|
||||||
biInfix = "i";
|
biInfix = "i";
|
||||||
// fall through
|
|
||||||
|
|
||||||
case wxSIZE_CONV_TRADITIONAL:
|
|
||||||
multiplier = 1024.;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxSIZE_CONV_SI:
|
case wxSIZE_CONV_SI:
|
||||||
|
Reference in New Issue
Block a user