'Dummy' warning fixes (might be used uninitialized).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-03-14 20:00:42 +00:00
parent 6ca3a32256
commit ba9bbf1388
5 changed files with 119 additions and 124 deletions

View File

@@ -2739,7 +2739,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
}
// and now the interesting part: the timezone
int offset;
int offset wxDUMMY_INITIALIZE(0);
if ( *p == _T('-') || *p == _T('+') )
{
// the explicit offset given: it has the form of hhmm

View File

@@ -1809,10 +1809,8 @@ int wxString::Printf(const wxChar *pszFormat, ...)
int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
{
int size = 1024;
int len;
for ( ;; )
{
{
wxStringBuffer tmp(*this, size + 1);
wxChar* buf = tmp;
@@ -1827,14 +1825,13 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
// only a copy
va_list argptrcopy;
wxVaCopy(argptrcopy, argptr);
len = wxVsnprintf(buf, size, pszFormat, argptrcopy);
int len = wxVsnprintf(buf, size, pszFormat, argptrcopy);
va_end(argptrcopy);
// some implementations of vsnprintf() don't NUL terminate
// the string if there is not enough space for it so
// always do it manually
buf[size] = _T('\0');
}
// vsnprintf() may return either -1 (traditional Unix behaviour) or the
// total number of characters which would have been written if the

View File

@@ -668,7 +668,6 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
wxChar key[64];
const char *clr_def;
bool hasMask;
wxXPMColourMapData clr_data;
wxXPMColourMap clr_tbl;
wxXPMColourMap::iterator it;
wxString maskKey;
@@ -702,6 +701,8 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
*/
for (i = 0; i < colors_cnt; i++)
{
wxXPMColourMapData clr_data = {255,0,255};
for (i_key = 0; i_key < chars_per_pixel; i_key++)
key[i_key] = (wxChar)xpm_data[1 + i][i_key];
clr_def = ParseColor(xpm_data[1 + i] + chars_per_pixel);
@@ -710,17 +711,15 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
{
wxLogError(_("XPM: malformed colour definition '%s'!"),
xpm_data[1+i]);
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
}
else
{
bool isNone;
bool isNone = false;
if ( !GetRGBFromName(clr_def, &isNone,
&clr_data.R, &clr_data.G, &clr_data.B) )
{
wxLogError(_("XPM: malformed colour definition '%s'!"),
xpm_data[1+i]);
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
}
else
{
@@ -729,7 +728,6 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
img.SetMask(true);
img.SetMaskColour(255, 0, 255);
hasMask = true;
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
maskKey = key;
}
}

View File

@@ -1765,7 +1765,7 @@ wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
default : nextpos = pos; break; /* just to fool compiler, never happens */
}
size_t toskip;
size_t toskip wxDUMMY_INITIALIZE(0);
if ( nextpos >= pos )
{
toskip = (size_t)(nextpos - pos);

View File

@@ -1157,7 +1157,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
// open file
// ---------
bool bOk;
bool bOk wxDUMMY_INITIALIZE(false);
if ( wxFile::Exists(filename) ) {
bool bAppend = false;
wxString strMsg;