mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 23:00:22 +02:00
Expand DEFFROM and DEFTO macros in discouraged.c
* discouraged.c: Expand DEFFROM and DEFTO macros, to avoid compiler warnings about excess semicolons. (Reported by Didier Godefroy.)
This commit is contained in:
parent
78aa4a8850
commit
0d185db93e
3 changed files with 125 additions and 23 deletions
1
THANKS
1
THANKS
|
@ -37,6 +37,7 @@ For fixes or providing information which led to a fix:
|
||||||
Charles Gagnon
|
Charles Gagnon
|
||||||
Peter Gavin
|
Peter Gavin
|
||||||
Eric Gillespie, Jr
|
Eric Gillespie, Jr
|
||||||
|
Didier Godefroy
|
||||||
John Goerzen
|
John Goerzen
|
||||||
Mike Gran
|
Mike Gran
|
||||||
Szavai Gyula
|
Szavai Gyula
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2008-05-12 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* discouraged.c: Expand DEFFROM and DEFTO macros, to avoid
|
||||||
|
compiler warnings about excess semicolons. (Reported by Didier
|
||||||
|
Godefroy.)
|
||||||
|
|
||||||
2008-05-08 Neil Jerram <neil@ossau.uklinux.net>
|
2008-05-08 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* throw.c (scm_ithrow): For IA64 add a return statement, to
|
* throw.c (scm_ithrow): For IA64 add a return statement, to
|
||||||
|
|
|
@ -23,33 +23,128 @@
|
||||||
|
|
||||||
#if (SCM_ENABLE_DISCOURAGED == 1)
|
#if (SCM_ENABLE_DISCOURAGED == 1)
|
||||||
|
|
||||||
#define DEFFROM(t,f1,f2) SCM f1(t x) { return f2 (x); }
|
SCM
|
||||||
#define DEFTO(t,f1,f2) t f1(SCM x, unsigned long pos, const char *s_caller) \
|
scm_short2num (short x)
|
||||||
{ return f2 (x); }
|
{
|
||||||
|
return scm_from_short (x);
|
||||||
|
}
|
||||||
|
|
||||||
DEFFROM (short, scm_short2num, scm_from_short);
|
SCM
|
||||||
DEFFROM (unsigned short, scm_ushort2num, scm_from_ushort);
|
scm_ushort2num (unsigned short x)
|
||||||
DEFFROM (int, scm_int2num, scm_from_int);
|
{
|
||||||
DEFFROM (unsigned int, scm_uint2num, scm_from_uint);
|
return scm_from_ushort (x);
|
||||||
DEFFROM (long, scm_long2num, scm_from_long);
|
}
|
||||||
DEFFROM (unsigned long, scm_ulong2num, scm_from_ulong);
|
|
||||||
DEFFROM (size_t, scm_size2num, scm_from_size_t);
|
|
||||||
DEFFROM (ptrdiff_t, scm_ptrdiff2num, scm_from_ssize_t);
|
|
||||||
|
|
||||||
DEFTO (short, scm_num2short, scm_to_short);
|
SCM
|
||||||
DEFTO (unsigned short, scm_num2ushort, scm_to_ushort);
|
scm_int2num (int x)
|
||||||
DEFTO (int, scm_num2int, scm_to_int);
|
{
|
||||||
DEFTO (unsigned int, scm_num2uint, scm_to_uint);
|
return scm_from_int (x);
|
||||||
DEFTO (long, scm_num2long, scm_to_long);
|
}
|
||||||
DEFTO (unsigned long, scm_num2ulong, scm_to_ulong);
|
|
||||||
DEFTO (size_t, scm_num2size, scm_to_size_t);
|
SCM
|
||||||
DEFTO (ptrdiff_t, scm_num2ptrdiff, scm_to_ssize_t);
|
scm_uint2num (unsigned int x)
|
||||||
|
{
|
||||||
|
return scm_from_uint (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
scm_long2num (long x)
|
||||||
|
{
|
||||||
|
return scm_from_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
scm_ulong2num (unsigned long x)
|
||||||
|
{
|
||||||
|
return scm_from_ulong (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
scm_size2num (size_t x)
|
||||||
|
{
|
||||||
|
return scm_from_size_t (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
scm_ptrdiff2num (ptrdiff_t x)
|
||||||
|
{
|
||||||
|
return scm_from_ssize_t (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
short
|
||||||
|
scm_num2short (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_short (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short
|
||||||
|
scm_num2ushort (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_ushort (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
scm_num2int (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_int (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
scm_num2uint (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_uint (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
long
|
||||||
|
scm_num2long (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long
|
||||||
|
scm_num2ulong (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_ulong (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
scm_num2size (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_size_t (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
ptrdiff_t
|
||||||
|
scm_num2ptrdiff (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_ssize_t (x);
|
||||||
|
}
|
||||||
|
|
||||||
#if SCM_SIZEOF_LONG_LONG != 0
|
#if SCM_SIZEOF_LONG_LONG != 0
|
||||||
DEFFROM (long long, scm_long_long2num, scm_from_long_long);
|
|
||||||
DEFFROM (unsigned long long, scm_ulong_long2num, scm_from_ulong_long);
|
SCM
|
||||||
DEFTO (long long, scm_num2long_long, scm_to_long_long);
|
scm_long_long2num (long long x)
|
||||||
DEFTO (unsigned long long, scm_num2ulong_long, scm_to_ulong_long);
|
{
|
||||||
|
return scm_from_long_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
scm_ulong_long2num (unsigned long long x)
|
||||||
|
{
|
||||||
|
return scm_from_ulong_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
long long
|
||||||
|
scm_num2long_long (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_long_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long long
|
||||||
|
scm_num2ulong_long (SCM x, unsigned long pos, const char *s_caller)
|
||||||
|
{
|
||||||
|
return scm_to_ulong_long (x);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue