don't use annoying and unneeded in C++ casts of NULL to "T *" in all other files neither

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-19 13:55:27 +00:00
parent c23b255ab4
commit d3b9f782ef
297 changed files with 1003 additions and 1003 deletions

View File

@@ -40,19 +40,19 @@ public:
wxAcceleratorRefData::wxAcceleratorRefData()
{
m_count = 0;
m_entries = (wxAcceleratorEntry*) NULL;
m_entries = NULL;
}
wxAcceleratorRefData::~wxAcceleratorRefData()
{
delete[] m_entries;
m_entries = (wxAcceleratorEntry*) NULL;
m_entries = NULL;
m_count = 0;
}
wxAcceleratorTable::wxAcceleratorTable()
{
m_refData = (wxAcceleratorRefData*) NULL;
m_refData = NULL;
}
wxAcceleratorTable::~wxAcceleratorTable()
@@ -82,7 +82,7 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]
bool wxAcceleratorTable::IsOk() const
{
return (m_refData != (wxAcceleratorRefData*) NULL);
return (m_refData != NULL);
}
int wxAcceleratorTable::GetCount() const

View File

@@ -74,7 +74,7 @@ void wxBitmapCache::SetBitmap( const wxBitmap& bitmap )
{
XmUninstallImage( (XImage*)m_image );
XtFree( (char*)(XImage*)m_image );
m_image = (WXImage*)NULL;
m_image = NULL;
}
}
}
@@ -263,7 +263,7 @@ XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
stipple = XCreateBitmapFromData( display, pixmap, stipple_data, 16, 16 );
if ( 0 != stipple )
{
gc = XCreateGC( display, pixmap, (XtGCMask)0, (XGCValues*)NULL );
gc = XCreateGC( display, pixmap, (XtGCMask)0, NULL );
if ( NULL != gc )
{
/* Create an identical copy of the argument pixmap.

View File

@@ -144,7 +144,7 @@ void wxCheckBox::ChangeBackgroundColour()
return;
wxComputeColours (XtDisplay((Widget) m_mainWidget), & m_backgroundColour,
(wxColour*) NULL);
NULL);
XtVaSetValues ((Widget) m_mainWidget,
XmNbackground, g_itemColors[wxBACK_INDEX].pixel,

View File

@@ -141,11 +141,11 @@ void wxWindowDCImpl::Init()
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
m_currentPenDash = (wxX11Dash*) NULL;
m_currentPenDash = NULL;
m_currentStyle = -1;
m_currentFill = -1;
m_colour = wxColourDisplay();
m_display = (WXDisplay*) NULL;
m_display = NULL;
m_pixmap = (WXPixmap) 0;
m_autoSetting = 0;
m_ok = false;
@@ -161,7 +161,7 @@ wxWindowDCImpl::wxWindowDCImpl(wxDC *owner)
wxWindowDCImpl::wxWindowDCImpl(wxDC *owner, wxWindow *window)
: wxMotifDCImpl(owner)
{
wxASSERT_MSG( (window != (wxWindow*) NULL), "You must pass a valid wxWindow to wxWindowDCImpl/wxClientDCImpl/wxPaintDCImpl constructor." );
wxASSERT_MSG( (window != NULL), "You must pass a valid wxWindow to wxWindowDCImpl/wxClientDCImpl/wxPaintDCImpl constructor." );
Init();
@@ -836,7 +836,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
// Do bitmap scaling if necessary
wxBitmap *scaledBitmap = (wxBitmap*) NULL;
wxBitmap *scaledBitmap = NULL;
Pixmap sourcePixmap = (Pixmap) NULL;
double scaleX, scaleY;
GetUserScale(& scaleX, & scaleY);
@@ -1584,7 +1584,7 @@ void wxWindowDCImpl::SetPen( const wxPen &pen )
case wxTRANSPARENT:
default:
style = LineSolid;
req_dash = (wxX11Dash*)NULL;
req_dash = NULL;
req_nb_dash = 0;
}

View File

@@ -129,7 +129,7 @@ wxDropSource::wxDropSource( wxWindow *win )
{
#if 0
m_window = win;
m_data = (wxDataObject *) NULL;
m_data = NULL;
m_retValue = wxDragCancel;
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );

View File

@@ -168,7 +168,7 @@ int wxFileDialog::ShowModal()
if (m_backgroundColour.Ok())
{
wxComputeColours (dpy, & m_backgroundColour, (wxColour*) NULL);
wxComputeColours (dpy, & m_backgroundColour, NULL);
XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;

View File

@@ -492,7 +492,7 @@ wxFontEncoding wxFont::GetEncoding() const
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( Ok(), (wxNativeFontInfo *)NULL, wxT("invalid font") );
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty())
GetInternalFont();
@@ -510,7 +510,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
{
if ( !Ok() )
return (wxXFont *)NULL;
return NULL;
long intScale = long(scale * 100.0 + 0.5); // key for wxXFont
int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
@@ -541,7 +541,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
{
wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") );
return (wxXFont*) NULL;
return NULL;
}
wxXFont* f = new wxXFont;

View File

@@ -508,7 +508,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar)
}
// Currently can't set it twice
// wxASSERT_MSG( (m_frameMenuBar == (wxMenuBar*) NULL), "Cannot set the menubar more than once");
// wxASSERT_MSG( (m_frameMenuBar == NULL), "Cannot set the menubar more than once");
if (m_frameMenuBar)
{

View File

@@ -72,7 +72,7 @@ void wxMenu::Init()
m_popupShell = (WXWidget) NULL;
m_buttonWidget = (WXWidget) NULL;
m_menuId = 0;
m_topLevelMenu = (wxMenu*) NULL;
m_topLevelMenu = NULL;
m_ownedByMenuBar = false;
if ( !m_title.empty() )
@@ -383,7 +383,7 @@ bool wxMenuBar::DestroyMenuBar()
{
if (!m_mainWidget)
{
SetMenuBarFrame((wxFrame*) NULL);
SetMenuBarFrame(NULL);
return false;
}
@@ -400,7 +400,7 @@ bool wxMenuBar::DestroyMenuBar()
XtDestroyWidget((Widget) m_mainWidget);
m_mainWidget = (WXWidget) 0;
SetMenuBarFrame((wxFrame*) NULL);
SetMenuBarFrame(NULL);
return true;
}
@@ -529,7 +529,7 @@ void wxMenu::DestroyMenu (bool full)
node = node->GetNext() )
{
wxMenuItem *item = node->GetData();
item->SetMenuBar((wxMenuBar*) NULL);
item->SetMenuBar(NULL);
item->DestroyItem(full);
}
@@ -555,7 +555,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
if (id == m_menuId)
{
if (it)
*it = (wxMenuItem*) NULL;
*it = NULL;
return m_buttonWidget;
}
@@ -582,7 +582,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
}
if (it)
*it = (wxMenuItem*) NULL;
*it = NULL;
return (WXWidget) NULL;
}

View File

@@ -156,7 +156,7 @@ int wxMessageDialog::ShowModal()
if (m_backgroundColour.Ok())
{
wxComputeColours (dpy, & m_backgroundColour, (wxColour*) NULL);
wxComputeColours (dpy, & m_backgroundColour, NULL);
XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;

View File

@@ -91,7 +91,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
else
{
/* search backward for last group start */
wxRadioButton *chief = (wxRadioButton*) NULL;
wxRadioButton *chief = NULL;
wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
while (node)
{

View File

@@ -90,7 +90,7 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallba
// Text item
wxTextCtrl::wxTextCtrl()
{
m_tempCallbackStruct = (void*) NULL;
m_tempCallbackStruct = NULL;
m_modified = false;
m_processedDefault = false;
}
@@ -108,7 +108,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
return false;
PreCreation();
m_tempCallbackStruct = (void*) NULL;
m_tempCallbackStruct = NULL;
m_modified = false;
m_processedDefault = false;

View File

@@ -127,7 +127,7 @@ protected:
// globals
// ----------------------------------------------------------------------------
static wxToolBarTimer* wxTheToolBarTimer = (wxToolBarTimer*) NULL;
static wxToolBarTimer* wxTheToolBarTimer = NULL;
Widget wxToolBarTimer::help_popup = (Widget) 0;
Widget wxToolBarTimer::buttonWidget = (Widget) 0;
@@ -480,7 +480,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
{
wxFAIL_MSG( _T("TODO") );
return (wxToolBarToolBase *)NULL;
return NULL;
}
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
@@ -652,7 +652,7 @@ wxToolBarToolBase *wxToolBar::FindToolByWidget(WXWidget w) const
node = node->GetNext();
}
return (wxToolBarToolBase *)NULL;
return NULL;
}
static void wxToolButtonCallback(Widget w,

View File

@@ -542,7 +542,7 @@ void wxDoChangeBackgroundColour(WXWidget widget, const wxColour& backgroundColou
return;
wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
(wxColour*) NULL);
NULL);
XtVaSetValues ((Widget) widget,
XmNbackground, g_itemColors[wxBACK_INDEX].pixel,

View File

@@ -557,7 +557,7 @@ wxWindow *wxWindowBase::DoFindFocus()
// currently active.
// (2) The widget with the focus may not be in the widget table
// depending on which widgets I put in the table
wxWindow *winFocus = (wxWindow *)NULL;
wxWindow *winFocus = NULL;
for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
node;
node = node->GetNext() )
@@ -1864,7 +1864,7 @@ WXDisplay *wxWindow::GetXDisplay() const
if ( wMain )
return (WXDisplay*) XtDisplay(wMain);
else
return (WXDisplay*) NULL;
return NULL;
}
WXWidget wxWindow::GetMainWidget() const