diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-09-22 17:17:55 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-09-22 17:17:55 +0000 |
commit | 86c991c2a202c1d06caa5f01ec5d36a07a19bb96 (patch) | |
tree | de2cbc86a2935e2026ffa9deec7cbd564f0d688d | |
parent | c1aef037101d36e33de853041e407593cf32a489 (diff) | |
download | guile-86c991c2a202c1d06caa5f01ec5d36a07a19bb96.tar.gz |
* Replaced SCM_CHARS with SCM_STRING_CHARS or SCM_SYMBOL_CHARS.
-rw-r--r-- | libguile/ChangeLog | 16 | ||||
-rw-r--r-- | libguile/backtrace.c | 8 | ||||
-rw-r--r-- | libguile/environments.c | 10 | ||||
-rw-r--r-- | libguile/gh_data.c | 4 | ||||
-rw-r--r-- | libguile/keywords.c | 2 | ||||
-rw-r--r-- | libguile/ports.c | 2 | ||||
-rw-r--r-- | libguile/posix.c | 2 | ||||
-rw-r--r-- | libguile/print.c | 2 | ||||
-rw-r--r-- | libguile/regex-posix.c | 4 | ||||
-rw-r--r-- | libguile/script.c | 2 | ||||
-rw-r--r-- | libguile/simpos.c | 2 | ||||
-rw-r--r-- | libguile/socket.c | 4 | ||||
-rw-r--r-- | libguile/strings.c | 2 | ||||
-rw-r--r-- | libguile/strop.c | 8 | ||||
-rw-r--r-- | libguile/symbols.c | 2 | ||||
-rw-r--r-- | libguile/unif.c | 6 | ||||
-rw-r--r-- | libguile/validate.h | 4 |
17 files changed, 48 insertions, 32 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8c3e6a1bd..28aaf6e22 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,21 @@ 2000-09-22 Dirk Herrmann <D.Herrmann@tu-bs.de> + * backtrace.c (display_frame_expr), environments.c + (print_observer, print_leaf_environment, print_eval_environment, + print_import_environment, print_export_environment), gh_data.c + (gh_set_substr, gh_symbol2newstr), keywords.c + (scm_make_keyword_from_dash_symbol), ports.c (scm_drain_input), + posix.c (scm_mknod), print.c (scm_iprin1), regexp-posix.c + (scm_regexp_error_msg), script.c (scm_compile_shell_switches), + simpos.c (scm_getenv), socket.c (scm_recv, scm_recvfrom), + strings.c (scm_makfromstr), strop.c (scm_substring_move_x, + scm_substring_fill_x, scm_string_capitalize_x), symbols.c + (scm_symbol_to_string), unif.c (scm_make_uve, scm_array_p), + validate.h (SCM_VALIDATE_STRING_COPY): Use SCM_STRING_CHARS or + SCM_SYMBOL_CHARS instead of SCM_CHARS. + +2000-09-22 Dirk Herrmann <D.Herrmann@tu-bs.de> + * strings.h (SCM_STRING_CHARS): Added, should be used instead of SCM_CHARS whenever the argument is known to be a string. diff --git a/libguile/backtrace.c b/libguile/backtrace.c index ae26dc01d..7a8ee3a47 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -333,16 +333,16 @@ display_frame_expr (char *hdr,SCM exp,char *tlr,int indentation,SCM sport,SCM po string = scm_strport_to_string (sport); /* Remove control characters */ for (i = 0; i < n; ++i) - if (iscntrl (SCM_CHARS (string)[i])) - SCM_CHARS (string)[i] = ' '; + if (iscntrl (SCM_STRING_CHARS (string)[i])) + SCM_STRING_CHARS (string)[i] = ' '; /* Truncate */ if (indentation + n > SCM_BACKTRACE_WIDTH) { n = SCM_BACKTRACE_WIDTH - indentation; - SCM_CHARS (string)[n - 1] = '$'; + SCM_STRING_CHARS (string)[n - 1] = '$'; } - scm_lfwrite (SCM_CHARS (string), n, port); + scm_lfwrite (SCM_STRING_CHARS (string), n, port); } static void diff --git a/libguile/environments.c b/libguile/environments.c index dd5ef17fe..55fd610d3 100644 --- a/libguile/environments.c +++ b/libguile/environments.c @@ -498,7 +498,7 @@ print_observer (SCM type, SCM port, scm_print_state *pstate) SCM base16 = scm_number_to_string (address, SCM_MAKINUM (16)); scm_puts ("#<observer ", port); - scm_puts (SCM_CHARS (base16), port); + scm_puts (SCM_STRING_CHARS (base16), port); scm_puts (">", port); return 1; @@ -994,7 +994,7 @@ print_leaf_environment (SCM type, SCM port, scm_print_state *pstate) SCM base16 = scm_number_to_string (address, SCM_MAKINUM (16)); scm_puts ("#<leaf environment ", port); - scm_puts (SCM_CHARS (base16), port); + scm_puts (SCM_STRING_CHARS (base16), port); scm_puts (">", port); return 1; @@ -1354,7 +1354,7 @@ print_eval_environment (SCM type, SCM port, scm_print_state *pstate) SCM base16 = scm_number_to_string (address, SCM_MAKINUM (16)); scm_puts ("#<eval environment ", port); - scm_puts (SCM_CHARS (base16), port); + scm_puts (SCM_STRING_CHARS (base16), port); scm_puts (">", port); return 1; @@ -1765,7 +1765,7 @@ print_import_environment (SCM type, SCM port, scm_print_state *pstate) SCM base16 = scm_number_to_string (address, SCM_MAKINUM (16)); scm_puts ("#<import environment ", port); - scm_puts (SCM_CHARS (base16), port); + scm_puts (SCM_STRING_CHARS (base16), port); scm_puts (">", port); return 1; @@ -2062,7 +2062,7 @@ print_export_environment (SCM type, SCM port, scm_print_state *pstate) SCM base16 = scm_number_to_string (address, SCM_MAKINUM (16)); scm_puts ("#<export environment ", port); - scm_puts (SCM_CHARS (base16), port); + scm_puts (SCM_STRING_CHARS (base16), port); scm_puts (">", port); return 1; diff --git a/libguile/gh_data.c b/libguile/gh_data.c index d0b164de0..5987ae7f6 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -116,7 +116,7 @@ gh_set_substr (char *src, SCM dst, int start, int len) SCM_ASSERT (SCM_STRINGP (dst), dst, SCM_ARG3, "gh_set_substr"); - dst_ptr = SCM_CHARS (dst); + dst_ptr = SCM_STRING_CHARS (dst); dst_len = SCM_LENGTH (dst); SCM_ASSERT (len >= 0 && (unsigned) len <= dst_len, dst, SCM_ARG4, "gh_set_substr"); @@ -605,7 +605,7 @@ gh_symbol2newstr (SCM sym, int *lenp) ret_str = (char *) scm_must_malloc ((len + 1) * sizeof (char), "gh_symbol2newstr"); /* so we copy tmp_str to ret_str, which is what we will allocate */ - memcpy (ret_str, SCM_CHARS (sym), len); + memcpy (ret_str, SCM_SYMBOL_CHARS (sym), len); /* now make sure we null-terminate it */ ret_str[len] = '\0'; diff --git a/libguile/keywords.c b/libguile/keywords.c index f75042abb..1909148a0 100644 --- a/libguile/keywords.c +++ b/libguile/keywords.c @@ -74,7 +74,7 @@ SCM_DEFINE (scm_make_keyword_from_dash_symbol, "make-keyword-from-dash-symbol", SCM vcell; SCM_ASSERT (SCM_SYMBOLP (symbol) - && ('-' == SCM_CHARS(symbol)[0]), + && ('-' == SCM_SYMBOL_CHARS(symbol)[0]), symbol, SCM_ARG1, FUNC_NAME); SCM_DEFER_INTS; diff --git a/libguile/ports.c b/libguile/ports.c index f70db136e..d6689e55d 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -290,7 +290,7 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0, count += pt->saved_read_end - pt->saved_read_pos; result = scm_makstr (count, 0); - dst = SCM_CHARS (result); + dst = SCM_STRING_CHARS (result); while (pt->read_pos < pt->read_end) *dst++ = *(pt->read_pos++); diff --git a/libguile/posix.c b/libguile/posix.c index 813cda850..107de5522 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1213,7 +1213,7 @@ SCM_DEFINE (scm_mknod, "mknod", 4, 0, 0, SCM_VALIDATE_INUM (4,dev); SCM_COERCE_SUBSTR (path); - p = SCM_CHARS (type); + p = SCM_SYMBOL_CHARS (type); if (strcmp (p, "regular") == 0) ctype = S_IFREG; else if (strcmp (p, "directory") == 0) diff --git a/libguile/print.c b/libguile/print.c index fe7662c04..bcbb1fe32 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -494,7 +494,7 @@ taloop: int mw_pos = 0; len = SCM_LENGTH (exp); - str = SCM_CHARS (exp); + str = SCM_SYMBOL_CHARS (exp); scm_remember (&exp); pos = 0; weird = 0; diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c index 66be0fe1e..4c0b22d03 100644 --- a/libguile/regex-posix.c +++ b/libguile/regex-posix.c @@ -124,14 +124,14 @@ scm_regexp_error_msg (int regerrno, regex_t *rx) errmsg = scm_make_string (SCM_MAKINUM (80), SCM_UNDEFINED); SCM_DEFER_INTS; - l = regerror (regerrno, rx, SCM_CHARS (errmsg), 80); + l = regerror (regerrno, rx, SCM_STRING_CHARS (errmsg), 80); if (l > 80) { errmsg = scm_make_string (SCM_MAKINUM (l), SCM_UNDEFINED); regerror (regerrno, rx, SCM_CHARS (errmsg), l); } SCM_ALLOW_INTS; - return SCM_CHARS (errmsg); + return SCM_STRING_CHARS (errmsg); } SCM_DEFINE (scm_regexp_p, "regexp?", 1, 0, 0, diff --git a/libguile/script.c b/libguile/script.c index e24c89f51..2ab76161e 100644 --- a/libguile/script.c +++ b/libguile/script.c @@ -557,7 +557,7 @@ scm_compile_shell_switches (int argc, char **argv) "certain other uses are permitted as well. For details, see the file\n" "`COPYING', which is included in the Guile distribution.\n" "There is no warranty, to the extent permitted by law.\n", - SCM_CHARS (scm_version ())); + SCM_STRING_CHARS (scm_version ())); exit (0); } diff --git a/libguile/simpos.c b/libguile/simpos.c index b15d6987e..062853ae8 100644 --- a/libguile/simpos.c +++ b/libguile/simpos.c @@ -107,7 +107,7 @@ SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0, char *val; SCM_VALIDATE_ROSTRING (1,nam); nam = scm_makfromstr (SCM_ROCHARS (nam), SCM_ROLENGTH (nam), 0); - val = getenv(SCM_CHARS(nam)); + val = getenv (SCM_STRING_CHARS (nam)); return (val) ? scm_makfromstr(val, (scm_sizet)strlen(val), 0) : SCM_BOOL_F; } #undef FUNC_NAME diff --git a/libguile/socket.c b/libguile/socket.c index 47166e1ca..7bbcd1e52 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -709,7 +709,7 @@ SCM_DEFINE (scm_recv, "recv!", 2, 1, 0, SCM_VALIDATE_INUM_DEF_COPY (3,flags,0,flg); fd = SCM_FPORT_FDES (sock); - SCM_SYSCALL (rv = recv (fd, SCM_CHARS (buf), SCM_LENGTH (buf), flg)); + SCM_SYSCALL (rv = recv (fd, SCM_STRING_CHARS (buf), SCM_LENGTH (buf), flg)); if (rv == -1) SCM_SYSERROR; @@ -807,7 +807,7 @@ SCM_DEFINE (scm_recvfrom, "recvfrom!", 2, 3, 0, fd = SCM_FPORT_FDES (sock); tmp_size = scm_addr_buffer_size; - SCM_SYSCALL (rv = recvfrom (fd, SCM_CHARS (buf) + offset, + SCM_SYSCALL (rv = recvfrom (fd, SCM_STRING_CHARS (buf) + offset, cend - offset, flg, (struct sockaddr *) scm_addr_buffer, &tmp_size)); diff --git a/libguile/strings.c b/libguile/strings.c index 35733e66d..872cdc33b 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -186,7 +186,7 @@ SCM scm_makfromstr (const char *src, scm_sizet len, int dummy) { SCM s = scm_makstr (len, 0); - char *dst = SCM_CHARS (s); + char *dst = SCM_STRING_CHARS (s); while (len--) *dst++ = *src++; diff --git a/libguile/strop.c b/libguile/strop.c index b777c8a7d..4c40c7d36 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -260,8 +260,8 @@ SCM_DEFINE (scm_substring_move_x, "substring-move!", 5, 0, 0, SCM_ASSERT_RANGE (3,end1,e <= SCM_LENGTH (str1) && e >= 0); SCM_ASSERT_RANGE (5,start2,len+s2 <= SCM_LENGTH (str2)); - SCM_SYSCALL(memmove((void *)(&(SCM_CHARS(str2)[s2])), - (void *)(&(SCM_CHARS(str1)[s1])), + SCM_SYSCALL(memmove((void *)(&(SCM_STRING_CHARS(str2)[s2])), + (void *)(&(SCM_STRING_CHARS(str1)[s1])), len)); return scm_return_first(SCM_UNSPECIFIED, str1, str2); @@ -290,7 +290,7 @@ SCM_DEFINE (scm_substring_fill_x, "substring-fill!", 4, 0, 0, SCM_VALIDATE_CHAR_COPY (4,fill,c); SCM_ASSERT_RANGE (2,start,i <= SCM_LENGTH (str) && i >= 0); SCM_ASSERT_RANGE (3,end,e <= SCM_LENGTH (str) && e >= 0); - while (i<e) SCM_CHARS (str)[i++] = c; + while (i<e) SCM_STRING_CHARS (str)[i++] = c; return SCM_UNSPECIFIED; } #undef FUNC_NAME @@ -454,7 +454,7 @@ SCM_DEFINE (scm_string_capitalize_x, "string-capitalize!", 1, 0, 0, int i, len, in_word=0; SCM_VALIDATE_STRING (1,str); len = SCM_LENGTH(str); - sz = SCM_CHARS(str); + sz = SCM_STRING_CHARS (str); for(i=0; i<len; i++) { if(SCM_NFALSEP(scm_char_alphabetic_p(SCM_MAKE_CHAR(sz[i])))) { if(!in_word) { diff --git a/libguile/symbols.c b/libguile/symbols.c index 04cf0c456..956400d9b 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -460,7 +460,7 @@ SCM_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0, #define FUNC_NAME s_scm_symbol_to_string { SCM_VALIDATE_SYMBOL (1, s); - return scm_makfromstr (SCM_CHARS (s), SCM_LENGTH (s), 0); + return scm_makfromstr (SCM_SYMBOL_CHARS (s), SCM_LENGTH (s), 0); } #undef FUNC_NAME diff --git a/libguile/unif.c b/libguile/unif.c index 44cb0c2c8..45b792015 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -183,7 +183,7 @@ scm_make_uve (long k, SCM prot) { char s; - s = SCM_CHARS (prot)[0]; + s = SCM_SYMBOL_CHARS (prot)[0]; if (s == 's') { i = sizeof (short) * k; @@ -306,12 +306,12 @@ SCM_DEFINE (scm_array_p, "array?", 1, 1, 0, case scm_tc7_svect: protp = SCM_SYMBOLP (prot) && (1 == SCM_LENGTH (prot)) - && ('s' == SCM_CHARS (prot)[0]); + && ('s' == SCM_SYMBOL_CHARS (prot)[0]); #ifdef HAVE_LONG_LONGS case scm_tc7_llvect: protp = SCM_SYMBOLP (prot) && (1 == SCM_LENGTH (prot)) - && ('s' == SCM_CHARS (prot)[0]); + && ('s' == SCM_SYMBOL_CHARS (prot)[0]); #endif case scm_tc7_fvect: protp = singp (prot); diff --git a/libguile/validate.h b/libguile/validate.h index 3ddcebe25..178c34781 100644 --- a/libguile/validate.h +++ b/libguile/validate.h @@ -1,4 +1,4 @@ -/* $Id: validate.h,v 1.14 2000-09-03 21:56:03 mdj Exp $ */ +/* $Id: validate.h,v 1.15 2000-09-22 17:17:55 dirk Exp $ */ /* Copyright (C) 1999, 2000 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -156,7 +156,7 @@ #define SCM_VALIDATE_STRING_COPY(pos, str, cvar) \ do { \ SCM_ASSERT (SCM_STRINGP (str), str, pos, FUNC_NAME); \ - cvar = SCM_CHARS(str); \ + cvar = SCM_STRING_CHARS(str); \ } while (0) #define SCM_VALIDATE_RWSTRING(pos, str) \ |