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

* unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of

HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
This commit is contained in:
Rob Browning 2003-03-26 00:01:47 +00:00
parent d3d605bb90
commit 2a5cd898c7

View file

@ -49,6 +49,10 @@
*/ */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@ -116,7 +120,7 @@ scm_uniform_element_size (SCM obj)
result = sizeof (short); result = sizeof (short);
break; break;
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
result = sizeof (long long); result = sizeof (long long);
break; break;
@ -205,7 +209,7 @@ scm_make_uve (long k, SCM prot)
i = sizeof (short) * k; i = sizeof (short) * k;
type = scm_tc7_svect; type = scm_tc7_svect;
} }
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
else if (s == 'l') else if (s == 'l')
{ {
i = sizeof (long long) * k; i = sizeof (long long) * k;
@ -269,7 +273,7 @@ SCM_DEFINE (scm_uniform_vector_length, "uniform-vector-length", 1, 0, 0,
case scm_tc7_dvect: case scm_tc7_dvect:
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
return SCM_MAKINUM (SCM_UVECTOR_LENGTH (v)); return SCM_MAKINUM (SCM_UVECTOR_LENGTH (v));
@ -324,7 +328,7 @@ SCM_DEFINE (scm_array_p, "array?", 1, 1, 0,
protp = SCM_SYMBOLP (prot) protp = SCM_SYMBOLP (prot)
&& (1 == SCM_SYMBOL_LENGTH (prot)) && (1 == SCM_SYMBOL_LENGTH (prot))
&& ('s' == SCM_SYMBOL_CHARS (prot)[0]); && ('s' == SCM_SYMBOL_CHARS (prot)[0]);
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
protp = SCM_SYMBOLP (prot) protp = SCM_SYMBOLP (prot)
&& (1 == SCM_SYMBOL_LENGTH (prot)) && (1 == SCM_SYMBOL_LENGTH (prot))
@ -370,7 +374,7 @@ SCM_DEFINE (scm_array_rank, "array-rank", 1, 0, 0,
case scm_tc7_fvect: case scm_tc7_fvect:
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_dvect: case scm_tc7_dvect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
case scm_tc7_svect: case scm_tc7_svect:
@ -413,7 +417,7 @@ SCM_DEFINE (scm_array_dimensions, "array-dimensions", 1, 0, 0,
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_dvect: case scm_tc7_dvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
return scm_cons (scm_uniform_vector_length (ra), SCM_EOL); return scm_cons (scm_uniform_vector_length (ra), SCM_EOL);
@ -822,7 +826,7 @@ SCM_DEFINE (scm_transpose_array, "transpose-array", 1, 0, 1,
case scm_tc7_dvect: case scm_tc7_dvect:
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
if (SCM_NULLP (args) || !SCM_NULLP (SCM_CDR (args))) if (SCM_NULLP (args) || !SCM_NULLP (SCM_CDR (args)))
@ -939,7 +943,7 @@ SCM_DEFINE (scm_enclose_array, "enclose-array", 1, 0, 1,
case scm_tc7_vector: case scm_tc7_vector:
case scm_tc7_wvect: case scm_tc7_wvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
s->lbnd = 0; s->lbnd = 0;
@ -1057,7 +1061,7 @@ tail:
case scm_tc7_dvect: case scm_tc7_dvect:
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
case scm_tc7_vector: case scm_tc7_vector:
@ -1154,7 +1158,7 @@ SCM_DEFINE (scm_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0,
case scm_tc7_svect: case scm_tc7_svect:
return SCM_MAKINUM (((short *) SCM_CELL_WORD_1 (v))[pos]); return SCM_MAKINUM (((short *) SCM_CELL_WORD_1 (v))[pos]);
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
return scm_long_long2num (((long long *) SCM_CELL_WORD_1 (v))[pos]); return scm_long_long2num (((long long *) SCM_CELL_WORD_1 (v))[pos]);
#endif #endif
@ -1199,7 +1203,7 @@ scm_cvref (SCM v, unsigned long pos, SCM last)
return scm_long2num(((signed long *) SCM_VELTS (v))[pos]); return scm_long2num(((signed long *) SCM_VELTS (v))[pos]);
case scm_tc7_svect: case scm_tc7_svect:
return SCM_MAKINUM (((short *) SCM_CELL_WORD_1 (v))[pos]); return SCM_MAKINUM (((short *) SCM_CELL_WORD_1 (v))[pos]);
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
return scm_long_long2num (((long long *) SCM_CELL_WORD_1 (v))[pos]); return scm_long_long2num (((long long *) SCM_CELL_WORD_1 (v))[pos]);
#endif #endif
@ -1325,7 +1329,7 @@ SCM_DEFINE (scm_array_set_x, "array-set!", 2, 0, 1,
SCM_ASRTGO (SCM_INUMP (obj), badobj); SCM_ASRTGO (SCM_INUMP (obj), badobj);
((short *) SCM_UVECTOR_BASE (v))[pos] = SCM_INUM (obj); ((short *) SCM_UVECTOR_BASE (v))[pos] = SCM_INUM (obj);
break; break;
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
((long long *) SCM_UVECTOR_BASE (v))[pos] ((long long *) SCM_UVECTOR_BASE (v))[pos]
= scm_num2long_long (obj, SCM_ARG2, FUNC_NAME); = scm_num2long_long (obj, SCM_ARG2, FUNC_NAME);
@ -1393,7 +1397,7 @@ SCM_DEFINE (scm_array_contents, "array-contents", 1, 1, 0,
case scm_tc7_dvect: case scm_tc7_dvect:
case scm_tc7_cvect: case scm_tc7_cvect:
case scm_tc7_svect: case scm_tc7_svect:
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
#endif #endif
return ra; return ra;
@ -1543,7 +1547,7 @@ loop:
base = (char *) SCM_UVECTOR_BASE (v); base = (char *) SCM_UVECTOR_BASE (v);
sz = sizeof (short); sz = sizeof (short);
break; break;
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
base = (char *) SCM_UVECTOR_BASE (v); base = (char *) SCM_UVECTOR_BASE (v);
sz = sizeof (long long); sz = sizeof (long long);
@ -1709,7 +1713,7 @@ loop:
base = (char *) SCM_UVECTOR_BASE (v); base = (char *) SCM_UVECTOR_BASE (v);
sz = sizeof (short); sz = sizeof (short);
break; break;
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
base = (char *) SCM_UVECTOR_BASE (v); base = (char *) SCM_UVECTOR_BASE (v);
sz = sizeof (long long); sz = sizeof (long long);
@ -2140,7 +2144,7 @@ SCM_DEFINE (scm_array_to_list, "array->list", 1, 0, 0,
res = scm_cons(scm_short2num (data[k]), res); res = scm_cons(scm_short2num (data[k]), res);
return res; return res;
} }
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
{ {
long long *data = (long long *)SCM_VELTS(v); long long *data = (long long *)SCM_VELTS(v);
@ -2509,7 +2513,7 @@ tail:
case scm_tc7_svect: case scm_tc7_svect:
scm_putc ('h', port); scm_putc ('h', port);
break; break;
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
scm_putc ('l', port); scm_putc ('l', port);
break; break;
@ -2565,7 +2569,7 @@ loop:
return SCM_MAKINUM (-1L); return SCM_MAKINUM (-1L);
case scm_tc7_svect: case scm_tc7_svect:
return scm_str2symbol ("s"); return scm_str2symbol ("s");
#ifdef HAVE_LONG_LONGS #if SCM_SIZEOF_LONG_LONG != 0
case scm_tc7_llvect: case scm_tc7_llvect:
return scm_str2symbol ("l"); return scm_str2symbol ("l");
#endif #endif