mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
Make scm_strhash's string parameter constant.
This commit is contained in:
parent
7352d0b203
commit
95c9e176a6
3 changed files with 14 additions and 9 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2000-03-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* symbols.h, symbols.c (scm_strhash): Declare the string
|
||||||
|
parameter as constant, since it is not modified.
|
||||||
|
|
||||||
|
* symbols.c (scm_intern_obarray_soft,
|
||||||
|
scm_sysintern0_no_module_lookup): Can now pass constant strings
|
||||||
|
to scm_strhash without need for casting.
|
||||||
|
|
||||||
2000-03-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2000-03-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* vectors.h (SCM_VELTS, SCM_VELTS_AS_STACKITEMS): Don't cast SCM
|
* vectors.h (SCM_VELTS, SCM_VELTS_AS_STACKITEMS): Don't cast SCM
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
scm_strhash (unsigned char *str,scm_sizet len,unsigned long n)
|
scm_strhash (const unsigned char *str, scm_sizet len, unsigned long n)
|
||||||
{
|
{
|
||||||
if (len > 5)
|
if (len > 5)
|
||||||
{
|
{
|
||||||
|
@ -237,16 +237,13 @@ scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,int softness
|
||||||
|
|
||||||
SCM_REDEFER_INTS;
|
SCM_REDEFER_INTS;
|
||||||
|
|
||||||
i = len;
|
|
||||||
tmp = (unsigned char *) name;
|
|
||||||
|
|
||||||
if (obarray == SCM_BOOL_F)
|
if (obarray == SCM_BOOL_F)
|
||||||
{
|
{
|
||||||
scm_hash = scm_strhash (tmp, i, 1019);
|
scm_hash = scm_strhash (name, len, 1019);
|
||||||
goto uninterned_symbol;
|
goto uninterned_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_hash = scm_strhash (tmp, i, SCM_LENGTH(obarray));
|
scm_hash = scm_strhash (name, len, SCM_LENGTH (obarray));
|
||||||
|
|
||||||
/* softness == -1 used to mean that it was known that the symbol
|
/* softness == -1 used to mean that it was known that the symbol
|
||||||
wasn't already in the obarray. I don't think there are any
|
wasn't already in the obarray. I don't think there are any
|
||||||
|
@ -359,8 +356,7 @@ scm_sysintern0_no_module_lookup (const char *name)
|
||||||
{
|
{
|
||||||
SCM lsym;
|
SCM lsym;
|
||||||
scm_sizet len = strlen (name);
|
scm_sizet len = strlen (name);
|
||||||
register unsigned char *tmp = (unsigned char *) name;
|
scm_sizet scm_hash = scm_strhash (name, len, (unsigned long) scm_symhash_dim);
|
||||||
scm_sizet scm_hash = scm_strhash (tmp, len, (unsigned long) scm_symhash_dim);
|
|
||||||
SCM_NEWCELL (lsym);
|
SCM_NEWCELL (lsym);
|
||||||
SCM_SETLENGTH (lsym, (long) len, scm_tc7_ssymbol);
|
SCM_SETLENGTH (lsym, (long) len, scm_tc7_ssymbol);
|
||||||
SCM_SETCHARS (lsym, name);
|
SCM_SETCHARS (lsym, name);
|
||||||
|
|
|
@ -109,7 +109,7 @@ extern int scm_symhash_dim;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern unsigned long scm_strhash (unsigned char *str, scm_sizet len, unsigned long n);
|
extern unsigned long scm_strhash (const unsigned char *str, scm_sizet len, unsigned long n);
|
||||||
extern SCM scm_sym2vcell (SCM sym, SCM thunk, SCM definep);
|
extern SCM scm_sym2vcell (SCM sym, SCM thunk, SCM definep);
|
||||||
extern SCM scm_sym2ovcell_soft (SCM sym, SCM obarray);
|
extern SCM scm_sym2ovcell_soft (SCM sym, SCM obarray);
|
||||||
extern SCM scm_sym2ovcell (SCM sym, SCM obarray);
|
extern SCM scm_sym2ovcell (SCM sym, SCM obarray);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue