gtktextchild.c, another one



Hi,

  g_return_if_fail (widget_segment->type = &gtk_text_child_type);

Maybe I'm missing something, but the assignment isn't there by
intention, is it?  This occurs several times in the file.

Since there's no way that the check ever fails, I guess it's just a
typo.  If so, I'd be happy to commit the attached patch.

--Daniel

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.2979
diff -u -3 -r1.2979 ChangeLog
--- ChangeLog	2002/02/09 19:14:53	1.2979
+++ ChangeLog	2002/02/09 19:43:26
@@ -1,5 +1,10 @@
 2002-02-09  Daniel Elstner  <daniel elstner gmx net>
 
+	* gtk/gtktextchild.c: Use == rather than = in sanity
+	checks.  Ouch!
+
+2002-02-09  Daniel Elstner  <daniel elstner gmx net>
+
 	* gtk/gtktextchild.c (CHECK_IN_BUFFER_RETURN): Add missing
 	curled braces so that it doesn't always return.  Also indent
 	both CHECK_IN_BUFFER* macros properly, and make use of
Index: gtk/gtktextchild.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextchild.c,v
retrieving revision 1.19
diff -u -3 -r1.19 gtktextchild.c
--- gtk/gtktextchild.c	2002/02/09 19:14:54	1.19
+++ gtk/gtktextchild.c	2002/02/09 19:43:27
@@ -247,7 +247,7 @@
 _gtk_widget_segment_add    (GtkTextLineSegment *widget_segment,
                             GtkWidget          *child)
 {
-  g_return_if_fail (widget_segment->type = &gtk_text_child_type);
+  g_return_if_fail (widget_segment->type == &gtk_text_child_type);
   g_return_if_fail (widget_segment->body.child.tree != NULL);
 
   g_object_ref (G_OBJECT (child));
@@ -261,7 +261,7 @@
 _gtk_widget_segment_remove (GtkTextLineSegment *widget_segment,
                             GtkWidget          *child)
 {
-  g_return_if_fail (widget_segment->type = &gtk_text_child_type);
+  g_return_if_fail (widget_segment->type == &gtk_text_child_type);
   
   widget_segment->body.child.widgets =
     g_slist_remove (widget_segment->body.child.widgets,
@@ -273,7 +273,7 @@
 void
 _gtk_widget_segment_ref (GtkTextLineSegment *widget_segment)
 {
-  g_assert (widget_segment->type = &gtk_text_child_type);
+  g_assert (widget_segment->type == &gtk_text_child_type);
 
   g_object_ref (G_OBJECT (widget_segment->body.child.obj));
 }
@@ -281,7 +281,7 @@
 void
 _gtk_widget_segment_unref (GtkTextLineSegment *widget_segment)
 {
-  g_assert (widget_segment->type = &gtk_text_child_type);
+  g_assert (widget_segment->type == &gtk_text_child_type);
 
   g_object_unref (G_OBJECT (widget_segment->body.child.obj));
 }
@@ -421,7 +421,7 @@
 
   CHECK_IN_BUFFER_RETURN (anchor, NULL);
   
-  g_return_val_if_fail (seg->type = &gtk_text_child_type, NULL);
+  g_return_val_if_fail (seg->type == &gtk_text_child_type, NULL);
 
   iter = seg->body.child.widgets;
   while (iter != NULL)
@@ -457,7 +457,7 @@
 
   CHECK_IN_BUFFER_RETURN (anchor, TRUE);
   
-  g_return_val_if_fail (seg->type = &gtk_text_child_type, TRUE);
+  g_return_val_if_fail (seg->type == &gtk_text_child_type, TRUE);
 
   return seg->body.child.tree == NULL;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]