Minor code tweeks to stop BCC compiler warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3119,7 +3119,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
: 31;
|
||||
|
||||
// can it be day?
|
||||
if ( (val == 0) || (val > maxDays) )
|
||||
if ( (val == 0) || (val > (unsigned long)maxDays) ) // cast to shut up compiler warning in BCC
|
||||
{
|
||||
isYear = TRUE;
|
||||
}
|
||||
|
@@ -363,7 +363,8 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
|
||||
if (node != NULL)
|
||||
return ((wxLibrary *)node->Data());
|
||||
#else // !OS/2
|
||||
if ( (node = m_loaded.Find(name.GetData())) )
|
||||
node = m_loaded.Find(name.GetData());
|
||||
if ( node )
|
||||
return ((wxLibrary *)node->Data());
|
||||
#endif
|
||||
// If DLL shares data, this is necessary.
|
||||
|
@@ -607,7 +607,8 @@ wxString wxFileName::GetLongPath() const
|
||||
s_triedToLoad = TRUE;
|
||||
|
||||
wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32"));
|
||||
if ( 0 ) // dllKernel )
|
||||
short avoidCompilerWarning = 0;
|
||||
if ( avoidCompilerWarning ) // dllKernel )
|
||||
{
|
||||
// may succeed or fail depending on the Windows version
|
||||
#ifdef _UNICODE
|
||||
|
@@ -1055,7 +1055,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
|
||||
{
|
||||
wxExpr *valueList = (wxExpr *) NULL;
|
||||
|
||||
if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList))
|
||||
valueList = expr->Nth(count);
|
||||
if (valueList && (valueList->Type() == PrologList))
|
||||
{
|
||||
wxStringList stringList;
|
||||
wxExpr *stringExpr = valueList->GetFirst();
|
||||
@@ -1072,7 +1073,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
|
||||
/*
|
||||
controlItem->SetValue1(wxLB_SINGLE);
|
||||
*/
|
||||
if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
|
||||
mult = expr->Nth(count);
|
||||
if (mult && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
|
||||
{
|
||||
/*
|
||||
wxString m(mult->StringValue());
|
||||
@@ -1097,7 +1099,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
|
||||
{
|
||||
wxExpr *valueList = (wxExpr *) NULL;
|
||||
// Check for default value list
|
||||
if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList))
|
||||
valueList = expr->Nth(count);
|
||||
if (valueList && (valueList->Type() == PrologList))
|
||||
{
|
||||
wxStringList stringList;
|
||||
wxExpr *stringExpr = valueList->GetFirst();
|
||||
@@ -1132,7 +1135,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
|
||||
|
||||
wxExpr *valueList = (wxExpr *) NULL;
|
||||
// Check for default value list
|
||||
if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList))
|
||||
valueList = expr->Nth(count);
|
||||
if (valueList && (valueList->Type() == PrologList))
|
||||
{
|
||||
wxStringList stringList;
|
||||
wxExpr *stringExpr = valueList->GetFirst();
|
||||
@@ -1161,7 +1165,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
|
||||
{
|
||||
wxExpr *valueList = (wxExpr *) NULL;
|
||||
// Check for default value list
|
||||
if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList))
|
||||
valueList = expr->Nth(count);
|
||||
if (valueList && (valueList->Type() == PrologList))
|
||||
{
|
||||
wxStringList stringList;
|
||||
wxExpr *stringExpr = valueList->GetFirst();
|
||||
@@ -2646,10 +2651,10 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
wxLogWarning(_("Icon resource specification %s not found."), (const wxChar*) resource);
|
||||
break;
|
||||
#else
|
||||
return wxIcon(name, bitmapType);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
return wxNullIcon;
|
||||
|
@@ -815,11 +815,11 @@ bool wxClipboard::GetData( wxDataObject& data )
|
||||
}
|
||||
#endif // wxUSE_METAFILE
|
||||
}
|
||||
return FALSE;
|
||||
#else // !wxUSE_DATAOBJ
|
||||
wxFAIL_MSG( wxT("no clipboard implementation") );
|
||||
#endif // wxUSE_OLE_CLIPBOARD/wxUSE_DATAOBJ
|
||||
|
||||
return FALSE;
|
||||
#endif // wxUSE_OLE_CLIPBOARD/wxUSE_DATAOBJ
|
||||
}
|
||||
|
||||
#else
|
||||
|
@@ -111,7 +111,7 @@ HANDLE ReadIcon( wxChar *szFileName, int *W, int *H)
|
||||
return (HANDLE) NULL;
|
||||
|
||||
// inserted by P.S.
|
||||
while( ((unsigned)nDirEntries < iconFileHead.wResourceCount) &&
|
||||
while( (nDirEntries < iconFileHead.wResourceCount) &&
|
||||
((iconFileRes.bWidth != nWidth) || (iconFileRes.bHeight != nHeight)))
|
||||
{
|
||||
cbRes = _lread( hFile, (LPSTR )&iconFileRes, sizeof( ICONFILERES));
|
||||
@@ -359,7 +359,7 @@ HANDLE ReadCur( wxChar *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
|
||||
return (HANDLE) NULL;
|
||||
|
||||
// following added by P.S.
|
||||
while( ((unsigned)nDirEntries < curFileHead.wResourceCount) &&
|
||||
while( (nDirEntries < curFileHead.wResourceCount) &&
|
||||
((curFileRes.bWidth != nWidth) || (curFileRes.bHeight != nHeight)))
|
||||
{
|
||||
cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES));
|
||||
|
@@ -364,7 +364,7 @@ static DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
|
||||
ul -= MAXREAD;
|
||||
hp += MAXREAD;
|
||||
}
|
||||
if (_lread(fh, (LPSTR) hp, (WORD) ul) != (WORD) ul)
|
||||
if (_lread(fh, (LPSTR) hp, (WXUINT) ul) != (WXUINT) ul)
|
||||
return 0;
|
||||
return ulT;
|
||||
}
|
||||
@@ -394,7 +394,7 @@ static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul)
|
||||
ul -= MAXREAD;
|
||||
hp += MAXREAD;
|
||||
}
|
||||
if (_lwrite(fh, (LPSTR) hp, (WORD) ul) != (WORD) ul)
|
||||
if (_lwrite(fh, (LPSTR) hp, (WXUINT) ul) != (WXUINT) ul)
|
||||
return 0;
|
||||
return ulT;
|
||||
}
|
||||
@@ -668,7 +668,7 @@ HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
|
||||
lpRGB = (RGBQUAD FAR *)((LPSTR)lpInfo + lpInfo->biSize);
|
||||
|
||||
/* copy colors from the color table to the LogPalette structure */
|
||||
for (i = 0; i < lpInfo->biClrUsed; i++, lpRGB++)
|
||||
for (i = 0; (DWORD)i < lpInfo->biClrUsed; i++, lpRGB++)
|
||||
{
|
||||
npPal->palPalEntry[i].peRed = lpRGB->rgbRed;
|
||||
npPal->palPalEntry[i].peGreen = lpRGB->rgbGreen;
|
||||
|
@@ -1667,7 +1667,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// break; // can never be reached
|
||||
#endif // _WIN32_IE >= 0x300
|
||||
|
||||
default:
|
||||
|
@@ -45,13 +45,11 @@ wxColour wxSystemSettings::GetSystemColour(int index)
|
||||
{
|
||||
case wxSYS_COLOUR_LISTBOX:
|
||||
return *wxWHITE;
|
||||
break;
|
||||
|
||||
default:
|
||||
COLORREF ref = ::GetSysColor(index);
|
||||
wxColour col(GetRValue(ref), GetGValue(ref), GetBValue(ref));
|
||||
return col;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2224,7 +2224,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// break; // can never be reached
|
||||
#endif // _WIN32_IE >= 0x300
|
||||
|
||||
case NM_DBLCLK:
|
||||
|
@@ -437,7 +437,7 @@ bool wxDirExists(const wxString& dir)
|
||||
{
|
||||
#if defined(__WIN32__)
|
||||
DWORD attribs = GetFileAttributes(dir);
|
||||
return ((attribs != -1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
|
||||
return ((attribs != (DWORD)-1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
|
||||
#else // Win16
|
||||
#ifdef __BORLANDC__
|
||||
struct ffblk fileInfo;
|
||||
|
Reference in New Issue
Block a user