some minor issues ...



Hi Guys,

	I just had a browse through atk+ / gtk+ looking for const
issues, and firstly I need to say that overall atk+ looks nice, and
gail too in pretty good shape - which is hard to do given the speed
you guys have been developing it.

	Also, the (top) marker in the ChangeLog in gail looks like a
really good idea - if it is what I think it is.

	So; now for the bad news :-)

	I saw some things like:

static 
void gail_focus_tracker_init ()
...

	mostly it is best to have method impls. at the beggining of
the line. so eg. grep '^gail' *.c gives you all the impls in your
source.

	I stumbled upon:

    /* We cannot be sure that the classes exist so we make
     * sure that they do. */
    volatile gpointer dummy1 = gtk_type_class (GTK_TYPE_WIDGET);
    volatile gpointer dummy2 = gtk_type_class (GTK_TYPE_ITEM);

	Why 'volatile gpointer foo' ?, none of this is neccessary, the
volatile keyword especialy should have little or no use in non OS /
obscure threaded code surely.

	In several of the cases where the compiler (gcc) with flags
-Wall gave me a warning of the form:

baa.c:198: warning: `foo' might be used uninitialized in this function

	there was a crasher bug lurking - some fixed;

	In (gail_tree_view_ref_child) I am not sure about my 'fix',
the code looks complicated. It seems the 'child' pointer is used to
refer to two things (or the tail of a list - which would be strange),
perhaps some of it could be split out to make it flow more ?

	And some style related griping. Things of the form:

{
	gchar* a, b;

	Cause confusion amongst new C programmers and for good reason,
the whitespace around the '*' leads on to suspect there is a type
entity 'gchar*' - but this is not the meaning. Consequently I always
do:

	gchar *a, b;

	Since this is quite clear - and clearly different from:

	gchar* a,* b;   - (?!)

	or

	gchar* a, *b;   - is *b a gchar ** ?

	I see this all over the headers etc. minor point but worth
making I think.

	Similarly I see:

static G_CONST_RETURN gchar *
gail_util_get_toolkit_version (void)
{
 /*
  * Version is passed in as a -D flag when this file is
  * compiled.
  */
  return ("VERSION");
}

	mostly it's best to treat return as a keyword, not a method
IMHO. The '-D' directive has no impact on string literals - only black
magic does that; it simply does the equivalent of a #define, thus I
fixed it to return VERSION; ( personaly I dislike the comment :-) but
clearly there is room for confusion here ) - and added the -D flag to
the compile includes - which was missing in fact.

	In gail_scrolled_window_scrollbar_visibility_changed, it is
again somewhat unclear to me as to how 'child' should be initialized
if it is not a scroll bar ? NULL ? no emission a g_assert_not_reached?
why is child only setup if the scrollbar is visible ? surely that
should always be setup regardless of 'child_added = TRUE' ?

	The const change in gail_util_add_global_event_listener, with
the g_strdup / g_free will stop an evil possible segv from at-spi, and
is better string lifecycle management IMHO.

	Anyway, I attach the patches, and look forward to some lively
debate :-) and preferably permission to commit.y

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot
? billh
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/atk/ChangeLog,v
retrieving revision 1.126
diff -u -p -u -r1.126 ChangeLog
--- ChangeLog	2001/11/20 11:38:37	1.126
+++ ChangeLog	2001/11/21 02:32:18
@@ -1,3 +1,13 @@
+2001-11-21  Michael Meeks  <michael ximian com>
+
+	* atk/atkrelation.c: pull in string.h for strcmp
+
+	* atk/atktext.c (atk_text_get_selection): fix bug / warning.
+
+	* atk/atkutil.c (atk_add_global_event_listener),
+	(atk_get_toolkit_name, atk_get_toolkit_version):
+	constify & do Bill's ref/unref magic.
+
 2001-11-20  Padraig O'Briain  <padraig obriain sun com>
 
 	* atk/atkobject.[c|h]:
Index: atk/atkrelation.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkrelation.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 atkrelation.c
--- atk/atkrelation.c	2001/09/29 18:52:37	1.7
+++ atk/atkrelation.c	2001/11/21 02:32:19
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <glib-object.h>
 #include "atkobject.h"
 #include "atkrelation.h"
Index: atk/atktext.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atktext.c,v
retrieving revision 1.43
diff -u -p -u -r1.43 atktext.c
--- atk/atktext.c	2001/11/17 11:56:01	1.43
+++ atk/atktext.c	2001/11/21 02:32:21
@@ -728,7 +728,7 @@ atk_text_get_selection (AtkText *text, 
   if (end_offset)
     real_end_offset = end_offset;
   else
-    real_start_offset = &local_end_offset;
+    real_end_offset = &local_end_offset;
 
   iface = ATK_TEXT_GET_IFACE (text);
 
Index: atk/atkutil.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkutil.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 atkutil.c
--- atk/atkutil.c	2001/11/19 10:48:31	1.13
+++ atk/atkutil.c	2001/11/21 02:32:21
@@ -198,7 +198,8 @@ atk_focus_tracker_notify (AtkObject     
  * Returns: added event listener id, or 0 on failure.
  **/
 guint
-atk_add_global_event_listener (GSignalEmissionHook listener, gchar* event_type)
+atk_add_global_event_listener (GSignalEmissionHook listener,
+			       const gchar        *event_type)
 {
   guint retval;
   AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL);
@@ -301,9 +302,10 @@ atk_get_root(void)
  *
  * Returns: name string for the GUI toolkit implementing ATK for this application
  **/
-gchar* atk_get_toolkit_name(void)
+G_CONST_RETURN gchar*
+atk_get_toolkit_name (void)
 {
-  AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL);
+  AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL);
   if (klass->get_toolkit_name)
     {
       return klass->get_toolkit_name ();
@@ -312,6 +314,7 @@ gchar* atk_get_toolkit_name(void)
     {
       return NULL;
     }
+  g_type_class_unref (klass);
 }
 
 /**
@@ -321,10 +324,10 @@ gchar* atk_get_toolkit_name(void)
  *
  * Returns: version string for the GUI toolkit implementing ATK for this application
  **/
-gchar*
-atk_get_toolkit_version(void)
+G_CONST_RETURN gchar*
+atk_get_toolkit_version (void)
 {
-  AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL);
+  AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL);
   if (klass->get_toolkit_version)
     {
       return klass->get_toolkit_version ();
@@ -333,5 +336,5 @@ atk_get_toolkit_version(void)
     {
       return NULL;
     }
+  g_type_class_unref (klass);
 }
-
Index: atk/atkutil.h
===================================================================
RCS file: /cvs/gnome/atk/atk/atkutil.h,v
retrieving revision 1.9
diff -u -p -u -r1.9 atkutil.h
--- atk/atkutil.h	2001/11/20 11:34:09	1.9
+++ atk/atkutil.h	2001/11/21 02:32:22
@@ -76,14 +76,14 @@ struct _AtkUtilClass
 {
    GObjectClass parent;
    guint        (* add_global_event_listener)    (GSignalEmissionHook listener,
-                                                 gchar*               event_type);
+						  const gchar        *event_type);
    void         (* remove_global_event_listener) (guint               listener_id);
    guint	(* add_key_event_listener) 	 (AtkKeySnoopFunc     listener,
 						  gpointer data);
    void         (* remove_key_event_listener)    (guint               listener_id);
    AtkObject*   (* get_root)                     (void);
-   gchar*       (* get_toolkit_name)             (void);
-   gchar*       (* get_toolkit_version)          (void);
+   G_CONST_RETURN gchar* (* get_toolkit_name)    (void);
+   G_CONST_RETURN gchar* (* get_toolkit_version) (void);
 };
 GType atk_util_get_type (void);
 
@@ -132,7 +132,8 @@ void     atk_focus_tracker_notify  (AtkO
  * Adds the specified function to the list of functions to be called
  * when an event of type event_type occurs.
  */
-guint	atk_add_global_event_listener (GSignalEmissionHook listener, gchar* event_type);
+guint	atk_add_global_event_listener (GSignalEmissionHook listener,
+				       const gchar        *event_type);
 
 /*
  * Removes the specified event listener
@@ -158,12 +159,12 @@ AtkObject* atk_get_root(void);
 /*
  * Returns name string for the GUI toolkit.
  */
-gchar* atk_get_toolkit_name(void);
+G_CONST_RETURN gchar *atk_get_toolkit_name (void);
 
 /*
  * Returns version string for the GUI toolkit.
  */
-gchar* atk_get_toolkit_version(void);
+G_CONST_RETURN gchar *atk_get_toolkit_version (void);
 
 #ifdef __cplusplus
 }
? billh
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gail/ChangeLog,v
retrieving revision 1.301
diff -u -p -u -r1.301 ChangeLog
--- ChangeLog	2001/11/20 12:00:16	1.301
+++ ChangeLog	2001/11/21 03:29:00
@@ -1,4 +1,44 @@
-(top)
+2001-11-21  Michael Meeks  <michael ximian com>
+
+	* tests/testtreetable.c (row_inserted, row_deleted):
+	warning fixes.
+
+	* tests/testtoplevel.c (_check_toplevel): const update.
+
+	* tests/testtextlib.c (_run_offset_test): kill
+	warning / bug.
+
+	* tests/testprops.c (_selection_changed): kill warning.
+
+	* gail/Makefile.am (INCLUDES): actually do the -D VERSION
+
+	* gail/gailutil.c (gail_util_remove_key_event_listener):
+	cast guint to pointer.
+	(gail_util_add_global_event_listener): constify, and dup /
+	free the emission hook string.
+	(gail_util_get_toolkit_version),
+	(gail_util_get_toolkit_name): G_CONST_RETURNs
+	& return VERSION not "VERSION".
+
+	* gail/gailtreeview.c: remove stdlib include.
+	(gail_tree_view_real_notify_gtk): kill warning.
+	(gail_tree_view_ref_child): Initialize child - unsure
+	about what was intended here - almost certainly not
+	to use the previous 'child' pointer.
+
+	* gail/gaillabel.c: remove stdlib include.
+
+	* gail/gailcanvastext.c
+	(gail_canvas_text_get_character_count): setup gail_text
+	before using it.
+	(add_to_attr_set): add a default case to kill warning /
+	trap errors.
+
+	* gail/*.c: include string.h to get memset, strcmp etc.
+
+	* gail/gail.c (gail_focus_tracker_init): remove bogus
+	volatile stuff.
+
 2001-11-20  Padraig O'Briain  <padraig obriain sun com>
 
 	* gail/gailcell.c:
Index: gail/Makefile.am
===================================================================
RCS file: /cvs/gnome/gail/gail/Makefile.am,v
retrieving revision 1.40
diff -u -p -u -r1.40 Makefile.am
--- gail/Makefile.am	2001/11/14 10:09:52	1.40
+++ gail/Makefile.am	2001/11/21 03:29:00
@@ -190,7 +190,8 @@ libgailinclude_HEADERS = \
 	gailwindowfactory.h
 
 INCLUDES = \
-	-I$(top_srcdir)		\
+	-I$(top_srcdir)		 \
+	-DVERSION=\"$(VERSION)\" \
 	@DEP_CFLAGS@
 
 LDFLAGS =		\
Index: gail/gail.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gail.c,v
retrieving revision 1.43
diff -u -p -u -r1.43 gail.c
--- gail/gail.c	2001/11/13 09:57:48	1.43
+++ gail/gail.c	2001/11/21 03:29:01
@@ -140,8 +140,8 @@ gail_select_watcher (GSignalInvocationHi
   return TRUE; 
 }
 
-static 
-void gail_focus_tracker_init ()
+static void
+gail_focus_tracker_init ()
 {
   static gboolean  emission_hooks_added = FALSE;
 
@@ -150,8 +150,8 @@ void gail_focus_tracker_init ()
     /*
      * We cannot be sure that the classes exist so we make sure that they do.
      */
-    volatile gpointer dummy1 = gtk_type_class (GTK_TYPE_WIDGET);
-    volatile gpointer dummy2 = gtk_type_class (GTK_TYPE_ITEM);
+    gtk_type_class (GTK_TYPE_WIDGET);
+    gtk_type_class (GTK_TYPE_ITEM);
 
     /*
      * We listen for event_after signal and then check that the
Index: gail/gailadjustment.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailadjustment.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 gailadjustment.c
--- gail/gailadjustment.c	2001/08/21 11:45:31	1.5
+++ gail/gailadjustment.c	2001/11/21 03:29:01
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailadjustment.h"
 
Index: gail/gailbutton.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailbutton.c,v
retrieving revision 1.33
diff -u -p -u -r1.33 gailbutton.c
--- gail/gailbutton.c	2001/11/14 13:22:37	1.33
+++ gail/gailbutton.c	2001/11/21 03:29:03
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include "gailbutton.h"
Index: gail/gailcanvastext.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailcanvastext.c,v
retrieving revision 1.2
diff -u -p -u -r1.2 gailcanvastext.c
--- gail/gailcanvastext.c	2001/11/14 10:09:52	1.2
+++ gail/gailcanvastext.c	2001/11/21 03:29:04
@@ -278,6 +278,7 @@ gail_canvas_text_get_character_count (At
   GailCanvasText *gail_text;
 
   g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), 0);
+  gail_text = GAIL_CANVAS_TEXT (text);
   g_return_val_if_fail (gail_text->texthelper, 0);
   buffer = gail_text->texthelper->buffer;
   return gtk_text_buffer_get_char_count (buffer);
@@ -1057,6 +1058,10 @@ add_to_attr_set (AtkAttributeSet   *attr
     case ATK_TEXT_ATTR_STYLE:
       value = g_strdup (atk_attribute_get_value (attr, 
                         pango_font_description_get_style (attrs->font)));
+      break;
+    default:
+      value = NULL;
+      g_assert_not_reached ();
       break;
     }
   return gail_text_helper_add_attribute (attrib_set, 
Index: gail/gailentry.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailentry.c,v
retrieving revision 1.49
diff -u -p -u -r1.49 gailentry.c
--- gail/gailentry.c	2001/11/17 12:07:40	1.49
+++ gail/gailentry.c	2001/11/21 03:29:06
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailentry.h"
 #include "gailentryfactory.h"
Index: gail/gailframe.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailframe.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 gailframe.c
--- gail/gailframe.c	2001/11/14 13:22:38	1.5
+++ gail/gailframe.c	2001/11/21 03:29:07
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailframe.h"
 #include "gailframefactory.h"
Index: gail/gaillabel.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gaillabel.c,v
retrieving revision 1.46
diff -u -p -u -r1.46 gaillabel.c
--- gail/gaillabel.c	2001/11/17 12:07:40	1.46
+++ gail/gaillabel.c	2001/11/21 03:29:08
@@ -17,8 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
-#include <stdlib.h>
 #include "gaillabel.h"
 #include "gaillabelfactory.h"
 #include "gailtexthelper.h"
Index: gail/gailnotebook.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailnotebook.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 gailnotebook.c
--- gail/gailnotebook.c	2001/11/14 13:22:38	1.11
+++ gail/gailnotebook.c	2001/11/21 03:29:09
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailnotebook.h"
 #include "gailnotebookfactory.h"
Index: gail/gailoptionmenu.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailoptionmenu.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 gailoptionmenu.c
--- gail/gailoptionmenu.c	2001/11/14 13:22:38	1.7
+++ gail/gailoptionmenu.c	2001/11/21 03:29:10
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include "gailoptionmenu.h"
Index: gail/gailpaned.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailpaned.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 gailpaned.c
--- gail/gailpaned.c	2001/11/14 13:22:38	1.5
+++ gail/gailpaned.c	2001/11/21 03:29:10
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailpaned.h"
 #include "gailpanedfactory.h"
Index: gail/gailprogressbar.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailprogressbar.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 gailprogressbar.c
--- gail/gailprogressbar.c	2001/11/14 13:22:38	1.10
+++ gail/gailprogressbar.c	2001/11/21 03:29:11
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailprogressbar.h"
 #include "gailprogressbarfactory.h"
Index: gail/gailrange.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailrange.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 gailrange.c
--- gail/gailrange.c	2001/11/14 13:22:38	1.13
+++ gail/gailrange.c	2001/11/21 03:29:11
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailrange.h"
 #include "gailrangefactory.h"
Index: gail/gailscrolledwindow.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailscrolledwindow.c,v
retrieving revision 1.8
diff -u -p -u -r1.8 gailscrolledwindow.c
--- gail/gailscrolledwindow.c	2001/11/14 13:22:38	1.8
+++ gail/gailscrolledwindow.c	2001/11/21 03:29:12
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailscrolledwindow.h"
 #include "gailscrolledwindowfactory.h"
Index: gail/gailspinbutton.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailspinbutton.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 gailspinbutton.c
--- gail/gailspinbutton.c	2001/11/14 13:22:38	1.11
+++ gail/gailspinbutton.c	2001/11/21 03:29:12
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailspinbutton.h"
 #include "gailspinbuttonfactory.h"
Index: gail/gailstatusbar.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailstatusbar.c,v
retrieving revision 1.9
diff -u -p -u -r1.9 gailstatusbar.c
--- gail/gailstatusbar.c	2001/11/14 13:22:38	1.9
+++ gail/gailstatusbar.c	2001/11/21 03:29:12
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailstatusbar.h"
 #include "gailstatusbarfactory.h"
Index: gail/gailtextview.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtextview.c,v
retrieving revision 1.69
diff -u -p -u -r1.69 gailtextview.c
--- gail/gailtextview.c	2001/11/17 12:07:40	1.69
+++ gail/gailtextview.c	2001/11/21 03:29:15
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include "gailtextview.h"
@@ -1994,6 +1995,10 @@ add_to_attr_set (AtkAttributeSet   *attr
     case ATK_TEXT_ATTR_STYLE:
       value = g_strdup (atk_attribute_get_value (attr, 
                         pango_font_description_get_style (attrs->font)));
+      break;
+    default:
+      value = NULL;
+      g_assert_not_reached ();
       break;
     }
   return gail_text_helper_add_attribute (attrib_set, 
Index: gail/gailtogglebutton.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtogglebutton.c,v
retrieving revision 1.14
diff -u -p -u -r1.14 gailtogglebutton.c
--- gail/gailtogglebutton.c	2001/11/14 13:22:39	1.14
+++ gail/gailtogglebutton.c	2001/11/21 03:29:16
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailtogglebutton.h"
 #include "gailtogglebuttonfactory.h"
Index: gail/gailtreeview.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtreeview.c,v
retrieving revision 1.109
diff -u -p -u -r1.109 gailtreeview.c
--- gail/gailtreeview.c	2001/11/20 12:00:17	1.109
+++ gail/gailtreeview.c	2001/11/21 03:29:25
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <stdlib.h>
+#include <string.h>
 #include <gtk/gtk.h>
 #include <gtk/gtktreeviewcolumn.h>
 #include "gailtreeview.h"
@@ -570,7 +570,10 @@ gail_tree_view_real_notify_gtk (GObject 
           else if (GTK_IS_LIST_STORE (tree_model))
             role = ATK_ROLE_TABLE;
           else
-            g_assert_not_reached();
+	    {
+              role = 0;
+              g_assert_not_reached();
+	    }
 
           atk_object_set_role (atk_obj, role);
         }
@@ -823,13 +826,15 @@ gail_tree_view_ref_child (AtkObject *obj
   
   if (container)
     child =  ATK_OBJECT (container);
+  else
+    child = NULL;
   /*
    * Even if we have an expander column we check whether we have
    * a TreeTable, i.e. a GtkTreeView whose model is a GtkTreeStore
    *
    * When bug 64380 is fixed we can eliminate the second test.
    */
-  if (expander_tv == tv_col &&
+  if (expander_tv == tv_col && child &&
       atk_object_get_role (obj) == ATK_ROLE_TREE_TABLE)
     {
       AtkRelationSet *relation_set;
Index: gail/gailutil.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailutil.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 gailutil.c
--- gail/gailutil.c	2001/11/20 11:35:19	1.11
+++ gail/gailutil.c	2001/11/21 03:29:26
@@ -27,14 +27,14 @@ static void		gail_util_class_init			(Gai
 /* atkutil.h */
 
 static guint		gail_util_add_global_event_listener	(GSignalEmissionHook	listener,
-								gchar*			event_type);
+							         const gchar*           event_type);
 static void 		gail_util_remove_global_event_listener	(guint			remove_listener);
 static guint		gail_util_add_key_event_listener	(AtkKeySnoopFunc	listener,
 								 gpointer               data);
 static void 		gail_util_remove_key_event_listener	(guint			remove_listener);
 static AtkObject*	gail_util_get_root			(void);
-static gchar*		gail_util_get_toolkit_name		(void);
-static gchar* 		gail_util_get_toolkit_version		(void);
+static G_CONST_RETURN gchar *gail_util_get_toolkit_name		(void);
+static G_CONST_RETURN gchar *gail_util_get_toolkit_version      (void);
 
 /* Misc */
 
@@ -119,7 +119,7 @@ gail_util_class_init (GailUtilClass *kla
 
 static guint
 gail_util_add_global_event_listener (GSignalEmissionHook listener,
-   gchar* event_type)
+				     const gchar *event_type)
 {
   GType type;
   guint signal_id;
@@ -141,8 +141,9 @@ gail_util_add_global_event_listener (GSi
           listener_info = g_malloc(sizeof(GailUtilListenerInfo));
           listener_info->key = listener_idx;
           listener_info->hook_id =
-            g_signal_add_emission_hook (signal_id, 0, listener,
-            event_type, (GDestroyNotify) NULL);
+		  g_signal_add_emission_hook (signal_id, 0, listener,
+					      g_strdup (event_type),
+					      (GDestroyNotify) g_free);
           listener_info->signal_id = signal_id;
 
 	  g_hash_table_insert(listener_list, &(listener_info->key),
@@ -280,7 +281,7 @@ gail_util_add_key_event_listener (AtkKey
 static void
 gail_util_remove_key_event_listener (guint remove_listener)
 {
-  g_hash_table_remove (key_listener_list, remove_listener);	
+  g_hash_table_remove (key_listener_list, GUINT_TO_POINTER (remove_listener));
   if (g_hash_table_size (key_listener_list) == 0)
     {
       gtk_key_snooper_remove (key_snooper_id);
@@ -296,20 +297,20 @@ gail_util_get_root (void)
   return root;
 }
 
-static gchar*
+static G_CONST_RETURN gchar *
 gail_util_get_toolkit_name (void)
 {
-  return ("GAIL");
+  return "GAIL";
 }
 
-static gchar*
+static G_CONST_RETURN gchar *
 gail_util_get_toolkit_version (void)
 {
  /*
   * Version is passed in as a -D flag when this file is
   * compiled.
   */
-  return ("VERSION");
+  return VERSION;
 }
 
 static void
Index: gail/gailwidget.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailwidget.c,v
retrieving revision 1.43
diff -u -p -u -r1.43 gailwidget.c
--- gail/gailwidget.c	2001/11/14 13:22:39	1.43
+++ gail/gailwidget.c	2001/11/21 03:29:27
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "gailwidget.h"
 #include "gailnotebookpage.h"
Index: tests/testaction.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testaction.c,v
retrieving revision 1.1
diff -u -p -u -r1.1 testaction.c
--- tests/testaction.c	2001/07/20 09:15:49	1.1
+++ tests/testaction.c	2001/11/21 03:29:28
@@ -1,6 +1,7 @@
+#include <string.h>
+#include <stdlib.h>
 #include <gtk/gtk.h>
 #include "testlib.h"
-#include <stdlib.h>
 
 /*
  * This module is used to test the implementation of AtkAction,
Index: tests/testlib.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testlib.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 testlib.c
--- tests/testlib.c	2001/11/19 16:37:00	1.22
+++ tests/testlib.c	2001/11/21 03:29:30
@@ -1,5 +1,6 @@
-#include <stdlib.h>
+#include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include "testlib.h" 
 
 static gint	_get_position_in_array		(gint		window,
Index: tests/testpaned.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testpaned.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 testpaned.c
--- tests/testpaned.c	2001/08/10 09:36:34	1.4
+++ tests/testpaned.c	2001/11/21 03:29:31
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <testlib.h>
Index: tests/testprops.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testprops.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 testprops.c
--- tests/testprops.c	2001/11/19 16:37:00	1.16
+++ tests/testprops.c	2001/11/21 03:29:31
@@ -1,7 +1,8 @@
+#include <string.h>
+#include <stdlib.h>
 #include <atk/atk.h>
 #include <gtk/gtk.h>
 #include <testlib.h>
-#include <stdlib.h>
 
 static void _traverse_children (AtkObject *obj);
 static void _add_handler (AtkObject *obj);
@@ -39,7 +40,8 @@ static void _state_changed (AtkObject   
     g_assert_not_reached();
 }
 
-static void _selection_changed (AtkObject   *obj)
+static void
+_selection_changed (AtkObject   *obj)
 {
   gchar *type;
 
@@ -48,7 +50,10 @@ static void _selection_changed (AtkObjec
   else if (ATK_IS_SELECTION (obj))
     type = "child selection";
   else
-    g_assert_not_reached();
+    {
+      type = NULL;
+      g_assert_not_reached();
+    }
 
   g_print ("In selection_changed signal handler for %s, object type: %s\n",
            type, g_type_name (G_OBJECT_TYPE (obj)));
Index: tests/testtable.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testtable.c,v
retrieving revision 1.35
diff -u -p -u -r1.35 testtable.c
--- tests/testtable.c	2001/11/07 13:41:39	1.35
+++ tests/testtable.c	2001/11/21 03:29:33
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdlib.h>
 #include "testtextlib.h"
 
Index: tests/testtextlib.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testtextlib.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 testtextlib.c
--- tests/testtextlib.c	2001/10/25 12:17:47	1.13
+++ tests/testtextlib.c	2001/11/21 03:29:34
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdio.h>
 #include "testtextlib.h"
 
@@ -699,6 +700,8 @@ void _run_offset_test(AtkObject * obj, c
   else if (strcmp(type, "after") == 0)
     text = atk_text_get_text_after_offset (ATK_TEXT (obj),
        offset, boundary, &startOffset, &endOffset);
+  else
+    text = NULL;
 
   if (text == NULL)
     text = g_strdup (default_val);
Index: tests/testtoplevel.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testtoplevel.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 testtoplevel.c
--- tests/testtoplevel.c	2001/10/25 12:17:47	1.6
+++ tests/testtoplevel.c	2001/11/21 03:29:35
@@ -16,10 +16,11 @@ static gboolean g_register_listener = FA
 static guint g_signal_listener = 0;
 static gint g_press_count = 0;
 
-static void _check_toplevel (AtkObject *obj)
+static void
+_check_toplevel (AtkObject *obj)
 {
   AtkObject *root_obj;
-  gchar *name_string, *version_string;
+  const gchar *name_string, *version_string;
   gint max_depth;
 
   g_print ("Start of _check_toplevel\n");
Index: tests/testtreetable.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testtreetable.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 testtreetable.c
--- tests/testtreetable.c	2001/11/20 12:00:18	1.6
+++ tests/testtreetable.c	2001/11/21 03:29:36
@@ -379,9 +379,11 @@ row_inserted (AtkObject *obj,
               gint      row,
               gint      count)
 {
+#if 0
   GtkWidget *widget;
   GtkTreeView *tree_view;
   GtkTreeModel *tree_model;
+#endif
   gint index;
 
   g_print ("row_inserted: row: %d count: %d\n", row, count);
@@ -412,9 +414,11 @@ row_deleted (AtkObject *obj,
              gint      row,
              gint      count)
 {
+#if 0
   GtkWidget *widget;
   GtkTreeView *tree_view;
   GtkTreeModel *tree_model;
+#endif
   gint index;
 
   g_print ("row_deleted: row: %d count: %d\n", row, count);
Index: tests/testvalues.c
===================================================================
RCS file: /cvs/gnome/gail/tests/testvalues.c,v
retrieving revision 1.3
diff -u -p -u -r1.3 testvalues.c
--- tests/testvalues.c	2001/08/10 09:36:34	1.3
+++ tests/testvalues.c	2001/11/21 03:29:36
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <atk/atk.h>
 #include <atk/atkvalue.h>
 #include <gtk/gtk.h>


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