antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright/gtkshell arguments.c button.c callbac...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/gtkshell arguments.c button.c callbac...
Date: Tue, 17 Aug 2010 19:17:25 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 10/08/17 19:17:25

Modified files:
        gtkshell       : arguments.c button.c callbacks.c containers.c 
                         gsh.h gtkshell.c gtkshell.h image_button.c 
                         image_button.h init.c macros.h main.c menu.c 
                         option_options.c option_options.h options.c 
                         ptk-app-menu.c ptk-app-menu.h row.c terminal.c 
                         undo.c updated.c 

Log message:
        Fix segmentation faults due to invalid freeing of memory at program 
exit.
        Further consolidate functions in options.c.  Reindent code.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gsh.h?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.h?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.c?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/menu.c?cvsroot=antiright&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.h?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/ptk-app-menu.c?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/ptk-app-menu.h?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal.c?cvsroot=antiright&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated.c?cvsroot=antiright&r1=1.23&r2=1.24

Patches:
Index: arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37

Index: button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- button.c    17 Aug 2010 12:57:12 -0000      1.62
+++ button.c    17 Aug 2010 19:17:24 -0000      1.63
@@ -38,10 +38,10 @@
 setup_label (GtkWidget * widget, const gchar * command)
 {
   gchar *formatted;
-       gchar * tmp=g_strdup(command);
+  gchar *tmp = g_strdup (command);
 
   formatted = antiright_beautified_label (tmp);
-       g_free(tmp);
+  g_free (tmp);
   GTK_IS_MENU_ITEM (widget) ? create_label_in_menu_item (widget, formatted)
     : gtk_button_set_label (GTK_BUTTON (widget), formatted);
   g_free (formatted);
@@ -78,6 +78,7 @@
   gsh_setup_drag_drop (gsh, button);
   setup_callback (gsh, button, command);
 }
+
 static GtkWidget *
 label_to_icon_translation (const gchar * label)
 {
@@ -95,7 +96,7 @@
       if (!strcmp (mapping[mapping_count].label,
                   g_strstrip ((gchar *) label)))
        {
-         gtk_widget_show(image=gsh_get_image(mapping[mapping_count].icon,
+         gtk_widget_show (image = gsh_get_image (mapping[mapping_count].icon,
                                               GTK_ICON_SIZE_BUTTON));
 #if GTK_MINOR_VERSION >= 12
          gtk_widget_set_tooltip_text (image, label);
@@ -105,6 +106,7 @@
     }
   return image;
 }
+
 static bool
 setup_icon_for_toolbutton (GtkWidget * toolbutton, gchar * label_text)
 {
@@ -124,9 +126,9 @@
 setup_label_for_toolbutton (GtkWidget * toolbutton, const gchar * command)
 {
   gchar *label_text;
-       gchar * tmp=g_strdup(command);
+  gchar *tmp = g_strdup (command);
   label_text = antiright_beautified_label (tmp);
-       g_free(tmp);
+  g_free (tmp);
   gtk_button_set_label (GTK_BUTTON (toolbutton), label_text);
   if (setup_icon_for_toolbutton (toolbutton, label_text)
       && (gsh_is_menubar_item (label_text) == GMT_NONE))

Index: callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- callbacks.c 17 Aug 2010 12:57:12 -0000      1.39
+++ callbacks.c 17 Aug 2010 19:17:24 -0000      1.40
@@ -49,7 +49,7 @@
 
   command += 6;
   split_command = g_strsplit (command, "#", 2);
-       feed_command=g_strconcat(split_command[0], "\n", NULL);
+  feed_command = g_strconcat (split_command[0], "\n", NULL);
   g_strfreev (split_command);
 #ifdef HAVE_VTE
   vte_terminal_feed_child (VTE_TERMINAL (terminal),

Index: containers.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/containers.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- containers.c        17 Aug 2010 15:21:47 -0000      1.27
+++ containers.c        17 Aug 2010 19:17:24 -0000      1.28
@@ -30,13 +30,13 @@
 gsh_setup_scrolled_window (struct GSH *gsh)
 {
   GtkWidget *scrolled_window;
-  GtkWidget *window=gsh->widgets.window;
+  GtkWidget *window = gsh->widgets.window;
 
   scrolled_window = gsh->widgets.scrolled_window
     = gtk_scrolled_window_new (NULL, NULL);
-  GSWS(shadow_type, scrolled_window, GTK_SHADOW_OUT);
-  GSWS(policy, scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  GSHCA(window, scrolled_window);
+  GSWS (shadow_type, scrolled_window, GTK_SHADOW_OUT);
+  GSWS (policy, scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+  GSHCA (window, scrolled_window);
   gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW
                                         (scrolled_window), gsh->rows->h);
   gtk_widget_show (scrolled_window);

Index: gsh.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gsh.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gsh.h       17 Aug 2010 15:21:47 -0000      1.5
+++ gsh.h       17 Aug 2010 19:17:24 -0000      1.6
@@ -68,6 +68,7 @@
   struct GSH_Terminal *terminal;
 
   ARTupleVector *command_dictionary;
+  gchar *usage;
 
   /* methods */
   void (*delete) (struct GSH *);

Index: gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- gtkshell.c  17 Aug 2010 15:21:47 -0000      1.53
+++ gtkshell.c  17 Aug 2010 19:17:24 -0000      1.54
@@ -55,22 +55,14 @@
   /* setup app mode fields */
 #define GWA gsh->widgets.app
 #define GWAM GWA.menus
-  gsh->widgets.last_managed = GWA.menubar = GWA.toolbar =NULL;
-  GWAM.file = NULL;
-  GWAM.edit = NULL;
-  GWAM.view = NULL;
-  GWAM.tools = NULL;
-  GWAM.help = NULL;
-  GWA.frame = NULL;
-  GWA.status = NULL;
-  gsh->editor.widget = NULL;
-  gsh->editor.filename = NULL;
-  gsh->editor.fgcolor = NULL;
-  gsh->editor.bgcolor = NULL;
-  gsh->geometry = (gchar *) NULL;
+  gsh->widgets.last_managed = GWA.menubar = GWA.toolbar = GWAM.file
+    = GWAM.edit = GWAM.view = GWAM.tools = GWAM.help = GWA.frame
+    = GWA.status = gsh->editor.widget = NULL;
+  gsh->command_dictionary = NULL;
+  gsh->editor.fgcolor = gsh->editor.bgcolor = gsh->editor.filename
+    = gsh->geometry = gsh->usage = (gchar *) NULL;
   gsh->bflags = 0;
   gsh->icon_size = GTK_ICON_SIZE_DND;
-  gsh->command_dictionary = NULL;
   /* Add initial window.  */
   $ (gsh, add.window);
 
@@ -78,13 +70,12 @@
 }
 
 GSH *
-gsh_new_GSH()
+gsh_new_GSH ()
 {
-  GSH * gsh;
+  GSH *gsh;
 
-  gsh=(GSH*)armalloc(sizeof(GSH));
-  gsh_GSH(gsh);
+  gsh = (GSH *) armalloc (sizeof (GSH));
+  gsh_GSH (gsh);
 
   return gsh;
 }
-

Index: gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- gtkshell.h  17 Aug 2010 15:21:47 -0000      1.62
+++ gtkshell.h  17 Aug 2010 19:17:24 -0000      1.63
@@ -56,8 +56,7 @@
 
 #include "module_includes.h"
 
-void
-gsh_GSH (GSH * gsh);
+void gsh_GSH (GSH * gsh);
 
 GSH *gsh_new_GSH ();
 

Index: image_button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- image_button.c      17 Aug 2010 15:21:47 -0000      1.25
+++ image_button.c      17 Aug 2010 19:17:24 -0000      1.26
@@ -23,9 +23,9 @@
 #include "gtkshell.h"
 
 static inline guint
-gsh_icon_size_to_pixels(const guint icon_size)
+gsh_icon_size_to_pixels (const guint icon_size)
 {
-  switch(icon_size)
+  switch (icon_size)
     {
     case 1:
       return 16;
@@ -49,42 +49,42 @@
 GtkWidget *
 gsh_get_image (const gchar * name, const guint icon_size)
 {
-  const guint sz=gsh_icon_size_to_pixels(icon_size);
-  GtkWidget *image=NULL;
+  const guint sz = gsh_icon_size_to_pixels (icon_size);
+  GtkWidget *image = NULL;
     {
       GdkPixbuf *pix;
 #define CHKPIX if(pix) goto imagenew
 #define LOADPB(n) gdk_pixbuf_new_from_file_at_size(n,sz,sz,NULL)
-      pix=LOADPB(name);
+    pix = LOADPB (name);
       CHKPIX;
         {
-          gchar *prefixed_name=g_strconcat(ARDATADIR "/icons/", name, NULL);
-          pix=LOADPB(prefixed_name);
-          g_free(prefixed_name);
+      gchar *prefixed_name = g_strconcat (ARDATADIR "/icons/", name, NULL);
+      pix = LOADPB (prefixed_name);
+      g_free (prefixed_name);
         }
       CHKPIX;
         {
-          GtkIconInfo * inf;
+      GtkIconInfo *inf;
 #define LOOKUP(n) gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(),\
                                              n, sz, 0)
-          if(!(inf=LOOKUP(name)))
-             inf=LOOKUP("exec");
-          if(inf)
+      if (!(inf = LOOKUP (name)))
+       inf = LOOKUP ("exec");
+      if (inf)
           {
-            pix=LOADPB(gtk_icon_info_get_filename(inf));
+         pix = LOADPB (gtk_icon_info_get_filename (inf));
             gtk_icon_info_free (inf);
           }
         }
-imagenew:
-      if(pix)
+  imagenew:
+    if (pix)
         {
-          image=gtk_image_new_from_pixbuf(pix);
-          g_object_unref(pix);
+       image = gtk_image_new_from_pixbuf (pix);
+       g_object_unref (pix);
 
           return image;
         }
     }
-      if((image=gtk_image_new_from_stock (name, icon_size)))
+  if ((image = gtk_image_new_from_stock (name, icon_size)))
         return image;
       else
         return gtk_image_new_from_stock ("gtk-execute", icon_size);
@@ -96,22 +96,21 @@
   GtkWidget *image;
 
   $ (gsh, add.button, command);
-  image = gsh_get_image ((const gchar*)name, gsh->icon_size);
-  if(image)
+  image = gsh_get_image ((const gchar *) name, gsh->icon_size);
+  if (image)
     {
-      GtkWidget *parent=gsh->rows->v;
-      GtkWidget *button=gsh->widgets.button;
+      GtkWidget *parent = gsh->rows->v;
+      GtkWidget *button = gsh->widgets.button;
       gtk_widget_show (image);
-      if(!GTK_IS_MENU(parent)/* && !GTK_IS_TOOLBAR(parent))*/)
+      if (!GTK_IS_MENU (parent) /* && !GTK_IS_TOOLBAR(parent)) */ )
         {
           gtk_button_set_image (GTK_BUTTON (button), image);
-          if(GSH_FLAG(GSH_NO_RELIEF))
+         if (GSH_FLAG (GSH_NO_RELIEF))
             gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
         }
       else /* is menu-related */
         {
-          gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM(button), image);
+         gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (button), image);
         }
     }
 }
-

Index: image_button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- image_button.h      17 Aug 2010 12:57:12 -0000      1.10
+++ image_button.h      17 Aug 2010 19:17:24 -0000      1.11
@@ -23,9 +23,8 @@
 #ifndef GSH_IMAGE_BUTTON_H
 #define GSH_IMAGE_BUTTON_H
 
-GtkWidget *gsh_get_image (const gchar *name, const guint icon_size);
+GtkWidget *gsh_get_image (const gchar * name, const guint icon_size);
 
 void gsh_image_button (struct GSH *gsh, char *command, char *name);
 
 #endif /* GSH_IMAGE_BUTTON_H */
-

Index: init.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/init.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- init.c      16 Aug 2010 11:51:21 -0000      1.15
+++ init.c      17 Aug 2010 19:17:24 -0000      1.16
@@ -50,6 +50,9 @@
 void
 gsh_GSH_finalize (struct GSH *gsh)
 {
+  /* free command line usage string if it has been set up */
+  if (gsh->usage)
+    g_free (gsh->usage);
   /* Choose the correct parenting of the widget hierarchy based on options
    * set.  */
   gsh_setup_base_container (gsh);

Index: macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- macros.h    17 Aug 2010 12:57:12 -0000      1.23
+++ macros.h    17 Aug 2010 19:17:24 -0000      1.24
@@ -54,6 +54,7 @@
 #define GSH_ACTION_IF(action, arg) if(arg) action(arg)
 #define GSH_DESTROY_IF(widget) GSH_ACTION_IF(gtk_widget_destroy, widget)
 #define GSH_FREE_IF(var) GSH_ACTION_IF(g_free, var)
+#define GFREEIF(var) {if(var) {g_free(var); var=NULL;}}
 
 #define GSH_FIXME() \
        sysprintf("gtkshell -dw '%s:%d: FIXME'",\
@@ -64,7 +65,7 @@
        gtk_container_add(GTK_CONTAINER(container), widget)
 /* Add without expansion.  */
 #define GSHCA_TIGHT(cont, widget)\
-       gtk_box_pack_start(GTK_BOX(cont), widget, FALSE, FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(cont), widget, FALSE, FALSE, 0)
 
 /* Create and show a widget at the same time.  */
 #define GSH_SHOW_CREATE(var, type, ...)\

Index: main.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/main.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- main.c      17 Aug 2010 15:21:47 -0000      1.36
+++ main.c      17 Aug 2010 19:17:24 -0000      1.37
@@ -27,7 +27,7 @@
 {
   gint counter;
   struct ARArguments *argset;
-  GSH *gsh=alloca(sizeof(GSH));
+  GSH *gsh = alloca (sizeof (GSH));
 
   gtk_init (&argc, &argv);
 
@@ -39,8 +39,8 @@
       /* Use '---' as thread separator.  */
       if (!strncmp (argv[counter], "---", 3))
        {
-          gsh_GSH(gsh);
-          $ (gsh, parse, (const gint)argc, (const gchar **)argv);
+         gsh_GSH (gsh);
+         $ (gsh, parse, (const gint) argc, (const gchar **) argv);
           $ (gsh, finalize);
          $ (argset, delete_options);
          argset = ARNEW (ar, ARArguments);
@@ -51,8 +51,8 @@
          $ (argset, add, argv[counter]);
        }
     }
-    gsh_GSH(gsh);
-    $ (gsh, parse, (const gint)argc, (const gchar **)argv);
+  gsh_GSH (gsh);
+  $ (gsh, parse, (const gint) argc, (const gchar **) argv);
     $ (gsh, finalize);
   $ (argset, delete_options);
   if (gsh->command_dictionary)

Index: menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/menu.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- menu.c      17 Aug 2010 12:57:12 -0000      1.32
+++ menu.c      17 Aug 2010 19:17:24 -0000      1.33
@@ -31,9 +31,9 @@
   /* Test if a separator should be created.  */
   if (!strncmp (pair[0], "---", 3))
     {
-       GtkWidget * separator;
+      GtkWidget *separator;
 
-       GSH_ADD_WIDGET(gsh->rows->v, separator, separator_menu_item);
+      GSH_ADD_WIDGET (gsh->rows->v, separator, separator_menu_item);
     }
   /* String does not contain \n.  */
   else if (strncmp (pair[0], "\\n", 2))
@@ -86,10 +86,10 @@
 find_and_set_label_widget (GtkWidget * label, const gchar * command)
 {
   gchar *label_text;
-       gchar * tmp=g_strdup(command);
+  gchar *tmp = g_strdup (command);
 
   label_text = antiright_beautified_label (tmp);
-       g_free(tmp);
+  g_free (tmp);
   if (GTK_IS_LABEL (label))
     set_submenu_label (label, label_text);
   else

Index: option_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- option_options.c    17 Aug 2010 12:57:12 -0000      1.44
+++ option_options.c    17 Aug 2010 19:17:24 -0000      1.45
@@ -24,7 +24,8 @@
 #include "gtkshell.h"
 
 void
-gsh_option_app_mode_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_app_mode_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                       const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_APP_MODE);
 }
@@ -37,37 +38,45 @@
 }
 
 void
-gsh_option_no_relief_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_no_relief_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                        const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_NO_RELIEF);
 }
 
 void
-gsh_option_no_dummy_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_no_dummy_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                       const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_GUIDL_NO_DUMMY);
 }
 
 void
-gsh_option_echoes_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_echoes_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                     const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_PROMPT_ECHOES);
 }
 
 void
-gsh_option_exits_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_exits_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                    const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_CBEXIT);
 }
 
 void
-gsh_option_no_base_frame_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_no_base_frame_cb (GSH * gsh,
+                            gint * counter __attribute__ ((unused)),
+                            const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_NO_BASE_FRAME);
 }
 
 void
-gsh_option_framed_labels_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_framed_labels_cb (GSH * gsh,
+                            gint * counter __attribute__ ((unused)),
+                            const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_FRAMED_LABELS);
 }
@@ -80,13 +89,17 @@
 }
 
 void
-gsh_option_horiz_clock_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_horiz_clock_cb (GSH * gsh,
+                          gint * counter __attribute__ ((unused)),
+                          const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_HORIZ_CLOCK);
 }
 
 void
-gsh_option_horiz_labels_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_horiz_labels_cb (GSH * gsh,
+                           gint * counter __attribute__ ((unused)),
+                           const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_HORIZONTAL_LABELS);
 }
@@ -119,19 +132,24 @@
 }
 
 void
-gsh_option_expand_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_expand_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                     const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_NO_EXPAND);
 }
 
 void
-gsh_option_no_expand_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_no_expand_cb (GSH * gsh,
+                        gint * counter __attribute__ ((unused)),
+                        const gchar ** argv __attribute__ ((unused)))
 {
   GSH_UNSET (GSH_NO_EXPAND);
 }
 
 void
-gsh_option_no_decorations_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_no_decorations_cb (GSH * gsh,
+                             gint * counter __attribute__ ((unused)),
+                             const gchar ** argv __attribute__ ((unused)))
 {
   GtkWindow *window;
 
@@ -152,7 +170,8 @@
 }
 
 void
-gsh_option_pane_next_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_pane_next_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                        const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_PANE_NEXT);
 }
@@ -164,7 +183,8 @@
 }
 
 void
-gsh_option_scroll_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_option_scroll_cb (GSH * gsh, gint * counter __attribute__ ((unused)),
+                     const gchar ** argv __attribute__ ((unused)))
 {
   GSH_SET (GSH_SCROLL);
 }

Index: option_options.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- option_options.h    17 Aug 2010 12:57:12 -0000      1.13
+++ option_options.h    17 Aug 2010 19:17:24 -0000      1.14
@@ -27,7 +27,7 @@
 
 void gsh_option_color_cb (GSH * gsh, gint * counter, const gchar ** argv);
 
-void gsh_option_no_relief_cb(GSH * gsh, gint * counter, const gchar ** argv);
+void gsh_option_no_relief_cb (GSH * gsh, gint * counter, const gchar ** argv);
 
 void gsh_option_no_dummy_cb (GSH * gsh, gint * counter, const gchar ** argv);
 

Index: options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- options.c   17 Aug 2010 12:57:12 -0000      1.48
+++ options.c   17 Aug 2010 19:17:25 -0000      1.49
@@ -24,112 +24,68 @@
 
 extern FILE *yyin, *yyout;
 extern struct GDLEnvironment *gsh_guidl_env;
-static gchar *gsh_options_usage_string = NULL;
 
-#ifdef DEBUG
 static void
-print_arguments (const gint argc, const gchar ** argv)
+common_guidl_handler (GSH * gsh)
 {
-  gint i;
-  for (i = 0; i < argc; i++)
-    printf ("'%s' ", argv[i]);
-  putchar ('\n');
-}
-#endif /* DEBUG */
-
-
-/* Determine whether or not to include an initial
+  /* make sure environment has been initialized */
+  if (!gsh_guidl_env)
+    gsh_guidl_env = ARNEW (gsh, GDLEnvironment);
+  /* Determine whether or not to include an initial
    dummy argument.  Needed as argv[0] is skipped
    by the command line handling code. */
-static void
-check_for_dummy_argument (GSH * gsh)
-{
   if (!GSH_FLAG (GSH_GUIDL_NO_DUMMY))
     $ (gsh_guidl_env->args, add, (const gchar *) "guidl");
-}
-
-static void
-check_gsh_guidl_env ()
-{
-  if (!gsh_guidl_env)
-    gsh_guidl_env = ARNEW (gsh, GDLEnvironment);
-}
-
-static void
-common_guidl_handler (GSH * gsh)
-{
-  check_gsh_guidl_env ();
-  check_for_dummy_argument (gsh);
   yyparse ();
   /* Shortcut for specification of arguments.  */
 #define GGEA gsh_guidl_env->args
-#ifdef DEBUG
-  print_arguments ((const gint) GGEA->argc, (const gchar **) GGEA->argv);
-#endif /* DEBUG */
   $ (gsh, parse, GGEA->argc, (const gchar **) GGEA->argv);
   $ (gsh_guidl_env, delete);
   gsh_guidl_env = NULL;
 }
 
 static void
-guidl_handler_for_file (GSH * gsh, const gchar * filename)
-{
-  /* If the argument is "-", use stdin for yyin.  */
-  /* Otherwise, use FILENAME.  */
-  if (strcmp ("-", filename))
-    yyin = fopen (filename, "r");
-  common_guidl_handler (gsh);
-}
-
-static void
-print_usage (void)
-{
-  if (gsh_options_usage_string != NULL)
-    fprintf (stderr, "%s\n", gsh_options_usage_string);
-}
-
-void
-gsh_invalid_option (const gchar ** argv, const gint option)
+gsh_invalid_option (GSH * gsh, const gchar ** argv, const gint option)
 {
   g_warning ("%s:  %s undefined\n", argv[0], argv[option]);
-  print_usage ();
+  if (gsh->usage)
+    fprintf (stderr, "%s\n", gsh->usage);
   exit (1);
 }
 
-#define HANDLE(type)\
-       gsh_handle_##type##_arguments(gsh, argc, argv, counter)
-
-
-#ifdef DEBUG
-/* This exists for testing new code.  */
 static void
-test_cb (GSH * gsh __attribute__ ((unused)),
-        gint * counter __attribute__ ((unused)),
-        const gchar ** argv __attribute__ ((unused)))
+guidl_file_cb (GSH * gsh, gint * counter, const gchar ** argv)
 {
+  const gchar *filename = argv[++(*counter)];
+
+  /* If the argument is "-", use stdin for yyin.  */
+  /* Otherwise, use FILENAME.  */
+  if (strcmp ("-", filename))
+    yyin = fopen (filename, "r");
+  common_guidl_handler (gsh);
 }
-#endif
 
 
 static void
-guidl_file_cb (GSH * gsh, gint * counter, const gchar ** argv)
+add_to_usage (GSH * gsh, const gchar * key, const gchar * descr)
 {
-  guidl_handler_for_file (gsh, argv[++(*counter)]);
-}
+  gchar *tmp = gsh->usage;
 
+  gsh->usage = g_strconcat (tmp, "\n", key, "\t", descr, NULL);
+  g_free (tmp);
+}
 
-ARTupleVector *
-gsh_define_command_line_options (void)
+static ARTupleVector *
+gsh_define_command_line_options (GSH * gsh)
 {
   ARTupleVector *dictionary;
 
-  if (gsh_options_usage_string == NULL)
-    asprintf (&gsh_options_usage_string, "Usage:  ");
+  if (!(gsh->usage))
+    gsh->usage = g_strdup ("Usage:  ");
 
 #define ARTDEF(key, cb, descr)\
        $(dictionary, add, key, (const gchar *)cb);\
-       asprintf(&gsh_options_usage_string, "%s\n%s\t%s",\
-                       gsh_options_usage_string, key, descr);
+        add_to_usage(gsh, key, descr)
 
   dictionary = ARNEW (ar, ARTupleVector);
 
@@ -152,7 +108,7 @@
   ARTDEF ("-at", gsh_add_entry_cb, "add text entry");
   ARTDEF ("-aT", gsh_add_text_cb, "add text editor");
   ARTDEF ("-aw", gsh_add_window_cb, "add new window");
-  ARTDEF ("-aX", gsh_add_embedded_cb, "add embedded"); // FIXME
+  ARTDEF ("-aX", gsh_add_embedded_cb, "add embedded");
 
   /* Updating widgets */
   ARTDEF ("-aul", gsh_add_updating_label_cb, "add updating label");
@@ -201,11 +157,6 @@
   ARTDEF ("-ds", gsh_dialog_save_cb, "show save dialog");
   ARTDEF ("-dw", gsh_dialog_warning_cb, "show warning dialog");
 
-#ifdef DEBUG
-  /* Test */
-  ARTDEF ("-t", test_cb, "run test code");
-#endif
-
   /* GUIDL file */
   ARTDEF ("-f", guidl_file_cb, "open GUIDL file");
 
@@ -224,13 +175,12 @@
   /* Define command line option dictionary if such has not already
      been done.  */
   if (!(dict = gsh->command_dictionary))
-    dict = gsh->command_dictionary = gsh_define_command_line_options ();
+    dict = gsh->command_dictionary = gsh_define_command_line_options (gsh);
   /* Look up the callback per command line switch.  */
-  callback = (void (*)(GSH *, gint *, const gchar **))
-    $ (dict, find, argv[*counter]);
   /* Execute callback if lookup fruitful.  */
-  if (callback)
+  if ((callback = (void (*)(GSH *, gint *, const gchar **))
+       $ (dict, find, argv[*counter])))
     callback (gsh, counter, argv);
   else                         /* Invalid option, display warning */
-    gsh_invalid_option (argv, *counter);
+    gsh_invalid_option (gsh, argv, *counter);
 }

Index: ptk-app-menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/ptk-app-menu.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ptk-app-menu.c      17 Aug 2010 12:57:12 -0000      1.9
+++ ptk-app-menu.c      17 Aug 2010 19:17:25 -0000      1.10
@@ -39,7 +39,6 @@
 #include <string.h>
 #include <alloca.h>
 #include "gtkshell.h"
-//#include "ptk-app-menu.h"
 
 /* Compatibility macros for older versions of glib */
 #if ! GLIB_CHECK_VERSION(2, 10, 0)
@@ -260,7 +259,7 @@
   char **cat;
   for (cat = cats; *cat; ++cat)
     {
-      register int i = 1;
+      register unsigned int i = 1;
       /* Skip other */
       while (++i < G_N_ELEMENTS (known_cats))
        {
@@ -291,7 +290,8 @@
 find_menu_item_by_name (gpointer a, gpointer name)
 {
   return strcmp (((PtkAppMenuItem *) g_object_get_qdata (G_OBJECT (a), 
-    PTK_APP_MENU_ITEM_ID))->name, (char *) name);
+                                                        
PTK_APP_MENU_ITEM_ID))->
+                name, (char *) name);
 }
 
 static char *
@@ -308,18 +308,20 @@
 
 static void
 on_menu_item_size_request (GtkWidget * item,
-                          GtkRequisition * req, gpointer user_data)
+                          GtkRequisition * req,
+                          gpointer user_data __attribute__ ((unused)))
 {
   const guint8 min_height = ICON_SIZE + (GTK_CONTAINER (item)->border_width +
                                      item->style->ythickness) * 2;
 #define IFLTSET(x, y) if(x<y) x=y
-  IFLTSET(req->height, min_height);
-  IFLTSET(req->width, ICON_SIZE);
+  IFLTSET (req->height, min_height);
+  IFLTSET (req->width, ICON_SIZE);
 }
 
 static bool
 on_menu_item_expose (GtkWidget * item,
-                    GdkEventExpose * evt, gpointer user_data)
+                    GdkEventExpose * evt __attribute__ ((unused)),
+                    gpointer user_data)
 {
   PtkAppMenuItem *data = (PtkAppMenuItem *) user_data;
   if ((!data) 
@@ -327,12 +329,13 @@
       || (gtk_image_menu_item_get_image ((GtkImageMenuItem *) item)))
     return FALSE;
   gtk_image_menu_item_set_image ((GtkImageMenuItem *) item, 
-                                 gsh_get_image(data->icon, ICON_SIZE));
+                                gsh_get_image (data->icon, ICON_SIZE));
   return FALSE;
 }
 
 static void
-on_app_menu_item_activate (GtkMenuItem * item, PtkAppMenuItem * data)
+on_app_menu_item_activate (GtkMenuItem * item __attribute__ ((unused)),
+                          PtkAppMenuItem * data)
 {
   antiright_system (data->exec);
 }
@@ -340,10 +343,10 @@
 static void
 ptk_app_menu_item_free (PtkAppMenuItem * data)
 {
-  g_free (data->name);
-  g_free (data->icon);
-  g_free (data->exec);
+  if (data)
+    {
   g_slice_free (PtkAppMenuItem, data);
+    }
 }
 
 #define SETUP_MENU_ITEM_SIGNALS(menu_item, data)\
@@ -356,7 +359,7 @@
 translate_exec_to_cmd (const char *exec, const char *icon,
                       const char *title, const char *fpath)
 {
-  GString *cmd = g_string_new(NULL);
+  GString *cmd = g_string_new (NULL);
 
   for (; *exec; ++exec)
     {
@@ -395,13 +398,14 @@
            }
        }
       else
-        APPENDC(*exec);
+       APPENDC (*exec);
     }
   return g_string_free (cmd, FALSE);
 }
 
 static PtkAppMenuItem *
-setup_menu_item_label(GList *prev, const char * title, GtkWidget **menu_item)
+setup_menu_item_label (GList * prev, const char *title,
+                      GtkWidget ** menu_item)
 {
   PtkAppMenuItem *data;
 
@@ -427,9 +431,9 @@
 }
 
 static char *
-get_icon(GKeyFile * file)
+get_icon (GKeyFile * file)
 {
-      char * icon = g_strdup (g_key_file_get_string (file,
+  char *icon = g_strdup (g_key_file_get_string (file,
                                              desktop_ent, "Icon", NULL));
       if (icon)
        {
@@ -438,14 +442,14 @@
            *dot = '\0';
        }
       else
-        icon="exec";
+    icon = "exec";
 
       return icon;
 }
 
 static GList *
-setup_with_title (GKeyFile *file, GList * sub_menu, const char *fpath, 
-                  const int prefix_len, const char * exec)
+setup_with_title (GKeyFile * file, GList * sub_menu, const char *fpath,
+                 const int prefix_len, const char *exec)
 {
   char *title = g_key_file_get_locale_string (file, desktop_ent,
                                                    "Name", NULL, NULL);
@@ -457,15 +461,14 @@
 
       prev = g_list_find_custom (sub_menu, (fpath + prefix_len),
                                 (GCompareFunc) find_menu_item_by_name);
-      data=setup_menu_item_label(prev, title, &menu_item);
+      data = setup_menu_item_label (prev, title, &menu_item);
       data->name = g_strdup (fpath + prefix_len);
       data->exec = exec ? translate_exec_to_cmd (exec,
                                                 data->icon, title,
                                                 fpath) : NULL;
-   //   data->exec=g_strdup(exec);
       g_free (title);
       SETUP_MENU_ITEM_SIGNALS (menu_item, data);
-      data->icon = get_icon(file);
+      data->icon = get_icon (file);
       if (!prev)
        {
          GSHCONNECT (menu_item, "activate", on_app_menu_item_activate, data);
@@ -483,13 +486,14 @@
 }
 
 static GList *
-setup_with_exec(GKeyFile * file, GList * sub_menu, const char *fpath, 
+setup_with_exec (GKeyFile * file, GList * sub_menu, const char *fpath,
                 const int prefix_length)
 {
-  char * exec = g_key_file_get_string (file, desktop_ent, "Exec", NULL);
+  char *exec = g_key_file_get_string (file, desktop_ent, "Exec", NULL);
   if (exec)
   {
-    sub_menu=setup_with_title(file, sub_menu, fpath, prefix_length, exec);
+      sub_menu =
+       setup_with_title (file, sub_menu, fpath, prefix_length, exec);
     g_free (exec);
   }
 
@@ -542,7 +546,7 @@
          int i = find_cat (cats);
          if (i >= 0)
            {
-              sub_menus[i]=setup_with_exec(file, sub_menus[i], fpath,
+             sub_menus[i] = setup_with_exec (file, sub_menus[i], fpath,
                         prefix_len);
            }
          g_strfreev (cats);
@@ -560,7 +564,8 @@
 }
 
 static inline void
-on_app_menu_destroy (gpointer user_data, GObject * menu)
+on_app_menu_destroy (gpointer user_data,
+                    GObject * menu __attribute__ ((unused)))
 {
   g_signal_handler_disconnect (gtk_icon_theme_get_default (),
                               GPOINTER_TO_INT (user_data));
@@ -573,10 +578,10 @@
 }
 
 static char *
-get_title(const unsigned int i)
+get_title (const unsigned int i)
 {
-  char * title;
-  GKeyFile * kf;
+  char *title;
+  GKeyFile *kf;
 
   kf = g_key_file_new ();
   title = load_cat_title (kf, (CatInfo *) & known_cats[i]);
@@ -586,10 +591,10 @@
 }
 
 static GtkWidget *
-new_menu_item_with_title(const unsigned int i)
+new_menu_item_with_title (const unsigned int i)
 {
-  char * title = get_title(i);
-  GtkWidget * menu_item 
+  char *title = get_title (i);
+  GtkWidget *menu_item
     = gtk_image_menu_item_new_with_label (title ? title 
                                           : _(known_cats[i].title));
   g_free (title);
@@ -608,7 +613,7 @@
 ptk_app_menu_insert_items (GtkMenu * menu, int position)
 {
   GList *sub_menus[G_N_ELEMENTS (known_cats)] = { 0 };
-  unsigned int i=0;
+  unsigned int i = 0;
   GList *sub_items, *l;
 
   if (G_UNLIKELY (PTK_APP_MENU_ITEM_ID == 0))
@@ -616,7 +621,7 @@
 
   app_dirs_foreach ((GFunc) load_dir, sub_menus);
 
-  while(++i < G_N_ELEMENTS (known_cats))
+  while (++i < G_N_ELEMENTS (known_cats))
     {
       GtkMenu *sub_menu;
       GtkWidget *menu_item;
@@ -630,9 +635,9 @@
        gtk_menu_shell_append (GTK_MENU_SHELL (sub_menu),
                               GTK_WIDGET (l->data));
       g_list_free (sub_items);
-      menu_item=new_menu_item_with_title(i);
+      menu_item = new_menu_item_with_title (i);
 
-      data=alloca(sizeof(PtkAppMenuItem));
+      data = alloca (sizeof (PtkAppMenuItem));
       data->icon = g_strdup (known_cats[i].icon);
       g_object_set_qdata_full (G_OBJECT (menu_item), PTK_APP_MENU_ITEM_ID,
                               data, (GDestroyNotify) ptk_app_menu_item_free);
@@ -641,10 +646,10 @@
       on_menu_item_expose (menu_item, NULL, data);
       gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item),
                                 GTK_WIDGET (sub_menu));
-      if(position>=0)
-        gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menu_item, position);
+      if (position >= 0)
+       gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menu_item, position);
       else
-        GSHCA(menu, menu_item);
+       GSHCA (menu, menu_item);
     }
   gtk_widget_show_all (GTK_WIDGET (menu));
 }
@@ -696,7 +701,7 @@
   GtkWidget *menu_bar;
 
   GSH_SHOW_CREATE (menu_bar, menu_bar);
-  GSHCA(menu_bar, menu_button_item);
+  GSHCA (menu_bar, menu_button_item);
   gtk_container_set_border_width (GTK_CONTAINER (menu_bar), 0);
 
   return menu_bar;
@@ -716,7 +721,9 @@
 }
 
 void
-gsh_add_app_menu_cb (GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_app_menu_cb (GSH * gsh,
+                    gint * counter __attribute__ ((unused)),
+                    const gchar ** argv __attribute__ ((unused)))
 {
   gsh->rows->current++;
   $ (gsh, manage,

Index: ptk-app-menu.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/ptk-app-menu.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ptk-app-menu.h      17 Aug 2010 12:57:12 -0000      1.3
+++ ptk-app-menu.h      17 Aug 2010 19:17:25 -0000      1.4
@@ -24,8 +24,6 @@
 #ifndef PTK_APP_MENU_H
 #define PTK_APP_MENU_H
 
-void 
-gsh_add_app_menu_cb (GSH * gsh, gint * counter, const gchar ** argv);
+void gsh_add_app_menu_cb (GSH * gsh, gint * counter, const gchar ** argv);
 
 #endif
-

Index: row.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- row.c       17 Aug 2010 15:21:47 -0000      1.29
+++ row.c       17 Aug 2010 19:17:25 -0000      1.30
@@ -25,99 +25,73 @@
 #define NEWROW GSH_ADD_WIDGET (this->h, this->v, vbox, FALSE, 2)
 
 static void
-gsh_GSHRows_new (struct GSHRows *this)
+GSHRows_new (struct GSHRows *this)
 {
-//  this->current=(this->v)?0:1;
-  this->current=0;
+  this->current = 0;
   NEWROW;
 }
 
 static void
-gsh_GSHRows_check (struct GSHRows *this)
+GSHRows_check (struct GSHRows *this)
 {
-  if ((this->current >= this->total)||!(this->v))
+  if ((this->current >= this->total) || !(this->v))
     $ (this, new);
 }
 
 static inline void
-delete(struct GSHRows * rows)
+GSHRows_delete (struct GSHRows *rows)
 {
-   gtk_widget_destroy(rows->v);
-   gtk_widget_destroy(rows->h);
-   g_free(rows);
-}
-
-static inline void
-setup_methods (struct GSHRows *rows)
-{
-  rows->delete = (void (*)(struct GSHRows *)) &g_free;
-  rows->new = &gsh_GSHRows_new;
-  rows->check = &gsh_GSHRows_check;
-}
-
-static inline void
-setup_member_fields (struct GSHRows *this)
-{
-/* Use an arbitrary, though reasonable, initial number of rows.  */
-  //rows->current = 1;
-  this->total = 8;
-  GSH_SHOW_CREATE(this->h, hbox, FALSE, 2);
-  NEWROW;
+  gtk_widget_destroy (rows->v);
+  gtk_widget_destroy (rows->h);
+  g_free (rows);
 }
 
 struct GSHRows *
 gsh_new_GSHRows ()
 {
-  struct GSHRows *rows;
+  struct GSHRows *this;
 
-  rows = armalloc (sizeof (struct GSHRows));
-  setup_member_fields (rows);
-  setup_methods (rows);
+  this = armalloc (sizeof (struct GSHRows));
+  /* Use an arbitrary, though reasonable, initial number of rows.  */
+  this->total = 8;
+  GSH_SHOW_CREATE (this->h, hbox, FALSE, 2);
+  NEWROW;
+  /* setup methods */
+  this->delete = &GSHRows_delete;
+  this->new = &GSHRows_new;
+  this->check = &GSHRows_check;
 
-  return rows;
+  return this;
 }
 
-static void
-gsh_manage_generic (struct GSH *gsh, GtkWidget * widget)
+static inline void
+gsh_manage_generic (GSH * gsh, GtkWidget * widget)
 {
   gtk_widget_show (widget);
   gsh->rows->current++;
   gsh->widgets.last_managed = widget;
 }
 
-static bool
-test_manage_menu_item (GtkWidget * container, GtkWidget * widget)
-{
-  if (GTK_IS_MENU (container) || GTK_IS_MENU_BAR (container)
-      || GTK_IS_MENU_ITEM (container))
-    {
-      gtk_menu_shell_append (GTK_MENU_SHELL (container), widget);
-      return TRUE;
-    }
-  else
-    return FALSE;
-}
-
 void
-gsh_manage (struct GSH *gsh, GtkWidget * widget)
+gsh_manage (GSH * gsh, GtkWidget * widget)
 {
-  if (!GSH_FLAG (GSH_PANE_NEXT))
+  if (G_LIKELY (!GSH_FLAG (GSH_PANE_NEXT)))
     {
       struct GSHRows *rows = gsh->rows;
-      GtkWidget *vert = rows->v;
+      GtkWidget *container = rows->v;
 
-      if (test_manage_menu_item (vert, widget))
+      if (GTK_IS_MENU (container) || GTK_IS_MENU_BAR (container)
+         || GTK_IS_MENU_ITEM (container))
+       {
+         gtk_menu_shell_append (GTK_MENU_SHELL (container), widget);
        return;
+       }
       gsh_manage_generic (gsh, widget);
       $ (rows, check);
       if (GSH_FLAG (GSH_NO_EXPAND))
-       {
-         GSHCA_TIGHT (vert, widget);
-       }
+       GSHCA_TIGHT (container, widget);
       else
-       {
-         GSHCA (vert, widget);
-       }
+       GSHCA (container, widget);
     }
   else
     {

Index: terminal.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- terminal.c  17 Aug 2010 12:57:12 -0000      1.37
+++ terminal.c  17 Aug 2010 19:17:25 -0000      1.38
@@ -92,12 +92,12 @@
        {
                gchar *numstr;
 
-               numstr=ar_dtostr(term->dimensions.height);
-               height=g_strconcat("LINES=", numstr, NULL);
-               g_free(numstr);
-               numstr=ar_dtostr(term->dimensions.height);
-               width=g_strconcat("COLUMNS=", numstr, NULL);
-               g_free(numstr); 
+    numstr = ar_dtostr (term->dimensions.height);
+    height = g_strconcat ("LINES=", numstr, NULL);
+    g_free (numstr);
+    numstr = ar_dtostr (term->dimensions.height);
+    width = g_strconcat ("COLUMNS=", numstr, NULL);
+    g_free (numstr);
        }
        
   {
@@ -112,7 +112,8 @@
     /* Start the command in the terminal.  */
 #ifdef HAVE_VTE
        vte_terminal_fork_command (VTE_TERMINAL (term->widget), shell,
-               (char **) argv, (char **) envv, NULL, TRUE, TRUE, TRUE);
+                              (char **) argv, (char **) envv, NULL, TRUE,
+                              TRUE, TRUE);
 #endif /* HAVE_VTE */
   }
   /* Free after use.  */

Index: undo.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- undo.c      16 Aug 2010 11:51:22 -0000      1.7
+++ undo.c      17 Aug 2010 19:17:25 -0000      1.8
@@ -368,8 +368,8 @@
            }
          undo.lists.redo = g_list_append (undo.lists.redo, ui);
          undo.lists.undo = g_list_delete_link (undo.lists.undo,
-                                               g_list_last (undo.lists.
-                                                            undo));
+                                               g_list_last (undo.
+                                                            lists.undo));
          if (g_list_length (undo.lists.undo))
            {
              if (((UndoInfo *) g_list_last (undo.lists.undo)->data)->seq)
@@ -419,8 +419,8 @@
            }
          undo.lists.undo = g_list_append (undo.lists.undo, ri);
          undo.lists.redo = g_list_delete_link (undo.lists.redo,
-                                               g_list_last (undo.lists.
-                                                            redo));
+                                               g_list_last (undo.
+                                                            lists.redo));
          DV (g_print
              ("cb_edit_redo: undo left = %d, " "redo left = %d\n",
               g_list_length (undo.lists.undo),

Index: updated.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- updated.c   16 Aug 2010 11:51:22 -0000      1.23
+++ updated.c   17 Aug 2010 19:17:25 -0000      1.24
@@ -25,7 +25,6 @@
 static void
 gsh_delete_GSHUpdatedWidget (struct GSHUpdatedWidget *item)
 {
-  GSH_FREE_IF (item->command);
   arfree (item);
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]