[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-2-38-g903
From: |
Michael Gran |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-2-38-g90305ce |
Date: |
Fri, 21 Aug 2009 05:54:38 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=90305ce9e429f0381ff79427e71287fdafd4d201
The branch, master has been updated
via 90305ce9e429f0381ff79427e71287fdafd4d201 (commit)
via 832bbc95a239bdd1f07133be2377d485c3f43034 (commit)
from 43d5626ce7b51c6f9c06b3a5fe513003778402c8 (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.
- Log -----------------------------------------------------------------
commit 90305ce9e429f0381ff79427e71287fdafd4d201
Author: Michael Gran <address@hidden>
Date: Thu Aug 20 22:41:12 2009 -0700
Use symbol accessors in scm_gc_mark_dependencies
* libguile/gc-mark.c (scm_gc_mark_dependencies): don't unpack symbols.
Use symbol accessors.
commit 832bbc95a239bdd1f07133be2377d485c3f43034
Author: Michael Gran <address@hidden>
Date: Thu Aug 20 22:40:15 2009 -0700
Use string accessors in scm_basename and scm_dirname
* libguile/filesys.c (basename, dirname): don't unpack strings.
Use string accessor functions.
-----------------------------------------------------------------------
Summary of changes:
libguile/filesys.c | 60 +++++++++++++++++++++++++++++++++------------------
libguile/gc-mark.c | 8 +++---
2 files changed, 43 insertions(+), 25 deletions(-)
diff --git a/libguile/filesys.c b/libguile/filesys.c
index a2db699..c602f67 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1573,31 +1573,39 @@ SCM_DEFINE (scm_dirname, "dirname", 1, 0, 0,
"component, @code{.} is returned.")
#define FUNC_NAME s_scm_dirname
{
- const char *s;
long int i;
unsigned long int len;
SCM_VALIDATE_STRING (1, filename);
- s = scm_i_string_chars (filename);
len = scm_i_string_length (filename);
i = len - 1;
#ifdef __MINGW32__
- while (i >= 0 && (s[i] == '/' || s[i] == '\\')) --i;
- while (i >= 0 && (s[i] != '/' && s[i] != '\\')) --i;
- while (i >= 0 && (s[i] == '/' || s[i] == '\\')) --i;
+ while (i >= 0 && (scm_i_string_ref (filename, i) == '/'
+ || scm_i_string_ref (filename, i) == '\\'))
+ --i;
+ while (i >= 0 && (scm_i_string_ref (filename, i) != '/'
+ && scm_i_string_ref (filename, i) != '\\'))
+ --i;
+ while (i >= 0 && (scm_i_string_ref (filename, i) == '/'
+ || scm_i_string_ref (filename, i) == '\\'))
+ --i;
#else
- while (i >= 0 && s[i] == '/') --i;
- while (i >= 0 && s[i] != '/') --i;
- while (i >= 0 && s[i] == '/') --i;
+ while (i >= 0 && scm_i_string_ref (filename, i) == '/')
+ --i;
+ while (i >= 0 && scm_i_string_ref (filename, i) != '/')
+ --i;
+ while (i >= 0 && scm_i_string_ref (filename, i) == '/')
+ --i;
#endif /* ndef __MINGW32__ */
if (i < 0)
{
#ifdef __MINGW32__
- if (len > 0 && (s[0] == '/' || s[0] == '\\'))
+ if (len > 0 && (scm_i_string_ref (filename, 0) == '/'
+ || scm_i_string_ref (filename, 0) == '\\'))
#else
- if (len > 0 && s[0] == '/')
+ if (len > 0 && scm_i_string_ref (filename, 0) == '/')
#endif /* ndef __MINGW32__ */
return scm_c_substring (filename, 0, 1);
else
@@ -1616,11 +1624,9 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
"@var{basename}, it is removed also.")
#define FUNC_NAME s_scm_basename
{
- const char *f, *s = 0;
int i, j, len, end;
SCM_VALIDATE_STRING (1, filename);
- f = scm_i_string_chars (filename);
len = scm_i_string_length (filename);
if (SCM_UNBNDP (suffix))
@@ -1628,32 +1634,44 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
else
{
SCM_VALIDATE_STRING (2, suffix);
- s = scm_i_string_chars (suffix);
j = scm_i_string_length (suffix) - 1;
}
i = len - 1;
#ifdef __MINGW32__
- while (i >= 0 && (f[i] == '/' || f[i] == '\\')) --i;
+ while (i >= 0 && (scm_i_string_ref (filename, i) == '/'
+ || scm_i_string_ref (filename, i) == '\\'))
+ --i;
#else
- while (i >= 0 && f[i] == '/') --i;
+ while (i >= 0 && scm_i_string_ref (filename, i) == '/')
+ --i;
#endif /* ndef __MINGW32__ */
end = i;
- while (i >= 0 && j >= 0 && f[i] == s[j]) --i, --j;
+ while (i >= 0 && j >= 0
+ && (scm_i_string_ref (filename, i)
+ == scm_i_string_ref (suffix, j)))
+ {
+ --i;
+ --j;
+ }
if (j == -1)
end = i;
#ifdef __MINGW32__
- while (i >= 0 && f[i] != '/' && f[i] != '\\') --i;
+ while (i >= 0 && (scm_i_string_ref (filename, i) != '/'
+ && scm_i_string_ref (filename, i) != '\\'))
+ --i;
#else
- while (i >= 0 && f[i] != '/') --i;
+ while (i >= 0 && scm_i_string_ref (filename, i) != '/')
+ --i;
#endif /* ndef __MINGW32__ */
if (i == end)
{
#ifdef __MINGW32__
- if (len > 0 && (f[0] == '/' || f[0] == '\\'))
+ if (len > 0 && (scm_i_string_ref (filename, 0) == '/'
+ || scm_i_string_ref (filename, 0) == '\\'))
#else
- if (len > 0 && f[0] == '/')
+ if (len > 0 && scm_i_string_ref (filename, 0) == '/')
#endif /* ndef __MINGW32__ */
- return scm_c_substring (filename, 0, 1);
+ return scm_c_substring (filename, 0, 1);
else
return scm_dot_string;
}
diff --git a/libguile/gc-mark.c b/libguile/gc-mark.c
index ccbcdcc..bb307b4 100644
--- a/libguile/gc-mark.c
+++ b/libguile/gc-mark.c
@@ -248,7 +248,6 @@ scm_gc_mark_dependencies (SCM p)
scm_t_bits * vtable_data = (scm_t_bits *) word0;
SCM layout = SCM_PACK (vtable_data [scm_vtable_index_layout]);
long len = scm_i_symbol_length (layout);
- const char *fields_desc = scm_i_symbol_chars (layout);
scm_t_bits *struct_data = (scm_t_bits *) SCM_STRUCT_DATA (ptr);
if (vtable_data[scm_struct_i_flags] & SCM_STRUCTF_ENTITY)
@@ -261,11 +260,12 @@ scm_gc_mark_dependencies (SCM p)
long x;
for (x = 0; x < len - 2; x += 2, ++struct_data)
- if (fields_desc[x] == 'p')
+ if (scm_i_symbol_ref (layout, x) == 'p')
scm_gc_mark (SCM_PACK (*struct_data));
- if (fields_desc[x] == 'p')
+ if (scm_i_symbol_ref (layout, x) == 'p')
{
- if (SCM_LAYOUT_TAILP (fields_desc[x + 1]))
+ scm_t_wchar ch = scm_i_symbol_ref (layout, x+1);
+ if (SCM_LAYOUT_TAILP (ch))
for (x = *struct_data++; x; --x, ++struct_data)
scm_gc_mark (SCM_PACK (*struct_data));
else
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-2-38-g90305ce,
Michael Gran <=