From cb5c74a45f6154d14e5c0309c41e7a4eb0f947f1 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 18 Jul 2017 10:31:20 +0200 Subject: [PATCH 1/1] use NULL as sentinel instead of 0 - missing sentinel in function call Some functions like g_object_set() expect a variable list of arguments terminated with NULL sentinel, legacy code was using 0 instead. --- radiant/console.cpp | 8 ++++---- radiant/entitylist.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/radiant/console.cpp b/radiant/console.cpp index d4202247..2f156dd2 100644 --- a/radiant/console.cpp +++ b/radiant/console.cpp @@ -143,7 +143,7 @@ public: GtkTextBufferOutputStream( GtkTextBuffer* textBuffer, GtkTextIter* iter, GtkTextTag* tag ) : textBuffer( textBuffer ), iter( iter ), tag( tag ){ } std::size_t write( const char* buffer, std::size_t length ){ - gtk_text_buffer_insert_with_tags( textBuffer, iter, buffer, gint( length ), tag, 0 ); + gtk_text_buffer_insert_with_tags( textBuffer, iter, buffer, gint( length ), tag, NULL ); return length; } }; @@ -174,9 +174,9 @@ std::size_t Sys_Print( int level, const char* buf, std::size_t length ){ const GdkColor yellow = { 0, 0xb0ff, 0xb0ff, 0x0000 }; const GdkColor red = { 0, 0xffff, 0x0000, 0x0000 }; - static GtkTextTag* error_tag = gtk_text_buffer_create_tag( buffer, "red_foreground", "foreground-gdk", &red, 0 ); - static GtkTextTag* warning_tag = gtk_text_buffer_create_tag( buffer, "yellow_foreground", "foreground-gdk", &yellow, 0 ); - static GtkTextTag* standard_tag = gtk_text_buffer_create_tag( buffer, "black_foreground", 0 ); + static GtkTextTag* error_tag = gtk_text_buffer_create_tag( buffer, "red_foreground", "foreground-gdk", &red, NULL ); + static GtkTextTag* warning_tag = gtk_text_buffer_create_tag( buffer, "yellow_foreground", "foreground-gdk", &yellow, NULL ); + static GtkTextTag* standard_tag = gtk_text_buffer_create_tag( buffer, "black_foreground", NULL ); GtkTextTag* tag; switch ( level ) { diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 35cbc847..dad00e4e 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -115,22 +115,22 @@ void entitylist_treeviewcolumn_celldatafunc( GtkTreeViewColumn* column, GtkCellR if ( node != 0 ) { gtk_cell_renderer_set_fixed_size( renderer, -1, -1 ); char* name = const_cast( node_get_name( *node ) ); - g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, 0 ); + g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, NULL ); //globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n"; GtkStyle* style = gtk_widget_get_style( GTK_WIDGET( getEntityList().m_tree_view ) ); if ( instance->childSelected() ) { - g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], 0 ); + g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], NULL ); } else { - g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_NORMAL], 0 ); + g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_NORMAL], NULL ); } } else { gtk_cell_renderer_set_fixed_size( renderer, -1, 0 ); - g_object_set( G_OBJECT( renderer ), "text", "", "visible", FALSE, 0 ); + g_object_set( G_OBJECT( renderer ), "text", "", "visible", FALSE, NULL ); } } -- 2.39.2