warning fixes for BCC and OW (heavily modified patch 819146)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-10-16 10:28:15 +00:00
parent 0cc66b6c0b
commit 999836aaca
62 changed files with 175 additions and 266 deletions

View File

@@ -172,14 +172,9 @@ wxSizer *wxDialogBase::CreateButtonSizer( long flags )
{
bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
wxBoxSizer *box = NULL;
// If we have a PDA screen, put yes/no button over
// all other buttons, otherwise on the left side.
if (is_pda)
box = new wxBoxSizer( wxVERTICAL );
else
box = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *box = is_pda ? new wxBoxSizer( wxVERTICAL ) : new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *inner_yes_no = NULL;

View File

@@ -165,11 +165,9 @@ void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event)
// ...since it will be deleted by wxWindows if we return TRUE.
if (m_childView)
{
bool ans = FALSE;
if (!event.CanVeto())
ans = TRUE; // Must delete.
else
ans = m_childView->Close(FALSE); // FALSE means don't delete associated window
bool ans = event.CanVeto()
? m_childView->Close(FALSE) // FALSE means don't delete associated window
: TRUE; // Must delete.
if (ans)
{

View File

@@ -952,8 +952,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
if (printout)
{
// Pass two printout objects: for preview, and possible printing.
wxPrintPreviewBase *preview = (wxPrintPreviewBase *) NULL;
preview = new wxPrintPreview(printout, view->OnCreatePrintout());
wxPrintPreviewBase *preview = new wxPrintPreview(printout, view->OnCreatePrintout());
wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), _("Print Preview"),
wxPoint(100, 100), wxSize(600, 650));
@@ -1175,7 +1174,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
}
// Existing document
wxDocTemplate *temp = (wxDocTemplate *) NULL;
wxDocTemplate *temp;
wxString path2(wxT(""));
if (path != wxT(""))
@@ -1788,11 +1787,9 @@ void wxDocChildFrame::OnCloseWindow(wxCloseEvent& event)
{
if (m_childView)
{
bool ans = FALSE;
if (!event.CanVeto())
ans = TRUE; // Must delete.
else
ans = m_childView->Close(FALSE); // FALSE means don't delete associated window
bool ans = event.CanVeto()
? m_childView->Close(FALSE) // FALSE means don't delete associated window
: TRUE; // Must delete.
if (ans)
{
@@ -1906,8 +1903,10 @@ bool wxDocPrintout::OnPrintPage(int WXUNUSED(page))
// Get the logical pixels per inch of screen and printer
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
wxUnusedVar(ppiScreenY);
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
wxUnusedVar(ppiPrinterY);
// This scales the DC so that the printout roughly represents the
// the screen scaling. The text point size _should_ be the right size
@@ -1922,6 +1921,7 @@ bool wxDocPrintout::OnPrintPage(int WXUNUSED(page))
int w, h;
dc->GetSize(&w, &h);
GetPageSizePixels(&pageWidth, &pageHeight);
wxUnusedVar(pageHeight);
// If printer pageWidth == current DC width, then this doesn't
// change. But w might be the preview bitmap width, so scale down.

View File

@@ -326,6 +326,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
bool failed = FALSE;
void *symbol = 0;
wxUnusedVar(symbol);
#if defined(__WXMAC__) && !defined(__DARWIN__)
Ptr symAddress;
CFragSymbolClass symClass;

View File

@@ -89,7 +89,7 @@ wxEncodingConverter::wxEncodingConverter()
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
{
unsigned i;
wxUint16 *in_tbl = NULL, *out_tbl = NULL;
wxUint16 *in_tbl, *out_tbl = NULL;
if (m_Table) {delete[] m_Table; m_Table = NULL;}

View File

@@ -325,8 +325,7 @@ wxString wxPathList::FindValidPath (const wxString& file)
wxChar buf[_MAXPATHLEN];
wxStrcpy(buf, wxFileFunctionsBuffer);
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
wxChar *filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
for (wxStringList::compatibility_iterator node = GetFirst(); node; node = node->GetNext())
{
@@ -732,9 +731,9 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
#endif
// Handle environment
const wxChar *val = (const wxChar *) NULL;
const wxChar *val;
#ifndef __WXWINCE__
wxChar *tcp = (wxChar *) NULL;
wxChar *tcp;
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL)
{
@@ -748,7 +747,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
#endif
// Handle User's home (ignore root homes!)
size_t len = 0;
size_t len;
if ((val = wxGetUserHome (user)) != NULL &&
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
@@ -1144,9 +1143,9 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
if ( !wxGetTempFileName( wxT("cat"), outfile) )
return FALSE;
FILE *fp1 = (FILE *) NULL;
FILE *fp2 = (FILE *) NULL;
FILE *fp3 = (FILE *) NULL;
FILE *fp1 wxDUMMY_INITIALIZE(NULL);
FILE *fp2 wxDUMMY_INITIALIZE(NULL);
FILE *fp3 wxDUMMY_INITIALIZE(NULL);
// Open the inputs and outputs
if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL ||
(fp2 = wxFopen ( file2, wxT("rb"))) == NULL ||
@@ -1454,7 +1453,7 @@ wxString wxFindFirstFile(const wxChar *spec, int flags)
return wxEmptyString;
}
int dirFlags = 0;
int dirFlags;
switch (flags)
{
case wxDIR: dirFlags = wxDIR_DIRS; break;
@@ -1503,7 +1502,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
buf = new wxChar[sz + 1];
}
bool ok = FALSE;
bool ok wxDUMMY_INITIALIZE(FALSE);
// for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation

View File

@@ -804,7 +804,9 @@ int wxFTP::GetFileSize(const wxString& fileName)
SetTransferMode(oldTransfermode);
}
if ( !ok ) // this is not a direct else clause.. The size command might return an invalid "2yz" reply
// this is not a direct else clause.. The size command might return an
// invalid "2yz" reply
if ( !ok )
{
// The server didn't understand the "SIZE"-command or it
// returned an invalid reply.
@@ -849,12 +851,7 @@ int wxFTP::GetFileSize(const wxString& fileName)
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %*s %*s %i %*s %*s %*s %*s"),
&filesize) == 9 )
{
// We've gotten a good response
ok = TRUE;
}
else
&filesize) != 9 )
{
// Hmm... Invalid response
wxLogTrace(FTP_TRACE_MASK,
@@ -865,12 +862,7 @@ int wxFTP::GetFileSize(const wxString& fileName)
{
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %i %*s"),
&filesize) == 4 )
{
// valid response
ok = TRUE;
}
else
&filesize) != 4 )
{
// something bad happened..?
wxLogTrace(FTP_TRACE_MASK,

View File

@@ -459,7 +459,7 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
wxUint16 aWord;
// allocate space for palette if needed:
_cmap *cmap = NULL;
_cmap *cmap;
if ( bpp < 16 )
{
@@ -602,27 +602,23 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
ptr = data;
}
int line = 0;
int column = 0;
int linesize = ((width * bpp + 31) / 32) * 4;
/* BMPs are stored upside down */
for ( line = (height - 1); line >= 0; line-- )
for ( int line = (height - 1); line >= 0; line-- )
{
int linepos = 0;
for ( column = 0; column < width ; )
for ( int column = 0; column < width ; )
{
if ( bpp < 16 )
{
int index = 0;
linepos++;
aByte = stream.GetC();
if ( bpp == 1 )
{
int bit = 0;
for (bit = 0; bit < 8 && column < width; bit++)
for (int bit = 0; bit < 8 && column < width; bit++)
{
index = ((aByte & (0x80 >> bit)) ? 1 : 0);
int index = ((aByte & (0x80 >> bit)) ? 1 : 0);
ptr[poffset] = cmap[index].r;
ptr[poffset + 1] = cmap[index].g;
ptr[poffset + 2] = cmap[index].b;
@@ -700,10 +696,9 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
}
else
{
int nibble = 0;
for (nibble = 0; nibble < 2 && column < width; nibble++)
for (int nibble = 0; nibble < 2 && column < width; nibble++)
{
index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
int index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
if ( index >= 16 )
index = 15;
ptr[poffset] = cmap[index].r;

View File

@@ -1804,8 +1804,8 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
w3 * *(v3++) + w4 * *(v4++)) /
(w1 + w2 + w3 + w4) );
*(dst++) = (unsigned char)
( (w1 * *(v1++) + w2 * *(v2++) +
w3 * *(v3++) + w4 * *(v4++)) /
( (w1 * *v1 + w2 * *v2 +
w3 * *v3 + w4 * *v4) /
(w1 + w2 + w3 + w4) );
}
}
@@ -1835,7 +1835,7 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
unsigned char *p = data[ys] + (3 * xs);
*(dst++) = *(p++);
*(dst++) = *(p++);
*(dst++) = *(p++);
*(dst++) = *p;
}
else
{

View File

@@ -178,7 +178,6 @@ void jpeg_wxio_src( j_decompress_ptr cinfo, wxInputStream& infile )
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
sizeof(my_source_mgr));
src = (my_src_ptr) cinfo->src;
}
src = (my_src_ptr) cinfo->src;
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */

View File

@@ -460,25 +460,27 @@ void CopyDataFromPNG(wxImage *image,
case Transparency_Mask:
if ( IsTransparent(a) )
{
// if we couldn't find a unique colour for the mask, we
// can have real pixels with the same value as the mask
// and it's better to slightly change their colour than
// to make them transparent
if ( r == rMask && g == gMask && b == bMask )
{
r++;
}
*ptrDst++ = rMask;
*ptrDst++ = bMask;
*ptrDst++ = gMask;
break;
}
// else: !transparent
else // !transparent
{
// must be opaque then as otherwise we shouldn't be
// using the mask at all
wxASSERT_MSG( IsOpaque(a), _T("logic error") );
// must be opaque then as otherwise we shouldn't be
// using the mask at all
wxASSERT_MSG( IsOpaque(a), _T("logic error") );
// if we couldn't find a unique colour for the
// mask, we can have real pixels with the same
// value as the mask and it's better to slightly
// change their colour than to make them
// transparent
if ( r == rMask && g == gMask && b == bMask )
{
r++;
}
}
// fall through

View File

@@ -1566,7 +1566,11 @@ bool wxLocale::Init(int language, int flags)
}
else
{
int codepage = -1;
int codepage
#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
= -1
#endif
;
wxUint32 lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang),
SORT_DEFAULT);
// FIXME

View File

@@ -772,12 +772,6 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
int actualWidth = (int)(zoomScale*m_pageWidth*m_previewScale);
int actualHeight = (int)(zoomScale*m_pageHeight*m_previewScale);
int x = (int)((canvasWidth - actualWidth)/2.0);
if (x < m_leftMargin)
x = m_leftMargin;
// int y = m_topMargin;
if (!m_previewBitmap)
{
m_previewBitmap = new wxBitmap((int)actualWidth, (int)actualHeight);

View File

@@ -1302,7 +1302,6 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
int i;
if (is_pre_scan) {
/* Set up method pointers */
@@ -1314,9 +1313,6 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
cquantize->pub.color_quantize = pass2_fs_dither;
cquantize->pub.finish_pass = finish_pass2;
/* Make sure color count is acceptable */
i = cinfo->actual_number_of_colors;
{
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
(3 * sizeof(FSERROR)));
@@ -1334,7 +1330,7 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
}
/* Zero the histogram or inverse color map, if necessary */
if (cquantize->needs_zeroed) {
for (i = 0; i < HIST_C0_ELEMS; i++) {
for (int i = 0; i < HIST_C0_ELEMS; i++) {
memset((void *) histogram[i], 0,
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
}
@@ -1510,8 +1506,6 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
{
int i;
int w = src.GetWidth();
int h = src.GetHeight();
int windowsSystemColourCount = 20;
@@ -1529,8 +1523,9 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
#endif
// create rows info:
int h = src.GetHeight();
int w = src.GetWidth();
unsigned char **rows = new unsigned char *[h];
h = src.GetHeight(), w = src.GetWidth();
unsigned char *imgdt = src.GetData();
for (i = 0; i < h; i++)
rows[i] = imgdt + 3/*RGB*/ * w * i;

View File

@@ -531,7 +531,6 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event)
if (!connection)
return;
int msg = 0;
wxDataInputStream *codeci;
wxDataOutputStream *codeco;
wxSocketStream *sockstrm;
@@ -551,7 +550,7 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event)
codeci = connection->m_codeci;
codeco = connection->m_codeco;
sockstrm = connection->m_sockstrm;
msg = codeci->Read8();
int msg = codeci->Read8();
switch (msg)
{

View File

@@ -303,7 +303,6 @@ wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes)
wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
{
int total;
int ret = 1;
// Try the pushback buffer first
total = GetPushback(buffer, nbytes, FALSE);
@@ -325,6 +324,7 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
int ret;
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
@@ -504,7 +504,6 @@ wxSocketBase& wxSocketBase::Write(const void *buffer, wxUint32 nbytes)
wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
{
wxUint32 total = 0;
int ret = 1;
// If the socket is invalid or parameters are ill, return immediately
if (!m_socket || !buffer || !nbytes)
@@ -516,6 +515,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
int ret;
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
@@ -930,6 +930,7 @@ void wxSocketBase::OnRequest(wxSocketNotify notification)
// Schedule the event
wxSocketEventFlags flag = 0;
wxUnusedVar(flag);
switch (notification)
{
case GSOCK_INPUT: flag = GSOCK_INPUT_FLAG; break;

View File

@@ -111,7 +111,8 @@ static size_t encode_utf16(wxUint32 input, wxUint16 *output)
{
if (input<=0xffff)
{
if (output) *output++ = (wxUint16) input;
if (output)
*output = (wxUint16) input;
return 1;
}
else if (input>=0x110000)
@@ -123,7 +124,7 @@ static size_t encode_utf16(wxUint32 input, wxUint16 *output)
if (output)
{
*output++ = (wxUint16) ((input >> 10)+0xd7c0);
*output++ = (wxUint16) ((input&0x3ff)+0xdc00);
*output = (wxUint16) ((input&0x3ff)+0xdc00);
}
return 2;
}

View File

@@ -454,7 +454,7 @@ size_t wxStreamBuffer::Write(const void *buffer, size_t size)
m_stream->Reset();
}
size_t ret = 0;
size_t ret;
if ( !HasBuffer() && m_fixed )
{

View File

@@ -97,10 +97,9 @@ wxChar wxTextInputStream::NextChar()
wxChar wxTextInputStream::NextNonSeparators()
{
wxChar c = (wxChar) 0;
for (;;)
{
c = NextChar();
wxChar c = NextChar();
if (c == wxEOT) return (wxChar) 0;
if (c != wxT('\n') &&

View File

@@ -272,8 +272,6 @@ bool wxURL::FetchProtocol()
wxInputStream *wxURL::GetInputStream()
{
wxInputStream *the_i_stream = NULL;
if (!m_protocol)
{
m_error = wxURL_NOPROTO;
@@ -310,10 +308,9 @@ wxInputStream *wxURL::GetInputStream()
#endif
// When we use a proxy, we have to pass the whole URL to it.
if (m_useProxy)
the_i_stream = m_protocol->GetInputStream(m_url);
else
the_i_stream = m_protocol->GetInputStream(m_path);
wxInputStream *the_i_stream =
(m_useProxy) ? m_protocol->GetInputStream(m_url) :
m_protocol->GetInputStream(m_path);
if (!the_i_stream)
{

View File

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

View File

@@ -668,11 +668,9 @@ bool wxCalendarCtrl::IsDateShown(const wxDateTime& date) const
bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const
{
bool retval = TRUE;
// Check if the given date is in the range specified
retval = ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE )
return ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE )
&& ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) );
return retval;
}
bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
@@ -1371,7 +1369,7 @@ bool wxCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *week) c
}
else
{
day += ( startOnMonday ) ? 0 : 1;
*day += ( startOnMonday ) ? 0 : 1;
}
int targetmonth = date.GetMonth() + (12 * date.GetYear());

View File

@@ -339,7 +339,6 @@ void wxGenericColourDialog::InitializeColours(void)
{
whichKind = 2;
colourSelection = i;
initColourFound = TRUE;
break;
}
}

View File

@@ -725,11 +725,7 @@ void wxPostScriptDC::DoDrawRoundedRectangle (wxCoord x, wxCoord y, wxCoord width
{
// Now, a negative radius is interpreted to mean
// 'the proportion of the smallest X or Y dimension'
double smallest = 0.0;
if (width < height)
smallest = width;
else
smallest = height;
double smallest = width < height ? width : height;
radius = (-radius * smallest);
}
@@ -962,8 +958,6 @@ void wxPostScriptDC::SetFont( const wxFont& font )
case wxSCRIPT:
{
name = "/ZapfChancery-MediumItalic";
Style = wxNORMAL;
Weight = wxNORMAL;
break;
}
case wxSWISS:
@@ -1046,7 +1040,8 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
static const char *wxCoord_dashed = "[4 8] 2";
static const char *dotted_dashed = "[6 6 2 6] 4";
const char *psdash = (char *) NULL;
const char *psdash;
switch (m_pen.GetStyle())
{
case wxDOT: psdash = dotted; break;
@@ -1651,7 +1646,8 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
while ((node = node->GetNext()))
node = node->GetNext();
while (node)
{
q = (wxPoint *)node->GetData();
@@ -1673,6 +1669,8 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
node = node->GetNext();
}
/*
@@ -2194,7 +2192,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
lastStyle = Style;
lastWeight = Weight;
const wxChar *name = NULL;
const wxChar *name;
switch (Family)
{
@@ -2218,8 +2216,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
case wxSCRIPT:
{
name = wxT("Zapf.afm");
Style = wxNORMAL;
Weight = wxNORMAL;
break;
}
case wxSWISS:
default:

View File

@@ -125,7 +125,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
path.Printf(wxT("%c:\\"), driveBuffer[i]);
name.Printf(wxT("%c:"), driveBuffer[i]);
int imageId = wxFileIconsTable::drive;
int imageId;
int driveType = ::GetDriveType(path);
switch (driveType)
{
@@ -1206,8 +1206,7 @@ void wxDirFilterListCtrl::FillFilterList(const wxString& filter, int defaultFilt
if (n > 0 && defaultFilter < (int) n)
{
size_t i = 0;
for (i = 0; i < n; i++)
for (size_t i = 0; i < n; i++)
Append(descriptions[i]);
SetSelection(defaultFilter);
}

View File

@@ -490,7 +490,6 @@ void wxFileCtrl::UpdateFiles()
FreeAllItemsData();
DeleteAllItems();
wxFileData *fd = (wxFileData *) NULL;
wxListItem item;
item.m_itemId = 0;
item.m_col = 0;
@@ -504,7 +503,7 @@ void wxFileCtrl::UpdateFiles()
for (n=0; n<count; n++)
{
fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
wxFileData *fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
Add(fd, item);
item.m_itemId++;
}
@@ -519,7 +518,7 @@ void wxFileCtrl::UpdateFiles()
#ifdef __UNIX__
if (p.IsEmpty()) p = wxT("/");
#endif // __UNIX__
fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
Add(fd, item);
item.m_itemId++;
}
@@ -546,7 +545,7 @@ void wxFileCtrl::UpdateFiles()
cont = dir.GetFirst(&f, wxEmptyString, wxDIR_DIRS | hiddenFlag);
while (cont)
{
fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);
@@ -561,7 +560,7 @@ void wxFileCtrl::UpdateFiles()
wxDIR_FILES | hiddenFlag);
while (cont)
{
fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);

View File

@@ -329,12 +329,9 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
{
if (!m_useEvents) return;
int fontFamily = 0; /* shut up buggy egcs warnings */
fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
int fontWeight = 0;
fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = 0;
fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
int fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue();
@@ -342,8 +339,7 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
m_previewer->SetFont(dialogFont);
if (colourChoice->GetStringSelection() != wxT(""))
{
wxColour *col = (wxColour*) NULL;
col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
wxColour *col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
if (col)
{
m_fontData.m_fontColour = *col;

View File

@@ -1961,10 +1961,9 @@ wxSize wxGridCellBoolRenderer::GetBestSize(wxGrid& grid,
if ( !ms_sizeCheckMark.x )
{
// get checkbox size
wxCoord checkSize = 0;
wxCheckBox *checkbox = new wxCheckBox(&grid, -1, wxEmptyString);
wxSize size = checkbox->GetBestSize();
checkSize = size.y + 2*wxGRID_CHECKMARK_MARGIN;
wxCoord checkSize = size.y + 2*wxGRID_CHECKMARK_MARGIN;
// FIXME wxGTK::wxCheckBox::GetBestSize() gives "wrong" result
#if defined(__WXGTK__) || defined(__WXMOTIF__)
@@ -2584,13 +2583,9 @@ wxGridCellAttr *wxGridCellAttrProvider::GetAttr(int row, int col,
{
//Basicaly implement old version.
//Also check merge cache, so we don't have to re-merge every time..
wxGridCellAttr *attrcell = (wxGridCellAttr *)NULL,
*attrrow = (wxGridCellAttr *)NULL,
*attrcol = (wxGridCellAttr *)NULL;
attrcell = m_data->m_cellAttrs.GetAttr(row, col);
attrcol = m_data->m_colAttrs.GetAttr(col);
attrrow = m_data->m_rowAttrs.GetAttr(row);
wxGridCellAttr *attrcell = m_data->m_cellAttrs.GetAttr(row, col);
wxGridCellAttr *attrrow = m_data->m_rowAttrs.GetAttr(row);
wxGridCellAttr *attrcol = m_data->m_colAttrs.GetAttr(col);
if((attrcell != attrrow) && (attrrow !=attrcol) && (attrcell != attrcol)){
// Two or move are non NULL
@@ -6002,7 +5997,7 @@ int wxGrid::SendEvent( const wxEventType type,
wxMouseEvent& mouseEv )
{
bool claimed;
bool vetoed= FALSE;
bool vetoed;
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
@@ -6069,7 +6064,7 @@ int wxGrid::SendEvent( const wxEventType type,
int row, int col )
{
bool claimed;
bool vetoed= FALSE;
bool vetoed;
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
@@ -9092,9 +9087,7 @@ void wxGrid::SetColFormatFloat(int col, int width, int precision)
void wxGrid::SetColFormatCustom(int col, const wxString& typeName)
{
wxGridCellAttr *attr = (wxGridCellAttr *)NULL;
attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col );
wxGridCellAttr *attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col );
if(!attr)
attr = new wxGridCellAttr;
wxGridCellRenderer *renderer = GetDefaultRendererForType(typeName);

View File

@@ -589,7 +589,6 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
r = m_grid->BlockToDeviceRect( m_cellSelection[n],
m_cellSelection[n] );
m_cellSelection.RemoveAt(n);
n--; count--;
if ( !m_grid->GetBatchCount() )
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r );

View File

@@ -109,17 +109,15 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
wxBitmap* newBitmap = NULL;
if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
#if defined(__VISAGECPP__)
//just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
//so construct it from a bitmap object until I can figure this nonsense out. (DW)
newBitmap = new wxBitmap(bitmap) ;
#else
newBitmap = new wxBitmap( (const wxIcon&) bitmap );
#endif
else
newBitmap = new wxBitmap(bitmap) ;
wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ?
#if defined(__VISAGECPP__)
//just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
//so construct it from a bitmap object until I can figure this nonsense out. (DW)
new wxBitmap(bitmap)
#else
new wxBitmap( (const wxIcon&) bitmap )
#endif
: new wxBitmap(bitmap) ;
if (index == (int) m_images.GetCount() - 1)
{

View File

@@ -2682,7 +2682,6 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
wxPen pen(GetRuleColour(), 1, wxSOLID);
int col = 0;
wxRect firstItemRect;
wxRect lastItemRect;
GetItemRect(visibleFrom, firstItemRect);
@@ -2690,7 +2689,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
int x = firstItemRect.GetX();
dc.SetPen(pen);
dc.SetBrush(* wxTRANSPARENT_BRUSH);
for (col = 0; col < GetColumnCount(); col++)
for (int col = 0; col < GetColumnCount(); col++)
{
int colWidth = GetColumnWidth(col);
x += colWidth;
@@ -3196,15 +3195,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
case WXK_PRIOR:
{
int steps = 0;
if ( HasFlag(wxLC_REPORT) )
{
steps = m_linesPerPage - 1;
}
else
{
steps = m_current % m_linesPerPage;
}
int steps = HasFlag(wxLC_REPORT) ? m_linesPerPage - 1 : m_current % m_linesPerPage;
int index = m_current - steps;
if (index < 0)
@@ -3216,15 +3207,9 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
case WXK_NEXT:
{
int steps = 0;
if ( HasFlag(wxLC_REPORT) )
{
steps = m_linesPerPage - 1;
}
else
{
steps = m_linesPerPage - (m_current % m_linesPerPage) - 1;
}
int steps = HasFlag(wxLC_REPORT)
? m_linesPerPage - 1
: m_linesPerPage - (m_current % m_linesPerPage) - 1;
size_t index = m_current + steps;
size_t count = GetItemCount();
@@ -4023,7 +4008,6 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
clientHeight -= wxSystemSettings::
GetMetric(wxSYS_HSCROLL_Y);
m_linesPerPage = 0;
currentlyVisibleLines = 0;
break;
}
@@ -5325,7 +5309,8 @@ int wxGenericListCtrl::OnGetItemImage(long WXUNUSED(item)) const
return -1;
}
wxListItemAttr *wxGenericListCtrl::OnGetItemAttr(long item) const
wxListItemAttr *
wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
_T("invalid item index in OnGetItemAttr()") );

View File

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

View File

@@ -135,7 +135,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
m_printDialogData.SetMaxPage(9999);
// Create a suitable device context
wxDC *dc = (wxDC *) NULL;
wxDC *dc;
if (prompt)
{
dc = PrintDialog(parent);

View File

@@ -488,11 +488,7 @@ void wxSashWindow::DrawSash(wxSashEdgePosition edge, wxDC& dc)
if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
{
int sashPosition = 0;
if (edge == wxSASH_LEFT)
sashPosition = 0;
else
sashPosition = w - GetEdgeMargin(edge);
int sashPosition = (edge == wxSASH_LEFT) ? 0 : ( w - GetEdgeMargin(edge) );
dc.SetPen(facePen);
dc.SetBrush(faceBrush);
@@ -518,11 +514,7 @@ void wxSashWindow::DrawSash(wxSashEdgePosition edge, wxDC& dc)
}
else // top or bottom
{
int sashPosition = 0;
if (edge == wxSASH_TOP)
sashPosition = 0;
else
sashPosition = h - GetEdgeMargin(edge);
int sashPosition = (edge == wxSASH_TOP) ? 0 : ( h - GetEdgeMargin(edge) );
dc.SetPen(facePen);
dc.SetBrush(faceBrush);

View File

@@ -376,7 +376,7 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event)
parent = parent->GetParent();
}
bool iconized = FALSE;
bool iconized;
wxTopLevelWindow *winTop = wxDynamicCast(parent, wxTopLevelWindow);
if ( winTop )
@@ -720,7 +720,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove)
if ( ! IsSplit() )
return FALSE;
wxWindow *win = NULL;
wxWindow *win;
if ( toRemove == NULL || toRemove == m_windowTwo)
{
win = m_windowTwo ;

View File

@@ -1711,21 +1711,12 @@ bool wxGenericTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxG
void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2)
{
// item2 is not necessary after item1
wxGenericTreeItem *first=NULL, *last=NULL;
m_select_me = NULL;
// item2 is not necessary after item1
// choice first' and 'last' between item1 and item2
if (item1->GetY()<item2->GetY())
{
first=item1;
last=item2;
}
else
{
first=item2;
last=item1;
}
wxGenericTreeItem *first= (item1->GetY()<item2->GetY()) ? item1 : item2;
wxGenericTreeItem *last = (item1->GetY()<item2->GetY()) ? item2 : item1;
bool select = m_current->IsSelected();

View File

@@ -486,7 +486,7 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event)
// flags for DoHandleItemClick()
int flags = ItemClick_Kbd;
int current = 0; // just to silent the stupid compiler warnings
int current;
switch ( event.GetKeyCode() )
{
case WXK_HOME:
@@ -539,6 +539,7 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event)
default:
event.Skip();
current = 0; // just to silent the stupid compiler warnings
return;
}

View File

@@ -92,7 +92,7 @@ wxCoord wxVScrolledWindow::EstimateTotalHeight() const
// use the height of the lines we looked as the average
heightTotal = (wxCoord)
(((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
(((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
}
return heightTotal;

View File

@@ -454,7 +454,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
sizer->Add(m_SearchList, 1, wxALL | wxEXPAND, 2);
m_NavigNotebook->AddPage(dummy, _("Search"));
m_SearchPage = notebook_page++;
m_SearchPage = notebook_page;
}
m_HtmlWin->Show(TRUE);

View File

@@ -752,7 +752,6 @@ void wxHtmlContainerCell::Layout(int w)
ypos + line->GetPosY());
line = line->GetNext();
}
xcnt++;
}
ypos += ysizedown;
@@ -968,11 +967,9 @@ const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) co
{
if (m_Cells)
{
const wxHtmlCell *r = NULL;
for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext())
{
r = cell->Find(condition, param);
const wxHtmlCell *r = cell->Find(condition, param);
if (r) return r;
}
}

View File

@@ -66,7 +66,6 @@ bool wxIsCDATAElement(const wxChar *tag)
wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
{
const wxChar *src = source.c_str();
int tg, stpos;
int lng = source.Length();
wxChar tagBuffer[256];
@@ -81,8 +80,9 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
{
if (m_CacheSize % CACHE_INCREMENT == 0)
m_Cache = (wxHtmlCacheItem*) realloc(m_Cache, (m_CacheSize + CACHE_INCREMENT) * sizeof(wxHtmlCacheItem));
tg = m_CacheSize++;
m_Cache[tg].Key = stpos = pos++;
int tg = m_CacheSize++;
int stpos = pos++;
m_Cache[tg].Key = stpos;
int i;
for ( i = 0;

View File

@@ -381,8 +381,10 @@ void wxHtmlPrintout::RenderPage(wxDC *dc, int page)
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
wxUnusedVar(ppiPrinterX);
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
wxUnusedVar(ppiScreenX);
dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);

View File

@@ -35,8 +35,8 @@ FORCE_LINK_ME(m_pre)
static wxString LINKAGEMODE HtmlizeWhitespaces(const wxString& str)
{
wxString out;
size_t i = 0, j = 0, len = str.Len();
for (i = 0; i < len; i++)
size_t len = str.Len();
for (size_t i = 0; i < len; i++)
{
switch (str[i])
{
@@ -52,7 +52,10 @@ static wxString LINKAGEMODE HtmlizeWhitespaces(const wxString& str)
out << wxT("<br>");
break;
case wxT('\t'):
for (j = 8 - i%8; j > 0; j--) out << wxT("&nbsp;");
{
for (size_t j = 8 - i%8; j > 0; j--)
out << wxT("&nbsp;");
}
break;
default:
out << str[i];

View File

@@ -1762,14 +1762,11 @@ bool wxCreateDIB(long xSize, long ySize, long bitsPerPixel,
HPALETTE hPal, LPBITMAPINFO* lpDIBHeader)
{
unsigned long i, headerSize;
LPBITMAPINFO lpDIBheader = NULL;
LPPALETTEENTRY lpPe = NULL;
// Allocate space for a DIB header
headerSize = (sizeof(BITMAPINFOHEADER) + (256 * sizeof(PALETTEENTRY)));
lpDIBheader = (BITMAPINFO *) malloc(headerSize);
lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER));
LPBITMAPINFO lpDIBheader = (BITMAPINFO *) malloc(headerSize);
LPPALETTEENTRY lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER));
GetPaletteEntries(hPal, 0, 256, lpPe);

View File

@@ -878,11 +878,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h
if (radius < 0.0)
{
double smallest = 0.0;
if (width < height)
smallest = width;
else
smallest = height;
double smallest = (width < height) ? width : height;
radius = (- radius * smallest);
}
@@ -1432,8 +1428,7 @@ void wxDC::SetBrush(const wxBrush& brush)
if ( m_brush.GetResourceHandle() )
{
HBRUSH b = 0;
b = (HBRUSH) ::SelectObject(GetHdc(), (HBRUSH)m_brush.GetResourceHandle());
HBRUSH b = (HBRUSH) ::SelectObject(GetHdc(), (HBRUSH)m_brush.GetResourceHandle());
if (!m_oldBrush)
m_oldBrush = (WXHBRUSH) b;
}
@@ -1869,7 +1864,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
::SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
}
DWORD dwRop = SRCCOPY;
DWORD dwRop;
switch (rop)
{
case wxXOR: dwRop = SRCINVERT; break;

View File

@@ -293,11 +293,10 @@ wxPaintDCInfo *wxPaintDC::FindInCache(size_t *index) const
// find the entry for this DC in the cache (keyed by the window)
WXHDC wxPaintDC::FindDCInCache(wxWindow* win)
{
wxPaintDCInfo *info = NULL;
size_t nCache = ms_cache.GetCount();
for ( size_t n = 0; n < nCache; n++ )
{
info = &ms_cache[n];
wxPaintDCInfo *info = &ms_cache[n];
if ( info->hwnd == win->GetHWND() )
{
return info->hdc;

View File

@@ -345,7 +345,8 @@ bool DrawBitmapUsingStretchDIBits(HDC hdc,
{
#if wxUSE_WXDIB
wxDIB dib(bmp);
if ( !dib.IsOk() )
bool ok = dib.IsOk();
if ( !ok )
return FALSE;
DIBSECTION ds;
@@ -374,7 +375,7 @@ bool DrawBitmapUsingStretchDIBits(HDC hdc,
return FALSE;
}
else
return TRUE;
#else
return FALSE;

View File

@@ -372,7 +372,8 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap,
wxDIB dib(name);
return dib.IsOk() && bitmap->CopyFromDIB(dib);
bool ok = dib.IsOk() && bitmap->CopyFromDIB(dib);
return ok;
#else
WXHBITMAP hBitmap = (WXHBITMAP)wxLoadBMP(name);
if(hBitmap) {

View File

@@ -30,7 +30,6 @@
#include <winsock.h>
#ifndef __GSOCKET_STANDALONE__
# include "wx/defs.h"
# include "wx/setup.h"
#endif

View File

@@ -35,6 +35,7 @@
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/config.h"
#include "wx/file.h"
#include "wx/msw/iniconf.h"

View File

@@ -514,7 +514,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL,
_T("Associate() needs extension") );
bool ok = FALSE ;
bool ok;
int iExtCount = 0 ;
wxString filetype;
wxString extWithDot;
@@ -551,7 +551,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
filetype = filetypeOrig;
}
ok = key.SetValue(wxEmptyString, filetype);
key.SetValue(wxEmptyString, filetype);
}
}
else
@@ -560,11 +560,11 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
if (!filetypeOrig.empty())
{
filetype = filetypeOrig;
ok = key.SetValue(wxEmptyString, filetype);
key.SetValue(wxEmptyString, filetype);
}
else
{
ok = key.QueryValue(wxEmptyString, filetype);
key.QueryValue(wxEmptyString, filetype);
}
}
// now set a mimetypeif we have it, but ignore it if none
@@ -585,7 +585,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
if ( ok )
{
// and provide a back link to the extension
ok = keyMIME.SetValue(_T("Extension"), extWithDot);
keyMIME.SetValue(_T("Extension"), extWithDot);
}
}
}
@@ -601,8 +601,8 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
if ( !key.Exists() ) ok = key.Create();
ok = key.SetValue(wxEmptyString, filetype);
if ( !key.Exists() ) key.Create();
key.SetValue(wxEmptyString, filetype);
// now set any mimetypes we may have, but ignore it if none
const wxString& mimetype = ftInfo.GetMimeType();
@@ -622,7 +622,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
if ( ok )
{
// and provide a back link to the extension
ok = keyMIME.SetValue(_T("Extension"), extWithDot);
keyMIME.SetValue(_T("Extension"), extWithDot);
}
}
}
@@ -633,10 +633,9 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
// create the filetype key itself (it will be empty for now, but
// SetCommand(), SetDefaultIcon() &c will use it later)
wxRegKey keyFT(wxRegKey::HKCR, filetype);
ok = keyFT.Create();
keyFT.Create();
wxFileType *ft = NULL;
ft = CreateFileType(filetype, extWithDot);
wxFileType *ft = CreateFileType(filetype, extWithDot);
if (ft)
{

View File

@@ -142,8 +142,7 @@ bool wxPen::RealizeResource()
return TRUE;
}
COLORREF ms_colour = 0;
ms_colour = M_PENDATA->m_colour.GetPixel();
COLORREF ms_colour = M_PENDATA->m_colour.GetPixel();
// Join style, Cap style, Pen Stippling only on Win32.
// Currently no time to find equivalent on Win3.1, sorry

View File

@@ -184,7 +184,6 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
s_inPopup = true;
bool rval = false;
wxWindow* win;
int x, y;
wxGetMousePosition(&x, &y);
@@ -202,7 +201,7 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
// Work around a WIN32 bug
::SetForegroundWindow ((HWND) win->GetHWND ());
rval = win->PopupMenu(menu, 0, 0);
bool rval = win->PopupMenu(menu, 0, 0);
// Work around a WIN32 bug
::PostMessage ((HWND) win->GetHWND(),WM_NULL,0,0L);

View File

@@ -690,7 +690,7 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs,
// process the Windows messages that result from these functions
// (note that even in console applications we might have to process
// messages if we use wxExecute() or timers or ...)
DWORD result = 0; // suppress warnings from broken compilers
DWORD result wxDUMMY_INITIALIZE(0);
do
{
if ( wxThread::IsMain() )

View File

@@ -445,7 +445,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
long style,
const wxString& name)
{
bool ret = false;
bool ret wxDUMMY_INITIALIZE(false);
// init our fields
Init();

View File

@@ -922,7 +922,7 @@ bool wxShutdown(wxShutdownFlags wFlags)
return FALSE;
}
bOK = ::ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE | EWX_REBOOT, 0) != 0;
bOK = ::ExitWindowsEx(flags, 0) != 0;
}
return bOK;

View File

@@ -473,7 +473,7 @@ static bool wxExecuteDDE(const wxString& ddeServer,
const wxString& ddeTopic,
const wxString& ddeCommand)
{
bool ok = FALSE;
bool ok wxDUMMY_INITIALIZE(false);
wxDDEClient client;
wxConnectionBase *conn = client.MakeConnection(wxEmptyString,

View File

@@ -404,7 +404,7 @@ wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset)
TCHAR* buf = new TCHAR[chars+1];
// Get the list of drives.
chars = GetLogicalDriveStrings(chars, buf);
GetLogicalDriveStrings(chars, buf);
// Parse the list into an array, applying appropriate filters.
TCHAR *pVol;

View File

@@ -4914,7 +4914,7 @@ int wxCharCodeMSWToWX(int keySym)
int wxCharCodeWXToMSW(int id, bool *isVirtual)
{
*isVirtual = TRUE;
int keySym = 0;
int keySym;
switch (id)
{
case WXK_CANCEL: keySym = VK_CANCEL; break;

View File

@@ -2345,7 +2345,7 @@ wxSize wxTextCtrl::DoGetBestClientSize() const
lines = 5;
else if ( lines > 10 )
lines = 10;
h *= 10;
h *= lines;
}
wxRect rectText;

View File

@@ -3598,7 +3598,6 @@ void wxWin32Renderer::DrawFrameTitleBar(wxDC& dc,
DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP,
(specialButton == wxTOPLEVEL_BUTTON_HELP) ?
specialButtonFlags : 0);
x -= FRAME_BUTTON_WIDTH;
}
}
}

View File

@@ -101,7 +101,7 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW |
wxTHICK_FRAME);
style = wxSIMPLE_BORDER;
style |= wxSIMPLE_BORDER;
SetExtraStyle(exstyleOrig &
~(wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP));
}