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

gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-144-ga6cce78)



The branch, master has been updated
       via  a6cce7844d1a1553ec5d39a49ad9426d9ed86417 (commit)
       via  4d62c8dfcb4f062485f033a01e2ff88dbfab1feb (commit)
       via  994c9f2625c01b34759bed81392f5deb6c5e47f5 (commit)
       via  24fb619b41e5548c2433969680ba11f9fa00b4ca (commit)
       via  8aed0ad4e3771067cf98b654ea1b927f3c581291 (commit)
       via  c67055e0619ec803ca76cbe24de2b4289a7fd455 (commit)
       via  30e2f85555b1b6728bbc7c7435ccc426fff69aee (commit)
       via  e0d12f118f80bb403cbaa1f22e1d5f4766a501d4 (commit)
       via  70ea4a4f4c649762ae0990a2708bf18d22b558c7 (commit)
       via  bd53f9e5993d66e0c315ee7fa555f721864db02a (commit)
       via  0de35b4cb726e712961b153cf26fcf5c0ebebc78 (commit)
       via  156c4ac93245aa9075f5134221a06a185d140f3c (commit)
      from  a2caee658af54b32ac3ad88564d8a04822db2fff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/g_hook.c  |   71 ++++++++++++++++++++++++++++++++++++-------------
 gschem/src/g_keys.c  |   13 ++++++++-
 gschem/src/g_rc.c    |   63 +++++++++++++++++++++++++++++++++-----------
 gschem/src/x_menus.c |   39 +++++++++++++++++----------
 4 files changed, 135 insertions(+), 51 deletions(-)


=================
 Commit Messages
=================

commit a6cce7844d1a1553ec5d39a49ad9426d9ed86417
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: get_main_menu: remove use of deprecated SCM_{SYMBOL,STRING}_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 2fe0941... f3d9ea2... M	gschem/src/x_menus.c

commit 4d62c8dfcb4f062485f033a01e2ff88dbfab1feb
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_print_command: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 da375aa... 7177a7e... M	gschem/src/g_rc.c

commit 994c9f2625c01b34759bed81392f5deb6c5e47f5
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_add_menu: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 f34c566... da375aa... M	gschem/src/g_rc.c

commit 24fb619b41e5548c2433969680ba11f9fa00b4ca
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_paper_sizes: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 93a4544... f34c566... M	gschem/src/g_rc.c

commit 8aed0ad4e3771067cf98b654ea1b927f3c581291
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_attribute_name: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 2364e40... 93a4544... M	gschem/src/g_rc.c

commit c67055e0619ec803ca76cbe24de2b4289a7fd455
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_component_dialog_attributes: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 1ac52c4... 2364e40... M	gschem/src/g_rc.c

commit 30e2f85555b1b6728bbc7c7435ccc426fff69aee
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_gschem_version: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 04e8e8d... 1ac52c4... M	gschem/src/g_rc.c

commit e0d12f118f80bb403cbaa1f22e1d5f4766a501d4
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_keys_dump_keymap: remove use of deprecated SCM_{STRING,SYMBOL}_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 36cba14... 8d1d3e3... M	gschem/src/g_keys.c

commit 70ea4a4f4c649762ae0990a2708bf18d22b558c7
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_add_component: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 ca7352a... a061247... M	gschem/src/g_hook.c

commit bd53f9e5993d66e0c315ee7fa555f721864db02a
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_get_object_bounds: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 0b4a671... ca7352a... M	gschem/src/g_hook.c

commit 0de35b4cb726e712961b153cf26fcf5c0ebebc78
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_set_attrib_text_properties: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 e65c6b9... 0b4a671... M	gschem/src/g_hook.c

commit 156c4ac93245aa9075f5134221a06a185d140f3c
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_add_attrib: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 38be4b7... e65c6b9... M	gschem/src/g_hook.c

=========
 Changes
=========

commit a6cce7844d1a1553ec5d39a49ad9426d9ed86417
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: get_main_menu: remove use of deprecated SCM_{SYMBOL,STRING}_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 2fe0941..f3d9ea2 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "config.h"
+#include <missing.h>
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -102,6 +103,7 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
   SCM scm_index;
   SCM scm_keys;
   char *menu_name;
+  char *action_name;
   char **raw_menu_name = g_malloc (sizeof(char *));
   char *menu_item_name;
   char *raw_menu_item_name;
@@ -146,17 +148,9 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
                     scm_is_false (scm_item_stock),
                   scm_item_stock, SCM_ARGn, "get_main_menu stock");
 
-      raw_menu_item_name = SCM_STRING_CHARS (scm_item_name);
-
-      if (scm_is_false (scm_item_hotkey_func))
-        menu_item_hotkey_func = NULL;
-      else
-        menu_item_hotkey_func = SCM_SYMBOL_CHARS (scm_item_hotkey_func);
-
-      if (scm_is_false (scm_item_stock))
-        menu_item_stock = NULL;
-      else
-        menu_item_stock = SCM_SYMBOL_CHARS (scm_item_stock);
+      raw_menu_item_name = scm_to_utf8_string(scm_item_name);
+      scm_dynwind_begin(0);
+      scm_dynwind_free(raw_menu_item_name);
 
       menu_item_name = (char *) gettext(raw_menu_item_name);
 
@@ -165,16 +159,23 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
         gtk_menu_append(GTK_MENU(menu), menu_item);
       } else {
 
+        if (scm_is_false (scm_item_hotkey_func))
+          menu_item_hotkey_func = NULL;
+        else
+          menu_item_hotkey_func = scm_to_utf8_string (scm_symbol_to_string (scm_item_hotkey_func));
+
         if (menu_item_hotkey_func != NULL) {
 
           buf = g_strdup_printf ("(find-key '%s)", menu_item_hotkey_func);
           scm_keys = g_scm_c_eval_string_protected (buf);
           g_free (buf);
+          free(menu_item_hotkey_func);
 
           if (scm_is_false (scm_keys)) {
             menu_item_keys = "";
           } else {
-            menu_item_keys = SCM_STRING_CHARS (scm_keys);
+            menu_item_keys = scm_to_utf8_string (scm_keys);
+            scm_dynwind_free(menu_item_keys);
           }
 
         } else {
@@ -184,11 +185,20 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
         if(scm_is_false (scm_item_func)) {
           menu_item = gtk_menu_item_new_with_mnemonic(menu_item_name);
         } else {
-          action = gschem_action_new (SCM_SYMBOL_CHARS (scm_item_func),  /* Action name */
+          if (scm_is_false (scm_item_stock))
+            menu_item_stock = NULL;
+          else
+            menu_item_stock = scm_to_utf8_string (scm_item_stock);
+
+          action_name = scm_to_utf8_string (scm_symbol_to_string (scm_item_func));
+          action = gschem_action_new (action_name,  /* Action name */
                                       menu_item_name,  /* Text */
                                       menu_item_name,  /* Tooltip */
                                       menu_item_stock, /* Icon stock ID */
                                       menu_item_keys); /* Accelerator string */
+          free(action_name);
+          free(menu_item_stock);
+
           menu_item = gtk_action_create_menu_item (GTK_ACTION (action));
           g_signal_connect (G_OBJECT(action), "activate",
                             G_CALLBACK(g_menu_execute),
@@ -205,7 +215,8 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
       buf = g_strdup_printf("%s/%s", *raw_menu_name, raw_menu_item_name);
       gtk_object_set_data(GTK_OBJECT(menu_bar), buf, menu_item);
       g_free(buf);
-      
+
+      scm_dynwind_end();
     }
     
     menu_name = (char *) gettext(*raw_menu_name);

commit 4d62c8dfcb4f062485f033a01e2ff88dbfab1feb
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_print_command: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index da375aa..7177a7e 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -1482,10 +1482,11 @@ SCM g_rc_print_command(SCM scm_command)
   SCM_ASSERT (scm_is_string (scm_command), scm_command,
               SCM_ARG1, FUNC_NAME);
   
-  command = SCM_STRING_CHARS (scm_command);
+  command = scm_to_utf8_string (scm_command);
 
   g_free (default_print_command);
   default_print_command = g_strdup (command);
+  free (command);
 
   return SCM_BOOL_T;
 }

commit 994c9f2625c01b34759bed81392f5deb6c5e47f5
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_add_menu: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index f34c566..da375aa 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -1090,14 +1090,18 @@ SCM g_rc_sort_component_library(SCM mode)
  *  \par Function Description
  *
  */
-SCM g_rc_add_menu(SCM menu_name, SCM menu_items)
+SCM g_rc_add_menu(SCM scm_menu_name, SCM scm_menu_items)
 {
-  SCM_ASSERT (scm_is_string (menu_name), menu_name,
+  char *menu_name;
+
+  SCM_ASSERT (scm_is_string (scm_menu_name), scm_menu_name,
               SCM_ARG1, "add-menu");
-  SCM_ASSERT (SCM_NIMP (menu_items) && SCM_CONSP (menu_items), menu_items,
+  SCM_ASSERT (SCM_NIMP (scm_menu_items) && SCM_CONSP (scm_menu_items), scm_menu_items,
               SCM_ARG2, "add-menu");
 
-  s_menu_add_entry(SCM_STRING_CHARS (menu_name), menu_items);  
+  menu_name = scm_to_utf8_string (scm_menu_name);
+  s_menu_add_entry(menu_name, scm_menu_items);
+  free (menu_name);
 
   return SCM_BOOL_T;
 }

commit 24fb619b41e5548c2433969680ba11f9fa00b4ca
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_paper_sizes: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 93a4544..f34c566 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -615,7 +615,7 @@ SCM g_rc_paper_sizes(SCM scm_papername, SCM scm_width, SCM scm_height)
   SCM_ASSERT (SCM_NIMP (scm_height) && SCM_REALP (scm_height), scm_height,
               SCM_ARG3, FUNC_NAME);
 
-  papername = SCM_STRING_CHARS (scm_papername);
+  papername = scm_to_utf8_string (scm_papername);
   width  = (int) (scm_to_double (scm_width)  * MILS_PER_INCH);
   height = (int) (scm_to_double (scm_height) * MILS_PER_INCH);
 
@@ -626,6 +626,7 @@ SCM g_rc_paper_sizes(SCM scm_papername, SCM scm_width, SCM scm_height)
     ret = SCM_BOOL_T;
   }
 
+  free(papername);
   return ret;
 }
 #undef FUNC_NAME

commit 8aed0ad4e3771067cf98b654ea1b927f3c581291
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_attribute_name: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 2364e40..93a4544 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -543,7 +543,7 @@ SCM g_rc_attribute_name(SCM scm_path)
   SCM_ASSERT (scm_is_string (scm_path), scm_path,
               SCM_ARG1, "attribute-name");
 
-  path = SCM_STRING_CHARS (scm_path);
+  path = scm_to_utf8_string (scm_path);
 
   /* not unique? */
   if (!s_attrib_uniq(path)) {
@@ -552,7 +552,8 @@ SCM g_rc_attribute_name(SCM scm_path)
     s_attrib_add_entry (path);
     ret = SCM_BOOL_T;
   }
-  
+
+  free(path);
   return ret;
 }
 

commit c67055e0619ec803ca76cbe24de2b4289a7fd455
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_component_dialog_attributes: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 1ac52c4..2364e40 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -369,6 +369,17 @@ SCM g_rc_embed_components(SCM mode)
 		   2);
 }
 
+static void
+free_string_glist(void *data)
+{
+  GList *iter, *glst = *((GList **) data);
+
+  for (iter = glst; iter != NULL; iter = g_list_next (iter)) {
+    g_free (iter->data);
+  }
+  g_list_free (glst);
+}
+
 /*! \brief read the configuration string list for the component dialog
  *  \par Function Description
  *  This function reads the string list from the component-dialog-attributes
@@ -389,15 +400,24 @@ SCM g_rc_component_dialog_attributes(SCM stringlist)
   g_list_foreach(default_component_select_attrlist, (GFunc)g_free, NULL);
   g_list_free(default_component_select_attrlist);
 
+  scm_dynwind_begin(0);
+  scm_dynwind_unwind_handler(free_string_glist, (void *) &list, 0);
+
   /* convert the scm list into a GList */
   for (i=0; i < length; i++) {
-    SCM_ASSERT(scm_is_string(scm_list_ref(stringlist, scm_from_int(i))), 
-	       scm_list_ref(stringlist, scm_from_int(i)), SCM_ARG1, 
-	       "list element is not a string");
-    attr = g_strdup(SCM_STRING_CHARS(scm_list_ref(stringlist, scm_from_int(i))));
+    char *str;
+    SCM elem = scm_list_ref(stringlist, scm_from_int(i));
+
+    SCM_ASSERT(scm_is_string(elem), elem, SCM_ARG1, "list element is not a string");
+
+    str = scm_to_utf8_string(elem);
+    attr = g_strdup(str);
+    free(str);
     list = g_list_prepend(list, attr);
   }
 
+  scm_dynwind_end();
+
   default_component_select_attrlist = g_list_reverse(list);
 
   return SCM_BOOL_T;

commit 30e2f85555b1b6728bbc7c7435ccc426fff69aee
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_rc_gschem_version: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 04e8e8d..1ac52c4 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <config.h>
+#include <missing.h>
 #include <version.h>
 
 #include <stdio.h>
@@ -62,21 +63,23 @@ void g_rc_parse_gtkrc()
  *  \par Function Description
  *
  */
-SCM g_rc_gschem_version(SCM version)
+SCM g_rc_gschem_version(SCM scm_version)
 {
   SCM ret;
+  char *version;
   
-  SCM_ASSERT (scm_is_string (version), version,
+  SCM_ASSERT (scm_is_string (scm_version), scm_version,
               SCM_ARG1, "gschem-version");
 
-  if (g_strcasecmp (SCM_STRING_CHARS (version), PACKAGE_DATE_VERSION) != 0) {
+  version = scm_to_utf8_string (scm_version);
+  if (g_strcasecmp (version, PACKAGE_DATE_VERSION) != 0) {
     fprintf(stderr,
             "You are running gEDA/gaf version [%s%s.%s],\n",
             PREPEND_VERSION_STRING, PACKAGE_DOTTED_VERSION,
             PACKAGE_DATE_VERSION);
     fprintf(stderr,
             "but you have a version [%s] gschemrc file:\n[%s]\n",
-            SCM_STRING_CHARS (version), rc_filename);
+            version, rc_filename);
     fprintf(stderr,
             "Please be sure that you have the latest rc file.\n");
     ret = SCM_BOOL_F;
@@ -84,6 +87,7 @@ SCM g_rc_gschem_version(SCM version)
     ret = SCM_BOOL_T;
   }
 
+  free(version);
   return ret;
 }
 

commit e0d12f118f80bb403cbaa1f22e1d5f4766a501d4
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_keys_dump_keymap: remove use of deprecated SCM_{STRING,SYMBOL}_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c
index 36cba14..8d1d3e3 100644
--- a/gschem/src/g_keys.c
+++ b/gschem/src/g_keys.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <config.h>
+#include <missing.h>
 
 #include <stdio.h>
 #include <sys/stat.h>
@@ -150,12 +151,20 @@ g_keys_dump_keymap (void)
   for (; scm_ret != SCM_EOL; scm_ret = SCM_CDR (scm_ret)) {
     SCM scm_keymap_entry = SCM_CAR (scm_ret);
     struct keyseq_action_t keymap_entry;
+    char *str;
 
     g_return_val_if_fail (SCM_CONSP (scm_keymap_entry) &&
                           scm_is_symbol (SCM_CAR (scm_keymap_entry)) &&
                           scm_is_string (SCM_CDR (scm_keymap_entry)), ret);
-    keymap_entry.action = g_strdup (SCM_SYMBOL_CHARS (SCM_CAR (scm_keymap_entry)));
-    keymap_entry.keyseq = g_strdup (SCM_STRING_CHARS (SCM_CDR (scm_keymap_entry)));
+
+    str = scm_to_utf8_string (scm_symbol_to_string (SCM_CAR (scm_keymap_entry)));
+    keymap_entry.action = g_strdup (str);
+    free(str);
+
+    str = scm_to_utf8_string (SCM_CDR (scm_keymap_entry));
+    keymap_entry.keyseq = g_strdup (str);
+    free(str);
+
     ret = g_array_append_val (ret, keymap_entry);
   }
 

commit 70ea4a4f4c649762ae0990a2708bf18d22b558c7
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_add_component: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index ca7352a..a061247 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -714,12 +714,15 @@ SCM g_add_component(SCM page_smob, SCM scm_comp_name, SCM scm_x, SCM scm_y,
 	       SCM_ARG7, "add-component-at-xy");
 
   /* Get the parameters */
-  comp_name = SCM_STRING_CHARS(scm_comp_name);
   x = scm_to_int(scm_x);
   y = scm_to_int(scm_y);
   angle = scm_to_int(scm_angle);  
   selectable = SCM_NFALSEP(scm_selectable);
   mirror = SCM_NFALSEP(scm_mirror);
+  comp_name = scm_to_utf8_string(scm_comp_name);
+
+  scm_dynwind_begin(0);
+  scm_dynwind_free(comp_name);
 
   SCM_ASSERT (comp_name, scm_comp_name,
 	      SCM_ARG2, "add-component-at-xy");
@@ -735,7 +738,8 @@ SCM g_add_component(SCM page_smob, SCM scm_comp_name, SCM scm_x, SCM scm_y,
   s_page_append_list (toplevel, page,
                       o_complex_promote_attribs (toplevel, new_obj));
   s_page_append (toplevel, page, new_obj);
-  
+
+  scm_dynwind_end();
 
   /* Run the add component hook for the new component */
   if (scm_is_false (scm_hook_empty_p (add_component_object_hook))) {

commit bd53f9e5993d66e0c315ee7fa555f721864db02a
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_get_object_bounds: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 0b4a671..ca7352a 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -527,6 +527,17 @@ static void custom_world_get_object_glist_bounds
   }
 }
 
+static void
+free_string_glist(void *data)
+{
+  GList *iter, *glst = *((GList **) data);
+
+  for (iter = glst; iter != NULL; iter = g_list_next (iter)) {
+    free (iter->data);
+  }
+  g_list_free (glst);
+}
+
 /*! \brief Get the object bounds of the given object, excluding the object
  *  types or the attributes given as parameters.
  *  \par Function Description
@@ -565,25 +576,27 @@ SCM g_get_object_bounds (SCM object_smob, SCM scm_exclude_attribs, SCM scm_exclu
 	      SCM_ARG3, "get-object-bounds");
 
   /* Build the exclude attrib list */
+  scm_dynwind_begin(0);
+  scm_dynwind_unwind_handler(free_string_glist, (void *) &exclude_attrib_list, 0);
+  scm_dynwind_unwind_handler(free_string_glist, (void *) &exclude_obj_type_list, 0);
+
   for (i=0; i <= scm_to_int(scm_length(scm_exclude_attribs))-1; i++) {
-    SCM_ASSERT (scm_is_string(scm_list_ref(scm_exclude_attribs, scm_from_int(i))), 
-		scm_exclude_attribs, 
-		SCM_ARG2, "get-object-bounds"); 
-    exclude_attrib_list = g_list_append(exclude_attrib_list, 
-					SCM_STRING_CHARS(scm_list_ref(scm_exclude_attribs,
-								      scm_from_int(i))));
+    SCM elem = scm_list_ref(scm_exclude_attribs, scm_from_int(i));
+
+    SCM_ASSERT (scm_is_string(elem), scm_exclude_attribs, SCM_ARG2, "get-object-bounds");
+    exclude_attrib_list = g_list_append(exclude_attrib_list, scm_to_utf8_string(elem));
   }
 
   /* Build the exclude object type list */
   for (i=0; i <= scm_to_int(scm_length(scm_exclude_object_type))-1; i++) {
-    SCM_ASSERT (scm_is_string(scm_list_ref(scm_exclude_object_type, scm_from_int(i))), 
-		scm_exclude_object_type, 
-		SCM_ARG3, "get-object-bounds"); 
-    exclude_obj_type_list = g_list_append(exclude_obj_type_list, 
-					SCM_STRING_CHARS(scm_list_ref(scm_exclude_object_type,
-								      scm_from_int(i))));
+    SCM elem = scm_list_ref(scm_exclude_object_type, scm_from_int(i));
+
+    SCM_ASSERT (scm_is_string(elem), scm_exclude_object_type, SCM_ARG3, "get-object-bounds");
+    exclude_obj_type_list = g_list_append(exclude_obj_type_list, scm_to_utf8_string(elem));
   }
 
+  scm_dynwind_end();
+
   /* Get toplevel and o_current. */
   g_get_data_from_object_smob (object_smob, &toplevel, &object);
   

commit 0de35b4cb726e712961b153cf26fcf5c0ebebc78
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_set_attrib_text_properties: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index e65c6b9..0b4a671 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -319,7 +319,7 @@ SCM g_set_attrib_text_properties(SCM attrib_smob, SCM scm_coloridx,
   x = scm_to_int(scm_x);
   y = scm_to_int(scm_y);
   
-  alignment_string = SCM_STRING_CHARS(scm_alignment);
+  alignment_string = scm_to_utf8_string(scm_alignment);
 
   if (strlen(alignment_string) == 0) {
     alignment = -1;
@@ -351,6 +351,9 @@ SCM g_set_attrib_text_properties(SCM attrib_smob, SCM scm_coloridx,
   if (strcmp(alignment_string, "Upper Right") == 0) {
     alignment = 8;
   }
+
+  free(alignment_string);
+
   if (alignment == -2) {
     /* Bad specified */
     SCM_ASSERT (scm_is_string(scm_alignment), scm_alignment,

commit 156c4ac93245aa9075f5134221a06a185d140f3c
Author: Ivan Stankovic <pokemon@xxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: g_add_attrib: remove use of deprecated SCM_STRING_CHARS
    
    Reviewed-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 38be4b7..e65c6b9 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <config.h>
+#include <missing.h>
 #include <stdio.h>
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -153,9 +154,15 @@ SCM g_add_attrib(SCM object, SCM scm_attrib_name,
   SCM_ASSERT (g_get_data_from_object_smob (object, &toplevel, &o_current),
 	      object, SCM_ARG1, "add-attribute-to-object");
 
+  scm_dynwind_begin(0);
+
   /* Get parameters */
-  attrib_name = SCM_STRING_CHARS(scm_attrib_name);
-  attrib_value = SCM_STRING_CHARS(scm_attrib_value);
+  attrib_name = scm_to_utf8_string(scm_attrib_name);
+  scm_dynwind_free(attrib_name);
+
+  attrib_value = scm_to_utf8_string(scm_attrib_value);
+  scm_dynwind_free(attrib_value);
+
   vis = SCM_NFALSEP(scm_vis);
 
   for (i=0; i<=scm_to_int(scm_length(scm_show))-1; i++) {
@@ -167,8 +174,11 @@ SCM g_add_attrib(SCM object, SCM scm_attrib_name,
 	       scm_show,
 	       SCM_ARG5, "add-attribute-to-object"); 
     
-    value = SCM_STRING_CHARS(scm_list_ref(scm_show, scm_from_int(i)));
-    
+    scm_dynwind_begin(0);
+
+    value = scm_to_utf8_string(scm_list_ref(scm_show, scm_from_int(i)));
+    scm_dynwind_free(value);
+
     SCM_ASSERT(value, scm_show,
 	       SCM_ARG5, "add-attribute-to-object"); 
 
@@ -186,6 +196,8 @@ SCM g_add_attrib(SCM object, SCM scm_attrib_name,
     else if (strcasecmp(value, "name") == 0) {
       show |= 2;
     }	  
+
+    scm_dynwind_end();
   }
   /* Show name and value (show = 3) => show=0 for gschem */
   if (show == 3) {
@@ -196,6 +208,7 @@ SCM g_add_attrib(SCM object, SCM scm_attrib_name,
   o_attrib_add_attrib (w_current, newtext, vis, show, o_current);
   g_free(newtext);
 
+  scm_dynwind_end();
   return SCM_BOOL_T;
 
 }




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs