1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

* numbers.c (s_bignum): Renamed to s_bignum, and made static.

Libguile should not be exporting random little strings.
* numbers.h (s_bignum): Extern declaration removed.
More const changes from Ken Raeburn.
* numbers.c (scm_s_bignum, fx): Now const.
(scm_logtab, scm_ilentab, s_adjbig): Now static and const.
* numbers.h (scm_s_bignum): Update declaration.
* eval.c (bodycheck): Argument WHAT now points to const.
* snarf.h (SCM_SYNTAX): Name is const.
* eval.c (scm_i_let): Make this globally visible, to avoid dynamic
linking crashes on NetBSD.  (Thanks to Ken Raeburn.)
This commit is contained in:
Jim Blandy 1999-04-17 16:03:32 +00:00
parent cf1b6cc8ca
commit e4755e5c7b
4 changed files with 15 additions and 13 deletions

View file

@ -449,13 +449,13 @@ SCM scm_i_trace;
static void bodycheck SCM_P ((SCM xorig, SCM *bodyloc, char *what)); static void bodycheck SCM_P ((SCM xorig, SCM *bodyloc, const char *what));
static void static void
bodycheck (xorig, bodyloc, what) bodycheck (xorig, bodyloc, what)
SCM xorig; SCM xorig;
SCM *bodyloc; SCM *bodyloc;
char *what; const char *what;
{ {
ASRTSYNTAX (scm_ilength (*bodyloc) >= 1, scm_s_expression); ASRTSYNTAX (scm_ilength (*bodyloc) >= 1, scm_s_expression);
} }
@ -957,7 +957,7 @@ scm_m_letrec (xorig, env)
SCM_SYNTAX(s_let, "let", scm_makmmacro, scm_m_let); SCM_SYNTAX(s_let, "let", scm_makmmacro, scm_m_let);
SCM_SYMBOL(scm_i_let, s_let); SCM_GLOBAL_SYMBOL(scm_i_let, s_let);
SCM SCM
scm_m_let (xorig, env) scm_m_let (xorig, env)

View file

@ -753,7 +753,9 @@ scm_bit_extract (n, start, end)
return SCM_MAKINUM ((SCM_INUM (n) >> start) & ((1L << (end - start)) - 1)); return SCM_MAKINUM ((SCM_INUM (n) >> start) & ((1L << (end - start)) - 1));
} }
char scm_logtab[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; static const char scm_logtab[] = {
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4
};
SCM_PROC (s_logcount, "logcount", 1, 0, 0, scm_logcount); SCM_PROC (s_logcount, "logcount", 1, 0, 0, scm_logcount);
SCM SCM
@ -786,7 +788,9 @@ scm_logcount (n)
return SCM_MAKINUM (c); return SCM_MAKINUM (c);
} }
char scm_ilentab[] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 }; static const char scm_ilentab[] = {
0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4
};
SCM_PROC (s_integer_length, "integer-length", 1, 0, 0, scm_integer_length); SCM_PROC (s_integer_length, "integer-length", 1, 0, 0, scm_integer_length);
SCM SCM
@ -827,7 +831,7 @@ scm_integer_length (n)
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
char scm_s_bignum[] = "bignum"; static const char s_bignum[] = "bignum";
SCM SCM
scm_mkbig (nlen, sign) scm_mkbig (nlen, sign)
@ -837,11 +841,11 @@ scm_mkbig (nlen, sign)
SCM v = nlen; SCM v = nlen;
/* Cast to SCM to avoid signed/unsigned comparison warnings. */ /* Cast to SCM to avoid signed/unsigned comparison warnings. */
if (((v << 16) >> 16) != (SCM) nlen) if (((v << 16) >> 16) != (SCM) nlen)
scm_wta (SCM_MAKINUM (nlen), (char *) SCM_NALLOC, scm_s_bignum); scm_wta (SCM_MAKINUM (nlen), (char *) SCM_NALLOC, s_bignum);
SCM_NEWCELL (v); SCM_NEWCELL (v);
SCM_DEFER_INTS; SCM_DEFER_INTS;
SCM_SETCHARS (v, scm_must_malloc ((long) (nlen * sizeof (SCM_BIGDIG)), SCM_SETCHARS (v, scm_must_malloc ((long) (nlen * sizeof (SCM_BIGDIG)),
scm_s_bignum)); s_bignum));
SCM_SETNUMDIGS (v, nlen, sign ? scm_tc16_bigneg : scm_tc16_bigpos); SCM_SETNUMDIGS (v, nlen, sign ? scm_tc16_bigneg : scm_tc16_bigpos);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return v; return v;
@ -868,7 +872,7 @@ scm_big2inum (b, l)
} }
char s_adjbig[] = "scm_adjbig"; static const char s_adjbig[] = "scm_adjbig";
SCM SCM
scm_adjbig (b, nlen) scm_adjbig (b, nlen)
@ -1521,7 +1525,7 @@ scm_divbigbig (x, nx, y, ny, sgn, modes)
/*** NUMBERS -> STRINGS ***/ /*** NUMBERS -> STRINGS ***/
#ifdef SCM_FLOATS #ifdef SCM_FLOATS
int scm_dblprec; int scm_dblprec;
static double fx[] = static const double fx[] =
{ 0.0, 5e-1, 5e-2, 5e-3, 5e-4, 5e-5, { 0.0, 5e-1, 5e-2, 5e-3, 5e-4, 5e-5,
5e-6, 5e-7, 5e-8, 5e-9, 5e-10, 5e-6, 5e-7, 5e-8, 5e-9, 5e-10,
5e-11, 5e-12, 5e-13, 5e-14, 5e-15, 5e-11, 5e-12, 5e-13, 5e-14, 5e-15,

View file

@ -173,8 +173,6 @@
# define SCM_BIGDN(x) ((x) >> SCM_BITSPERDIG) # define SCM_BIGDN(x) ((x) >> SCM_BITSPERDIG)
# define SCM_BIGLO(x) ((x) & (SCM_BIGRAD-1)) # define SCM_BIGLO(x) ((x) & (SCM_BIGRAD-1))
extern char scm_s_bignum[];
#endif /* def BIGNUMS */ #endif /* def BIGNUMS */
#ifndef SCM_BIGDIG #ifndef SCM_BIGDIG

View file

@ -62,7 +62,7 @@
#ifndef SCM_MAGIC_SNARFER #ifndef SCM_MAGIC_SNARFER
#define SCM_SYNTAX(RANAME, STR, TYPE, CFN) \ #define SCM_SYNTAX(RANAME, STR, TYPE, CFN) \
static char RANAME[]=STR static const char RANAME[]=STR
#else #else
#define SCM_SYNTAX(RANAME, STR, TYPE, CFN) \ #define SCM_SYNTAX(RANAME, STR, TYPE, CFN) \
%%% scm_make_synt (RANAME, TYPE, CFN) %%% scm_make_synt (RANAME, TYPE, CFN)