'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:
@@ -364,7 +364,7 @@ static long GetTruncatedJDN(wxDateTime::wxDateTime_t day,
|
|||||||
static wxString CallStrftime(const wxChar *format, const tm* tm)
|
static wxString CallStrftime(const wxChar *format, const tm* tm)
|
||||||
{
|
{
|
||||||
wxChar buf[4096];
|
wxChar buf[4096];
|
||||||
if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) )
|
if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) )
|
||||||
{
|
{
|
||||||
// buffer is too small?
|
// buffer is too small?
|
||||||
wxFAIL_MSG(_T("strftime() failed"));
|
wxFAIL_MSG(_T("strftime() failed"));
|
||||||
@@ -829,47 +829,47 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month,
|
|||||||
|
|
||||||
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
|
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
|
||||||
#else
|
#else
|
||||||
wxString ret;
|
wxString ret;
|
||||||
switch(month)
|
switch(month)
|
||||||
{
|
{
|
||||||
case Jan:
|
case Jan:
|
||||||
ret = (flags == Name_Abbr ? wxT("Jan"): wxT("January"));
|
ret = (flags == Name_Abbr ? wxT("Jan"): wxT("January"));
|
||||||
break;
|
break;
|
||||||
case Feb:
|
case Feb:
|
||||||
ret = (flags == Name_Abbr ? wxT("Feb"): wxT("Febuary"));
|
ret = (flags == Name_Abbr ? wxT("Feb"): wxT("Febuary"));
|
||||||
break;
|
break;
|
||||||
case Mar:
|
case Mar:
|
||||||
ret = (flags == Name_Abbr ? wxT("Mar"): wxT("March"));
|
ret = (flags == Name_Abbr ? wxT("Mar"): wxT("March"));
|
||||||
break;
|
break;
|
||||||
case Apr:
|
case Apr:
|
||||||
ret = (flags == Name_Abbr ? wxT("Apr"): wxT("April"));
|
ret = (flags == Name_Abbr ? wxT("Apr"): wxT("April"));
|
||||||
break;
|
break;
|
||||||
case May:
|
case May:
|
||||||
ret = (flags == Name_Abbr ? wxT("May"): wxT("May"));
|
ret = (flags == Name_Abbr ? wxT("May"): wxT("May"));
|
||||||
break;
|
break;
|
||||||
case Jun:
|
case Jun:
|
||||||
ret = (flags == Name_Abbr ? wxT("Jun"): wxT("June"));
|
ret = (flags == Name_Abbr ? wxT("Jun"): wxT("June"));
|
||||||
break;
|
break;
|
||||||
case Jul:
|
case Jul:
|
||||||
ret = (flags == Name_Abbr ? wxT("Jul"): wxT("July"));
|
ret = (flags == Name_Abbr ? wxT("Jul"): wxT("July"));
|
||||||
break;
|
break;
|
||||||
case Aug:
|
case Aug:
|
||||||
ret = (flags == Name_Abbr ? wxT("Aug"): wxT("August"));
|
ret = (flags == Name_Abbr ? wxT("Aug"): wxT("August"));
|
||||||
break;
|
break;
|
||||||
case Sep:
|
case Sep:
|
||||||
ret = (flags == Name_Abbr ? wxT("Sep"): wxT("September"));
|
ret = (flags == Name_Abbr ? wxT("Sep"): wxT("September"));
|
||||||
break;
|
break;
|
||||||
case Oct:
|
case Oct:
|
||||||
ret = (flags == Name_Abbr ? wxT("Oct"): wxT("October"));
|
ret = (flags == Name_Abbr ? wxT("Oct"): wxT("October"));
|
||||||
break;
|
break;
|
||||||
case Nov:
|
case Nov:
|
||||||
ret = (flags == Name_Abbr ? wxT("Nov"): wxT("November"));
|
ret = (flags == Name_Abbr ? wxT("Nov"): wxT("November"));
|
||||||
break;
|
break;
|
||||||
case Dec:
|
case Dec:
|
||||||
ret = (flags == Name_Abbr ? wxT("Dec"): wxT("December"));
|
ret = (flags == Name_Abbr ? wxT("Dec"): wxT("December"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -897,32 +897,32 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
|
|||||||
// ... and call strftime()
|
// ... and call strftime()
|
||||||
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
|
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
|
||||||
#else
|
#else
|
||||||
wxString ret;
|
wxString ret;
|
||||||
switch(wday)
|
switch(wday)
|
||||||
{
|
{
|
||||||
case Sun:
|
case Sun:
|
||||||
ret = (flags == Name_Abbr ? wxT("Sun") : wxT("Sunday"));
|
ret = (flags == Name_Abbr ? wxT("Sun") : wxT("Sunday"));
|
||||||
break;
|
break;
|
||||||
case Mon:
|
case Mon:
|
||||||
ret = (flags == Name_Abbr ? wxT("Mon") : wxT("Monday"));
|
ret = (flags == Name_Abbr ? wxT("Mon") : wxT("Monday"));
|
||||||
break;
|
break;
|
||||||
case Tue:
|
case Tue:
|
||||||
ret = (flags == Name_Abbr ? wxT("Tue") : wxT("Tuesday"));
|
ret = (flags == Name_Abbr ? wxT("Tue") : wxT("Tuesday"));
|
||||||
break;
|
break;
|
||||||
case Wed:
|
case Wed:
|
||||||
ret = (flags == Name_Abbr ? wxT("Wed") : wxT("Wednesday"));
|
ret = (flags == Name_Abbr ? wxT("Wed") : wxT("Wednesday"));
|
||||||
break;
|
break;
|
||||||
case Thu:
|
case Thu:
|
||||||
ret = (flags == Name_Abbr ? wxT("Thu") : wxT("Thursday"));
|
ret = (flags == Name_Abbr ? wxT("Thu") : wxT("Thursday"));
|
||||||
break;
|
break;
|
||||||
case Fri:
|
case Fri:
|
||||||
ret = (flags == Name_Abbr ? wxT("Fri") : wxT("Friday"));
|
ret = (flags == Name_Abbr ? wxT("Fri") : wxT("Friday"));
|
||||||
break;
|
break;
|
||||||
case Sat:
|
case Sat:
|
||||||
ret = (flags == Name_Abbr ? wxT("Sat") : wxT("Saturday"));
|
ret = (flags == Name_Abbr ? wxT("Sat") : wxT("Saturday"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -2201,7 +2201,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
//Windows CE doesn't support strftime or wcsftime, so we use the generic implementation
|
//Windows CE doesn't support strftime or wcsftime, so we use the generic implementation
|
||||||
if ( tm )
|
if ( tm )
|
||||||
{
|
{
|
||||||
return CallStrftime(format, tm);
|
return CallStrftime(format, tm);
|
||||||
@@ -2416,9 +2416,9 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
res += str;
|
res += str;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
//Use "%m/%d/%y %H:%M:%S" format instead
|
//Use "%m/%d/%y %H:%M:%S" format instead
|
||||||
res += wxString::Format(wxT("%02d/%02d/%04d %02d:%02d:%02d"),
|
res += wxString::Format(wxT("%02d/%02d/%04d %02d:%02d:%02d"),
|
||||||
tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec);
|
tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2459,7 +2459,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
res += CallStrftime(_T("%p"), &tmTimeOnly);
|
res += CallStrftime(_T("%p"), &tmTimeOnly);
|
||||||
#else
|
#else
|
||||||
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
|
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2486,7 +2486,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
res += CallStrftime(_T("%X"), &tmTimeOnly);
|
res += CallStrftime(_T("%X"), &tmTimeOnly);
|
||||||
#else
|
#else
|
||||||
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
|
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2739,7 +2739,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// and now the interesting part: the timezone
|
// and now the interesting part: the timezone
|
||||||
int offset;
|
int offset wxDUMMY_INITIALIZE(0);
|
||||||
if ( *p == _T('-') || *p == _T('+') )
|
if ( *p == _T('-') || *p == _T('+') )
|
||||||
{
|
{
|
||||||
// the explicit offset given: it has the form of hhmm
|
// the explicit offset given: it has the form of hhmm
|
||||||
|
@@ -1796,46 +1796,43 @@ wxString wxString::FormatV(const wxChar *pszFormat, va_list argptr)
|
|||||||
|
|
||||||
int wxString::Printf(const wxChar *pszFormat, ...)
|
int wxString::Printf(const wxChar *pszFormat, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
va_start(argptr, pszFormat);
|
va_start(argptr, pszFormat);
|
||||||
|
|
||||||
int iLen = PrintfV(pszFormat, argptr);
|
int iLen = PrintfV(pszFormat, argptr);
|
||||||
|
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
return iLen;
|
return iLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
|
int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
|
||||||
{
|
{
|
||||||
int size = 1024;
|
int size = 1024;
|
||||||
int len;
|
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
|
wxStringBuffer tmp(*this, size + 1);
|
||||||
|
wxChar* buf = tmp;
|
||||||
|
|
||||||
|
if ( !buf )
|
||||||
{
|
{
|
||||||
wxStringBuffer tmp(*this, size + 1);
|
// out of memory
|
||||||
wxChar* buf = tmp;
|
return -1;
|
||||||
|
|
||||||
if ( !buf )
|
|
||||||
{
|
|
||||||
// out of memory
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// wxVsnprintf() may modify the original arg pointer, so pass it
|
|
||||||
// only a copy
|
|
||||||
va_list argptrcopy;
|
|
||||||
wxVaCopy(argptrcopy, argptr);
|
|
||||||
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');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wxVsnprintf() may modify the original arg pointer, so pass it
|
||||||
|
// only a copy
|
||||||
|
va_list argptrcopy;
|
||||||
|
wxVaCopy(argptrcopy, argptr);
|
||||||
|
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
|
// vsnprintf() may return either -1 (traditional Unix behaviour) or the
|
||||||
// total number of characters which would have been written if the
|
// total number of characters which would have been written if the
|
||||||
// buffer were large enough
|
// buffer were large enough
|
||||||
|
@@ -668,7 +668,6 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
|
|||||||
wxChar key[64];
|
wxChar key[64];
|
||||||
const char *clr_def;
|
const char *clr_def;
|
||||||
bool hasMask;
|
bool hasMask;
|
||||||
wxXPMColourMapData clr_data;
|
|
||||||
wxXPMColourMap clr_tbl;
|
wxXPMColourMap clr_tbl;
|
||||||
wxXPMColourMap::iterator it;
|
wxXPMColourMap::iterator it;
|
||||||
wxString maskKey;
|
wxString maskKey;
|
||||||
@@ -702,6 +701,8 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < colors_cnt; i++)
|
for (i = 0; i < colors_cnt; i++)
|
||||||
{
|
{
|
||||||
|
wxXPMColourMapData clr_data = {255,0,255};
|
||||||
|
|
||||||
for (i_key = 0; i_key < chars_per_pixel; i_key++)
|
for (i_key = 0; i_key < chars_per_pixel; i_key++)
|
||||||
key[i_key] = (wxChar)xpm_data[1 + i][i_key];
|
key[i_key] = (wxChar)xpm_data[1 + i][i_key];
|
||||||
clr_def = ParseColor(xpm_data[1 + i] + chars_per_pixel);
|
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'!"),
|
wxLogError(_("XPM: malformed colour definition '%s'!"),
|
||||||
xpm_data[1+i]);
|
xpm_data[1+i]);
|
||||||
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool isNone;
|
bool isNone = false;
|
||||||
if ( !GetRGBFromName(clr_def, &isNone,
|
if ( !GetRGBFromName(clr_def, &isNone,
|
||||||
&clr_data.R, &clr_data.G, &clr_data.B) )
|
&clr_data.R, &clr_data.G, &clr_data.B) )
|
||||||
{
|
{
|
||||||
wxLogError(_("XPM: malformed colour definition '%s'!"),
|
wxLogError(_("XPM: malformed colour definition '%s'!"),
|
||||||
xpm_data[1+i]);
|
xpm_data[1+i]);
|
||||||
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -729,7 +728,6 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
|
|||||||
img.SetMask(true);
|
img.SetMask(true);
|
||||||
img.SetMaskColour(255, 0, 255);
|
img.SetMaskColour(255, 0, 255);
|
||||||
hasMask = true;
|
hasMask = true;
|
||||||
clr_data.R = 255, clr_data.G = 0, clr_data.B = 255;
|
|
||||||
maskKey = key;
|
maskKey = key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1765,7 +1765,7 @@ wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
|
|||||||
default : nextpos = pos; break; /* just to fool compiler, never happens */
|
default : nextpos = pos; break; /* just to fool compiler, never happens */
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t toskip;
|
size_t toskip wxDUMMY_INITIALIZE(0);
|
||||||
if ( nextpos >= pos )
|
if ( nextpos >= pos )
|
||||||
{
|
{
|
||||||
toskip = (size_t)(nextpos - pos);
|
toskip = (size_t)(nextpos - pos);
|
||||||
|
@@ -1157,7 +1157,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
|||||||
|
|
||||||
// open file
|
// open file
|
||||||
// ---------
|
// ---------
|
||||||
bool bOk;
|
bool bOk wxDUMMY_INITIALIZE(false);
|
||||||
if ( wxFile::Exists(filename) ) {
|
if ( wxFile::Exists(filename) ) {
|
||||||
bool bAppend = false;
|
bool bAppend = false;
|
||||||
wxString strMsg;
|
wxString strMsg;
|
||||||
|
Reference in New Issue
Block a user