]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
use NULL as sentinel instead of 0
authorThomas Debesse <dev@illwieckz.net>
Tue, 18 Jul 2017 08:31:20 +0000 (10:31 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 1 Aug 2017 14:29:48 +0000 (16:29 +0200)
- 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
radiant/entitylist.cpp

index d42022472082ac9f42fa6cd36d6d7ec0cc17594a..2f156dd27de9630087eff3b000f4f2c905eede99 100644 (file)
@@ -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 )
                        {
index 35cbc847789c3d0f70e725680bf5bbb39a00478f..dad00e4e0c8780950e526fd498e9ad0c37341af0 100644 (file)
@@ -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<char*>( 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 );
        }
 }