r19078 - gnucash/trunk/src - Bug #615168: scm_c_string_length is the proper spelling now

Christian Stimming cstim at code.gnucash.org
Tue Apr 27 16:46:26 EDT 2010


Author: cstim
Date: 2010-04-27 16:46:25 -0400 (Tue, 27 Apr 2010)
New Revision: 19078
Trac: http://svn.gnucash.org/trac/changeset/19078

Modified:
   gnucash/trunk/src/engine/engine-helpers.c
   gnucash/trunk/src/gnome-utils/dialog-options.c
   gnucash/trunk/src/guile-mappings.h
Log:
Bug #615168: scm_c_string_length is the proper spelling now

Patch by Andy Wingo.

Fix up a couple uses of scm_i_string_length, and add a back-compat shim
for earlier versions.

Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c	2010-04-27 19:41:07 UTC (rev 19077)
+++ gnucash/trunk/src/engine/engine-helpers.c	2010-04-27 20:46:25 UTC (rev 19078)
@@ -136,7 +136,7 @@
     GncGUID 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 @@
     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;
     }

Modified: gnucash/trunk/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-options.c	2010-04-27 19:41:07 UTC (rev 19077)
+++ gnucash/trunk/src/gnome-utils/dialog-options.c	2010-04-27 20:46:25 UTC (rev 19078)
@@ -2266,7 +2266,7 @@
     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

Modified: gnucash/trunk/src/guile-mappings.h
===================================================================
--- gnucash/trunk/src/guile-mappings.h	2010-04-27 19:41:07 UTC (rev 19077)
+++ gnucash/trunk/src/guile-mappings.h	2010-04-27 20:46:25 UTC (rev 19078)
@@ -19,8 +19,7 @@
 
 #include <libguile/version.h> /* for SCM_MAJOR_VERSION etc */
 
-/* Backward-compatibility macros for guile-1.6 for functions which
-   were introduced in libguile-1.8.0 */
+/* Give Guile 1.6 and 1.8 a 2.0-like interface */
 #if (SCM_MAJOR_VERSION == 1) && (SCM_MINOR_VERSION <= 6)
 # define scm_is_bool SCM_BOOLP
 # define scm_is_false SCM_FALSEP
@@ -32,9 +31,10 @@
 # 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 */
 
 #define scm_is_equal(obj1,obj2)	scm_is_true(scm_equal_p(obj1,obj2))



More information about the gnucash-changes mailing list