[PATCH 08/13] scm_c_string_length is the proper spelling now

Andy Wingo wingo at pobox.com
Mon Mar 29 15:22:49 EDT 2010


Fix up a couple uses of scm_i_string_length, and add a back-compat shim
for earlier versions.
---
 src/engine/engine-helpers.c      |    4 ++--
 src/gnome-utils/dialog-options.c |    2 +-
 src/guile-mappings.h             |    4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/engine/engine-helpers.c b/src/engine/engine-helpers.c
index c607781..a4691a1 100644
--- a/src/engine/engine-helpers.c
+++ b/src/engine/engine-helpers.c
@@ -136,7 +136,7 @@ gnc_scm2guid(SCM guid_scm)
     GUID guid;
     const gchar * str;
 
-    if (GUID_ENCODING_LENGTH != scm_i_string_length (guid_scm))
+    if (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm))
     {
         return *guid_null();
     }
@@ -154,7 +154,7 @@ gnc_guid_p(SCM guid_scm)
     if (!scm_is_string(guid_scm))
         return FALSE;
 
-    if (GUID_ENCODING_LENGTH != scm_i_string_length (guid_scm))
+    if (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm))
     {
         return FALSE;
     }
diff --git a/src/gnome-utils/dialog-options.c b/src/gnome-utils/dialog-options.c
index 9e5bb70..02c05e2 100644
--- a/src/gnome-utils/dialog-options.c
+++ b/src/gnome-utils/dialog-options.c
@@ -2266,7 +2266,7 @@ gnc_option_set_ui_value_text (GNCOption *option, gboolean use_default,
     if (scm_is_string(value))
     {
         const gchar *string = scm_to_locale_string(value);
-        gtk_text_buffer_set_text (buffer, string, scm_i_string_length(value));
+        gtk_text_buffer_set_text (buffer, string, scm_c_string_length(value));
         return FALSE;
     }
     else
diff --git a/src/guile-mappings.h b/src/guile-mappings.h
index 4a5c6fe..086b562 100644
--- a/src/guile-mappings.h
+++ b/src/guile-mappings.h
@@ -32,7 +32,9 @@
 # define scm_is_true SCM_NFALSEP
 # define scm_is_vector SCM_VECTORP
 # define scm_to_locale_string SCM_STRING_CHARS
-# define scm_i_string_length SCM_STRING_LENGTH
+# define scm_c_string_length SCM_STRING_LENGTH
+#elif (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 8)
+# define scm_c_string_length scm_i_string_length
 #endif
 
 /* Convenience macros */
-- 
1.6.2.5


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0009-fix-bogus-gnc-safe-strcmp-definition.patch



More information about the gnucash-devel mailing list