From 1ce2d1a4685918788e3f22c8f26f652e474da6c0 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 29 Jul 2017 22:13:23 +1000 Subject: [PATCH] s/nullptr/ui::null/ where appropriate --- contrib/gtkgensurf/view.cpp | 2 +- libs/gtkutil/dialog.cpp | 2 +- libs/gtkutil/widget.cpp | 2 +- libs/gtkutil/xorrectangle.cpp | 2 +- radiant/build.cpp | 4 ++-- radiant/entityinspector.cpp | 20 ++++++++++---------- radiant/feedback.h | 2 +- radiant/findtexturedialog.cpp | 2 +- radiant/mainframe.cpp | 2 +- radiant/map.cpp | 2 +- radiant/patchdialog.cpp | 6 +++--- radiant/pluginmenu.cpp | 2 +- radiant/plugintoolbar.cpp | 2 +- radiant/surfacedialog.cpp | 4 ++-- radiant/texwindow.cpp | 6 +++--- radiant/xywindow.cpp | 8 ++++---- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index 65ffc964..307ccdc4 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -413,7 +413,7 @@ void CreateViewWindow(){ spin.connect( "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &azimuth ); #endif - auto frame = ui::Frame( nullptr ); + auto frame = ui::Frame(ui::null); frame.show(); gtk_frame_set_shadow_type( GTK_FRAME( frame ), GTK_SHADOW_IN ); gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 ); diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index f87bbeeb..9e272a15 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -180,7 +180,7 @@ RadioHBox RadioHBox_new( StringArrayRange names ){ gtk_widget_show( GTK_WIDGET( hbox ) ); GSList* group = 0; - auto radio = ui::RadioButton{nullptr}; + auto radio = ui::RadioButton(ui::null); for ( StringArrayRange::Iterator i = names.first; i != names.last; ++i ) { radio = ui::RadioButton(GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( group, *i ) )); diff --git a/libs/gtkutil/widget.cpp b/libs/gtkutil/widget.cpp index be5f63d4..579ade80 100644 --- a/libs/gtkutil/widget.cpp +++ b/libs/gtkutil/widget.cpp @@ -35,7 +35,7 @@ gboolean ToggleShown::notify_visible(ui::Widget widget, gpointer dummy, ToggleSh gboolean ToggleShown::destroy(ui::Widget widget, ToggleShown *self) { self->m_shownDeferred = gtk_widget_get_visible(self->m_widget) != FALSE; - self->m_widget = ui::Widget(nullptr); + self->m_widget = ui::Widget(ui::null); return FALSE; } diff --git a/libs/gtkutil/xorrectangle.cpp b/libs/gtkutil/xorrectangle.cpp index d9108b66..c638e0e2 100644 --- a/libs/gtkutil/xorrectangle.cpp +++ b/libs/gtkutil/xorrectangle.cpp @@ -4,7 +4,7 @@ bool XORRectangle::initialised() const { - return cr != nullptr; + return !!cr; } void XORRectangle::lazy_init() diff --git a/radiant/build.cpp b/radiant/build.cpp index 1a2efe25..05ca5645 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -663,7 +663,7 @@ class ProjectList { public: Project& m_project; -ui::ListStore m_store{nullptr}; +ui::ListStore m_store{ui::null}; bool m_changed; ProjectList( Project& project ) : m_project( project ), m_changed( false ){ } @@ -993,7 +993,7 @@ typedef std::list BuildMenuItems; BuildMenuItems g_BuildMenuItems; -ui::Menu g_bsp_menu{nullptr}; +ui::Menu g_bsp_menu{ui::null}; void Build_constructMenu( ui::Menu menu ){ for ( Project::iterator i = g_build_project.begin(); i != g_build_project.end(); ++i ) diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 701a77ba..82c0bb5f 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -165,7 +165,7 @@ NonModalEntry m_nonModal; public: StringAttribute( const char* key ) : m_key( key ), - m_entry( nullptr ), + m_entry( ui::null ), m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ){ auto entry = ui::Entry(); entry.show(); @@ -324,7 +324,7 @@ NonModalEntry m_nonModal; public: AngleAttribute( const char* key ) : m_key( key ), - m_entry( nullptr ), + m_entry( ui::null ), m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ){ auto entry = numeric_entry_new(); m_entry = entry; @@ -371,11 +371,11 @@ ui::Entry m_entry; NonModalEntry m_nonModal; RadioHBox m_radio; NonModalRadio m_nonModalRadio; -ui::HBox m_hbox{nullptr}; +ui::HBox m_hbox{ui::null}; public: DirectionAttribute( const char* key ) : m_key( key ), - m_entry( nullptr ), + m_entry( ui::null ), m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ), m_radio( RadioHBox_new( STRING_ARRAY_RANGE( buttons ) ) ), m_nonModalRadio( ApplyRadioCaller( *this ) ){ @@ -456,7 +456,7 @@ public: ui::Entry m_roll; ui::Entry m_pitch; ui::Entry m_yaw; -AnglesEntry() : m_roll( nullptr ), m_pitch( nullptr ), m_yaw( nullptr ){ +AnglesEntry() : m_roll( ui::null ), m_pitch( ui::null ), m_yaw( ui::null ){ } }; @@ -546,7 +546,7 @@ public: ui::Entry m_x; ui::Entry m_y; ui::Entry m_z; -Vector3Entry() : m_x( nullptr ), m_y( nullptr ), m_z( nullptr ){ +Vector3Entry() : m_x( ui::null ), m_y( ui::null ), m_z( ui::null ){ } }; @@ -555,7 +555,7 @@ class Vector3Attribute : public EntityAttribute CopiedString m_key; Vector3Entry m_vector3; NonModalEntry m_nonModal; -ui::Box m_hbox{nullptr}; +ui::Box m_hbox{ui::null}; public: Vector3Attribute( const char* key ) : m_key( key ), @@ -717,8 +717,8 @@ GtkCheckButton* g_entitySpawnflagsCheck[MAX_FLAGS]; GtkEntry* g_entityKeyEntry; GtkEntry* g_entityValueEntry; -ui::ListStore g_entlist_store{nullptr}; -ui::ListStore g_entprops_store{nullptr}; +ui::ListStore g_entlist_store{ui::null}; +ui::ListStore g_entprops_store{ui::null}; const EntityClass* g_current_flags = 0; const EntityClass* g_current_comment = 0; const EntityClass* g_current_attributes = 0; @@ -731,7 +731,7 @@ int spawn_table[MAX_FLAGS]; // the table is a 4x4 in which we need to put the comment box g_entityClassComment and the spawn flags.. GtkTable* g_spawnflagsTable; -ui::VBox g_attributeBox{nullptr}; +ui::VBox g_attributeBox{ui::null}; typedef std::vector EntityAttributes; EntityAttributes g_entityAttributes; } diff --git a/radiant/feedback.h b/radiant/feedback.h index 42fdbbb3..db7f0da4 100644 --- a/radiant/feedback.h +++ b/radiant/feedback.h @@ -148,7 +148,7 @@ class CDbgDlg : public Dialog { GPtrArray *m_pFeedbackElements; // the list widget we use in the dialog -ui::ListStore m_clist{nullptr}; +ui::ListStore m_clist{ui::null}; ISAXHandler *m_pHighlight; IGL2DWindow* m_pDraw2D; public: diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index e1879ea3..9766843a 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -130,7 +130,7 @@ FindTextureDialog::~FindTextureDialog(){ ui::Window FindTextureDialog::BuildDialog(){ ui::Widget vbox, hbox, table, label; ui::Widget button; - ui::Entry entry{nullptr}; + ui::Entry entry{ui::null}; auto dlg = ui::Window(create_floating_window( "Find / Replace Texture(s)", m_parent )); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index d38525a9..8d652ef2 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1610,7 +1610,7 @@ class WaitDialog { public: ui::Window m_window{ui::null}; -ui::Label m_label{(GtkLabel *) nullptr}; +ui::Label m_label{ui::null}; }; WaitDialog create_wait_dialog( const char* title, const char* text ){ diff --git a/radiant/map.cpp b/radiant/map.cpp index c767cc2e..056f3ecf 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -765,7 +765,7 @@ void DoMapInfo(){ ModalDialog dialog; GtkEntry* brushes_entry; GtkEntry* entities_entry; - ui::ListStore EntityBreakdownWalker{nullptr}; + ui::ListStore EntityBreakdownWalker{ui::null}; ui::Window window = MainFrame_getWindow().create_dialog_window("Map Info", G_CALLBACK(dialog_delete_callback ), &dialog ); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 70cf3f8c..96e60eac 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -160,7 +160,7 @@ public: ui::CheckButton m_enabled; ui::Entry m_horizontal; ui::Entry m_vertical; -Subdivisions() : m_enabled( (GtkCheckButton *) 0 ), m_horizontal( nullptr ), m_vertical( nullptr ){ +Subdivisions() : m_enabled( (GtkCheckButton *) 0 ), m_horizontal( ui::null ), m_vertical( ui::null ){ } void update(){ PatchFixedSubdivisions subdivisions; @@ -226,8 +226,8 @@ float m_fZ; float m_fVShift; */ int m_nCol; int m_nRow; -ui::ComboBoxText m_pRowCombo{nullptr}; -ui::ComboBoxText m_pColCombo{nullptr}; +ui::ComboBoxText m_pRowCombo{ui::null}; +ui::ComboBoxText m_pColCombo{ui::null}; std::size_t m_countRows; std::size_t m_countCols; diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp index d463aea7..e2af3b97 100644 --- a/radiant/pluginmenu.cpp +++ b/radiant/pluginmenu.cpp @@ -44,7 +44,7 @@ void plugin_activated( ui::Widget widget, gpointer data ){ void PlugInMenu_Add( ui::Menu plugin_menu, IPlugIn* pPlugIn ){ ui::Widget item, parent; - ui::Menu menu{nullptr}, subMenu{nullptr}; + ui::Menu menu{ui::null}, subMenu{ui::null}; const char *menuText, *menuCommand; std::stack menuStack; diff --git a/radiant/plugintoolbar.cpp b/radiant/plugintoolbar.cpp index 66deb284..32b31c5a 100644 --- a/radiant/plugintoolbar.cpp +++ b/radiant/plugintoolbar.cpp @@ -91,7 +91,7 @@ void PlugInToolbar_AddButton( ui::Toolbar toolbar, const IToolbarButton* button toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), G_CALLBACK( ActivateToolbarButton ), reinterpret_cast( const_cast( button ) ) ); } -ui::Toolbar g_plugin_toolbar{nullptr}; +ui::Toolbar g_plugin_toolbar{ui::null}; void PluginToolbar_populate(){ class AddToolbarItemVisitor : public ToolbarModules::Visitor diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 64ab34aa..f9774559 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -122,7 +122,7 @@ float& m_f; public: GtkSpinButton* m_spin; ui::Entry m_entry; -Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( nullptr ){ +Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( ui::null ){ } void cancel(){ entry_set_float( m_entry, m_f ); @@ -159,7 +159,7 @@ GtkCheckButton* m_surfaceFlags[32]; GtkCheckButton* m_contentFlags[32]; NonModalEntry m_valueEntry; -ui::Entry m_valueEntryWidget{nullptr}; +ui::Entry m_valueEntryWidget{ui::null}; public: WindowPositionTracker m_positionTracker; WindowPositionTrackerImportStringCaller m_importPosition; diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 1a927a51..7d1782ec 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -262,8 +262,8 @@ ui::Widget m_texture_scroll; ui::Widget m_treeViewTree; ui::Widget m_treeViewTags; ui::Frame m_tag_frame{ui::null}; -ui::ListStore m_assigned_store{nullptr}; -ui::ListStore m_available_store{nullptr}; +ui::ListStore m_assigned_store{ui::null}; +ui::ListStore m_available_store{ui::null}; ui::Widget m_assigned_tree; ui::Widget m_available_tree; ui::Widget m_scr_win_tree; @@ -273,7 +273,7 @@ ui::Button m_search_button{ui::null}; ui::Widget m_shader_info_item; std::set m_all_tags; -ui::ListStore m_all_tags_list{nullptr}; +ui::ListStore m_all_tags_list{ui::null}; std::vector m_copied_tags; std::set m_found_shaders; diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 5db4bf1d..eb275baf 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -538,7 +538,7 @@ VIEWTYPE GlobalXYWnd_getCurrentViewType(){ bool g_bCrossHairs = false; -ui::Menu XYWnd::m_mnuDrop{nullptr}; +ui::Menu XYWnd::m_mnuDrop(ui::null); // this is disabled, and broken // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 @@ -820,7 +820,7 @@ XYWnd::XYWnd() : m_entityCreate = false; - m_mnuDrop = ui::Menu{nullptr}; + m_mnuDrop = ui::Menu(ui::null); GlobalWindowObservers_add( m_window_observer ); GlobalWindowObservers_connectWidget( m_gl_widget ); @@ -861,7 +861,7 @@ XYWnd::~XYWnd(){ if ( m_mnuDrop ) { gtk_widget_destroy( GTK_WIDGET( m_mnuDrop ) ); - m_mnuDrop = ui::Menu{nullptr}; + m_mnuDrop = ui::Menu(ui::null); } g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_sizeHandler ); @@ -2570,7 +2570,7 @@ void unrealise(){ if ( ++m_unrealised == 1 ) { if ( XYWnd::m_mnuDrop ) { gtk_widget_destroy( GTK_WIDGET( XYWnd::m_mnuDrop ) ); - XYWnd::m_mnuDrop = ui::Menu(nullptr); + XYWnd::m_mnuDrop = ui::Menu(ui::null); } } } -- 2.39.2