]> gitweb.factorcode.org Git - factor.git/commitdiff
renaming types to avoid clashing with win32
authorSlava Pestov <slava@factorcode.org>
Sat, 11 Dec 2004 02:46:42 +0000 (02:46 +0000)
committerSlava Pestov <slava@factorcode.org>
Sat, 11 Dec 2004 02:46:42 +0000 (02:46 +0000)
49 files changed:
native/arithmetic.c
native/array.c
native/array.h
native/bignum.c
native/bignum.h
native/complex.c
native/complex.h
native/cons.c
native/cons.h
native/error.c
native/error.h
native/factor.h
native/ffi.c
native/file.c
native/fixnum.c
native/fixnum.h
native/float.c
native/float.h
native/gc.c
native/image.c
native/io.c
native/io.h
native/port.c
native/port.h
native/ratio.c
native/ratio.h
native/read.c
native/read.h
native/relocate.c
native/run.c
native/run.h
native/s48_bignum.h
native/s48_bignumint.h
native/sbuf.c
native/sbuf.h
native/socket.c
native/socket.h
native/stack.c
native/stack.h
native/string.c
native/string.h
native/types.c
native/types.h
native/vector.c
native/vector.h
native/word.c
native/word.h
native/write.c
native/write.h

index 6c4e36e9d3a7f7c7942009cc34c8c359bcb3a52f..da1243c8896b1c30484e088f7eb1009706aded5e 100644 (file)
@@ -106,9 +106,9 @@ bool zerop(CELL tagged)
        case FIXNUM_TYPE:
                return tagged == 0;
        case BIGNUM_TYPE:
-               return BIGNUM_ZERO_P((ARRAY*)UNTAG(tagged));
+               return BIGNUM_ZERO_P((F_ARRAY*)UNTAG(tagged));
        case FLOAT_TYPE:
-               return ((FLOAT*)UNTAG(tagged))->n == 0.0;
+               return ((F_FLOAT*)UNTAG(tagged))->n == 0.0;
        case RATIO_TYPE:
        case COMPLEX_TYPE:
                return false;
@@ -125,9 +125,9 @@ bool onep(CELL tagged)
        case FIXNUM_TYPE:
                return tagged == tag_fixnum(1);
        case BIGNUM_TYPE:
-               return BIGNUM_ONE_P((ARRAY*)UNTAG(tagged),0);
+               return BIGNUM_ONE_P((F_ARRAY*)UNTAG(tagged),0);
        case FLOAT_TYPE:
-               return ((FLOAT*)UNTAG(tagged))->n == 1.0;
+               return ((F_FLOAT*)UNTAG(tagged))->n == 1.0;
        case RATIO_TYPE:
        case COMPLEX_TYPE:
                return false;
index b0d6e76ada86a497fdd81afbdc9ff1ce605f946b..35faf04bc82e8c97aaa0b872eee4042fc59872e1 100644 (file)
@@ -1,22 +1,22 @@
 #include "factor.h"
 
 /* untagged */
-ARRAY* allot_array(CELL type, FIXNUM capacity)
+F_ARRAY* allot_array(CELL type, F_FIXNUM capacity)
 {
-       ARRAY* array;
+       F_ARRAY* array;
        if(capacity < 0)
                general_error(ERROR_NEGATIVE_ARRAY_SIZE,tag_fixnum(capacity));
-       array = allot_object(type,sizeof(ARRAY) + capacity * CELLS);
+       array = allot_object(type,sizeof(F_ARRAY) + capacity * CELLS);
        array->capacity = capacity;
        return array;
 }
 
 /* untagged */
-ARRAY* array(FIXNUM capacity, CELL fill)
+F_ARRAY* array(F_FIXNUM capacity, CELL fill)
 {
        int i;
 
-       ARRAY* array = allot_array(ARRAY_TYPE, capacity);
+       F_ARRAY* array = allot_array(ARRAY_TYPE, capacity);
 
        for(i = 0; i < capacity; i++)
                put(AREF(array,i),fill);
@@ -24,12 +24,12 @@ ARRAY* array(FIXNUM capacity, CELL fill)
        return array;
 }
 
-ARRAY* grow_array(ARRAY* array, FIXNUM capacity, CELL fill)
+F_ARRAY* grow_array(F_ARRAY* array, F_FIXNUM capacity, CELL fill)
 {
        /* later on, do an optimization: if end of array is here, just grow */
        int i;
 
-       ARRAY* new_array = allot_array(untag_header(array->header),capacity);
+       F_ARRAY* new_array = allot_array(untag_header(array->header),capacity);
 
        memcpy(new_array + 1,array + 1,array->capacity * CELLS);
 
@@ -39,21 +39,21 @@ ARRAY* grow_array(ARRAY* array, FIXNUM capacity, CELL fill)
        return new_array;
 }
 
-ARRAY* shrink_array(ARRAY* array, FIXNUM capacity)
+F_ARRAY* shrink_array(F_ARRAY* array, F_FIXNUM capacity)
 {
-       ARRAY* new_array = allot_array(untag_header(array->header),capacity);
+       F_ARRAY* new_array = allot_array(untag_header(array->header),capacity);
        memcpy(new_array + 1,array + 1,capacity * CELLS);
        return new_array;
 }
 
-void fixup_array(ARRAY* array)
+void fixup_array(F_ARRAY* array)
 {
        int i = 0;
        for(i = 0; i < array->capacity; i++)
                fixup((void*)AREF(array,i));
 }
 
-void collect_array(ARRAY* array)
+void collect_array(F_ARRAY* array)
 {
        int i = 0;
        for(i = 0; i < array->capacity; i++)
index 9f22d805b7976f991f14f2e10ddd347ffa83006d..32618f8bd44db4283f12120db568017f4a6d9daf 100644 (file)
@@ -2,35 +2,35 @@ typedef struct {
        CELL header;
        /* untagged */
        CELL capacity;
-} ARRAY;
+} F_ARRAY;
 
-INLINE ARRAY* untag_array(CELL tagged)
+INLINE F_ARRAY* untag_array(CELL tagged)
 {
        /* type_check(ARRAY_TYPE,tagged); */
-       return (ARRAY*)UNTAG(tagged); /* FIXME */
+       return (F_ARRAY*)UNTAG(tagged); /* FIXME */
 }
 
-ARRAY* allot_array(CELL type, FIXNUM capacity);
-ARRAY* array(FIXNUM capacity, CELL fill);
-ARRAY* grow_array(ARRAY* array, FIXNUM capacity, CELL fill);
-ARRAY* shrink_array(ARRAY* array, FIXNUM capacity);
+F_ARRAY* allot_array(CELL type, F_FIXNUM capacity);
+F_ARRAY* array(F_FIXNUM capacity, CELL fill);
+F_ARRAY* grow_array(F_ARRAY* array, F_FIXNUM capacity, CELL fill);
+F_ARRAY* shrink_array(F_ARRAY* array, F_FIXNUM capacity);
 
-#define AREF(array,index) ((CELL)(array) + sizeof(ARRAY) + (index) * CELLS)
+#define AREF(array,index) ((CELL)(array) + sizeof(F_ARRAY) + (index) * CELLS)
 
-#define ASIZE(pointer) align8(sizeof(ARRAY) + \
-       ((ARRAY*)(pointer))->capacity * CELLS)
+#define ASIZE(pointer) align8(sizeof(F_ARRAY) + \
+       ((F_ARRAY*)(pointer))->capacity * CELLS)
 
 /* untagged & unchecked */
-INLINE CELL array_nth(ARRAY* array, CELL index)
+INLINE CELL array_nth(F_ARRAY* array, CELL index)
 {
        return get(AREF(array,index));
 }
 
 /* untagged & unchecked  */
-INLINE void set_array_nth(ARRAY* array, CELL index, CELL value)
+INLINE void set_array_nth(F_ARRAY* array, CELL index, CELL value)
 {
        put(AREF(array,index),value);
 }
 
-void fixup_array(ARRAY* array);
-void collect_array(ARRAY* array);
+void fixup_array(F_ARRAY* array);
+void collect_array(F_ARRAY* array);
index ffd229573ee2e76ef588a631f7572150c309eddb..2176b112f43d42c0ebb0df99a0c1d427a2127433 100644 (file)
@@ -1,6 +1,6 @@
 #include "factor.h"
 
-FIXNUM to_integer(CELL x)
+F_FIXNUM to_integer(CELL x)
 {
        switch(type_of(x))
        {
@@ -15,7 +15,7 @@ FIXNUM to_integer(CELL x)
 }
 
 /* FFI calls this */
-void box_integer(FIXNUM integer)
+void box_integer(F_FIXNUM integer)
 {
        dpush(tag_integer(integer));
 }
@@ -27,7 +27,7 @@ void box_cell(CELL cell)
 }
 
 /* FFI calls this */
-FIXNUM unbox_integer(void)
+F_FIXNUM unbox_integer(void)
 {
        return to_integer(dpop());
 }
@@ -38,26 +38,26 @@ CELL unbox_cell(void)
        return to_integer(dpop());
 }
 
-ARRAY* to_bignum(CELL tagged)
+F_ARRAY* to_bignum(CELL tagged)
 {
-       RATIO* r;
-       ARRAY* x;
-       ARRAY* y;
-       FLOAT* f;
+       F_RATIO* r;
+       F_ARRAY* x;
+       F_ARRAY* y;
+       F_FLOAT* f;
 
        switch(type_of(tagged))
        {
        case FIXNUM_TYPE:
                return s48_long_to_bignum(untag_fixnum_fast(tagged));
        case BIGNUM_TYPE:
-               return (ARRAY*)UNTAG(tagged);
+               return (F_ARRAY*)UNTAG(tagged);
        case RATIO_TYPE:
-               r = (RATIO*)UNTAG(tagged);
+               r = (F_RATIO*)UNTAG(tagged);
                x = to_bignum(r->numerator);
                y = to_bignum(r->denominator);
                return s48_bignum_quotient(x,y);
        case FLOAT_TYPE:
-               f = (FLOAT*)UNTAG(tagged);
+               f = (F_FLOAT*)UNTAG(tagged);
                return s48_double_to_bignum(f->n);
        default:
                type_error(BIGNUM_TYPE,tagged);
@@ -73,13 +73,13 @@ void primitive_to_bignum(void)
 
 void primitive_bignum_eq(void)
 {
-       ARRAY* y = to_bignum(dpop());
-       ARRAY* x = to_bignum(dpop());
+       F_ARRAY* y = to_bignum(dpop());
+       F_ARRAY* x = to_bignum(dpop());
        box_boolean(s48_bignum_equal_p(x,y));
 }
 
 #define GC_AND_POP_BIGNUMS(x,y) \
-       ARRAY *x, *y; \
+       F_ARRAY *x, *y; \
        maybe_garbage_collection(); \
        y = to_bignum(dpop()); \
        x = to_bignum(dpop());
@@ -118,7 +118,7 @@ void primitive_bignum_divfloat(void)
 
 void primitive_bignum_divmod(void)
 {
-       ARRAY *q, *r;
+       F_ARRAY *q, *r;
        GC_AND_POP_BIGNUMS(x,y);
        s48_bignum_divide(x,y,&q,&r);
        dpush(tag_object(q));
@@ -151,8 +151,8 @@ void primitive_bignum_xor(void)
 
 void primitive_bignum_shift(void)
 {
-       FIXNUM y;
-        ARRAY* x;
+       F_FIXNUM y;
+        F_ARRAY* x;
        maybe_garbage_collection();
        y = to_fixnum(dpop());
        x = to_bignum(dpop());
@@ -161,15 +161,15 @@ void primitive_bignum_shift(void)
 
 void primitive_bignum_less(void)
 {
-       ARRAY* y = to_bignum(dpop());
-       ARRAY* x = to_bignum(dpop());
+       F_ARRAY* y = to_bignum(dpop());
+       F_ARRAY* x = to_bignum(dpop());
        box_boolean(s48_bignum_compare(x,y) == bignum_comparison_less);
 }
 
 void primitive_bignum_lesseq(void)
 {
-       ARRAY* y = to_bignum(dpop());
-       ARRAY* x = to_bignum(dpop());
+       F_ARRAY* y = to_bignum(dpop());
+       F_ARRAY* x = to_bignum(dpop());
 
        switch(s48_bignum_compare(x,y))
        {
@@ -188,15 +188,15 @@ void primitive_bignum_lesseq(void)
 
 void primitive_bignum_greater(void)
 {
-       ARRAY* y = to_bignum(dpop());
-       ARRAY* x = to_bignum(dpop());
+       F_ARRAY* y = to_bignum(dpop());
+       F_ARRAY* x = to_bignum(dpop());
        box_boolean(s48_bignum_compare(x,y) == bignum_comparison_greater);
 }
 
 void primitive_bignum_greatereq(void)
 {
-       ARRAY* y = to_bignum(dpop());
-       ARRAY* x = to_bignum(dpop());
+       F_ARRAY* y = to_bignum(dpop());
+       F_ARRAY* x = to_bignum(dpop());
 
        switch(s48_bignum_compare(x,y))
        {
index 3d58cdfbf7d81a1e559462cc5fe271450b52cdb3..90ac355062db0180501bb09f994971491a1b42ed 100644 (file)
@@ -2,18 +2,18 @@ CELL bignum_zero;
 CELL bignum_pos_one;
 CELL bignum_neg_one;
 
-INLINE ARRAY* untag_bignum(CELL tagged)
+INLINE F_ARRAY* untag_bignum(CELL tagged)
 {
        type_check(BIGNUM_TYPE,tagged);
-       return (ARRAY*)UNTAG(tagged);
+       return (F_ARRAY*)UNTAG(tagged);
 }
 
-FIXNUM to_integer(CELL x);
-void box_integer(FIXNUM integer);
+F_FIXNUM to_integer(CELL x);
+void box_integer(F_FIXNUM integer);
 void box_cell(CELL cell);
-FIXNUM unbox_integer(void);
+F_FIXNUM unbox_integer(void);
 CELL unbox_cell(void);
-ARRAY* to_bignum(CELL tagged);
+F_ARRAY* to_bignum(CELL tagged);
 void primitive_to_bignum(void);
 void primitive_bignum_eq(void);
 void primitive_bignum_add(void);
@@ -35,7 +35,7 @@ void primitive_bignum_not(void);
 void copy_bignum_constants(void);
 CELL three_test(void* x, unsigned char r, unsigned char g, unsigned char b);
 
-INLINE CELL tag_integer(FIXNUM x)
+INLINE CELL tag_integer(F_FIXNUM x)
 {
        if(x < FIXNUM_MIN || x > FIXNUM_MAX)
                return tag_object(s48_long_to_bignum(x));
index 9167a117b5c6e352cae31ba1fbc051aec19fb088..00007759704aef73e95fa463ceef6d1ba8e6ad64 100644 (file)
@@ -57,7 +57,7 @@ void primitive_from_rect(void)
                dpush(real);
        else
        {
-               COMPLEX* complex = allot(sizeof(COMPLEX));
+               F_COMPLEX* complex = allot(sizeof(F_COMPLEX));
                complex->real = real;
                complex->imaginary = imaginary;
                dpush(tag_complex(complex));
index 02f8152f97563987d671c2b92b603c026de87cfd..4fc174e78d1b6176b1b6c92fefe58c70a299189b 100644 (file)
@@ -1,15 +1,15 @@
 typedef struct {
        CELL real;
        CELL imaginary;
-} COMPLEX;
+} F_COMPLEX;
 
-INLINE COMPLEX* untag_complex(CELL tagged)
+INLINE F_COMPLEX* untag_complex(CELL tagged)
 {
        type_check(COMPLEX_TYPE,tagged);
-       return (COMPLEX*)UNTAG(tagged);
+       return (F_COMPLEX*)UNTAG(tagged);
 }
 
-INLINE CELL tag_complex(COMPLEX* complex)
+INLINE CELL tag_complex(F_COMPLEX* complex)
 {
        return RETAG(complex,COMPLEX_TYPE);
 }
index 01c45df7db039f56446add3169b0ddaefa9c11f5..690cd810d41cba6fa878661870c9cddae34ef85c 100644 (file)
@@ -2,7 +2,7 @@
 
 CELL cons(CELL car, CELL cdr)
 {
-       CONS* cons = allot(sizeof(CONS));
+       F_CONS* cons = allot(sizeof(F_CONS));
        cons->car = car;
        cons->cdr = cdr;
        return tag_cons(cons);
index ee0028db05502bd70f777d14312934eeb7aafb5d..6b7730bdbca3140e10bb0066bbb05cdaa9b850ca 100644 (file)
@@ -1,15 +1,15 @@
 typedef struct {
        CELL car;
        CELL cdr;
-} CONS;
+} F_CONS;
 
-INLINE CONS* untag_cons(CELL tagged)
+INLINE F_CONS* untag_cons(CELL tagged)
 {
        type_check(CONS_TYPE,tagged);
-       return (CONS*)UNTAG(tagged);
+       return (F_CONS*)UNTAG(tagged);
 }
 
-INLINE CELL tag_cons(CONS* cons)
+INLINE CELL tag_cons(F_CONS* cons)
 {
        return RETAG(cons,CONS_TYPE);
 }
index b4d494b5d31067aecc582d99448c24142f979d0d..acc551e5c23860e8f236191ead73d225548ec7c6 100644 (file)
@@ -74,7 +74,7 @@ void type_error(CELL type, CELL tagged)
        general_error(ERROR_TYPE,c);
 }
 
-void range_error(CELL tagged, FIXNUM index, CELL max)
+void range_error(CELL tagged, F_FIXNUM index, CELL max)
 {
        CELL c = cons(tagged,cons(tag_integer(index),cons(tag_cell(max),F)));
        general_error(ERROR_RANGE,c);
index 89d83cd4646deddc8474ebb1ef14f6e2809b7f24..5f7a2994687b18c21be698b6cc2172d765b8505a 100644 (file)
@@ -31,4 +31,4 @@ void general_error(CELL error, CELL tagged);
 void signal_error(int signal);
 void type_error(CELL type, CELL tagged);
 void primitive_throw(void);
-void range_error(CELL tagged, FIXNUM index, CELL max);
+void range_error(CELL tagged, F_FIXNUM index, CELL max);
index f0216e4ef402d2fcad48b590deb61de7391ba24d..c41d199937dda07b5eeebe8ede777fa476860f44 100644 (file)
@@ -84,7 +84,7 @@ CELL cs;
 #define FIXNUM_MAX (LONG_MAX >> TAG_BITS)
 #define FIXNUM_MIN (LONG_MIN >> TAG_BITS)
 
-#define FIXNUM long int /* unboxed */
+#define F_FIXNUM long int /* unboxed */
 
 #define WORD_SIZE (CELLS*8)
 #define HALF_WORD_SIZE (CELLS*4)
index dd2742d44ee37cef6b74a6daeb250f3d1352d004..10e472b02b887548d798ce3136c55a63d077f88f 100644 (file)
@@ -97,7 +97,7 @@ void box_alien(CELL ptr)
 
 INLINE CELL alien_pointer(void)
 {
-       FIXNUM offset = unbox_integer();
+       F_FIXNUM offset = unbox_integer();
        ALIEN* alien = untag_alien(dpop());
        CELL ptr = alien->ptr;
 
@@ -124,11 +124,11 @@ void primitive_local_alien(void)
 #ifdef FFI
        CELL length = unbox_integer();
        ALIEN* alien;
-       STRING* local;
+       F_STRING* local;
        maybe_garbage_collection();
        alien = allot_object(ALIEN_TYPE,sizeof(ALIEN));
        local = string(length / CHARS,'\0');
-       alien->ptr = (CELL)local + sizeof(STRING);
+       alien->ptr = (CELL)local + sizeof(F_STRING);
        alien->local = true;
        dpush(tag_object(alien));
 #else
@@ -232,8 +232,8 @@ void collect_alien(ALIEN* alien)
 {
        if(alien->local && alien->ptr != NULL)
        {
-               STRING* ptr = (STRING*)(alien->ptr - sizeof(STRING));
+               F_STRING* ptr = (F_STRING*)(alien->ptr - sizeof(F_STRING));
                ptr = copy_untagged_object(ptr,SSIZE(ptr));
-               alien->ptr = (CELL)ptr + sizeof(STRING);
+               alien->ptr = (CELL)ptr + sizeof(F_STRING);
        }
 }
index b5f5153a914b285e0e7a0741ebb8c9d261e68b9a..9f7f58579a6d45a67345c447d1dedd142c52ff84 100644 (file)
@@ -32,7 +32,7 @@ void primitive_open_file(void)
 void primitive_stat(void)
 {
        struct stat sb;
-       STRING* path;
+       F_STRING* path;
 
        maybe_garbage_collection();
 
@@ -58,7 +58,7 @@ void primitive_stat(void)
 
 void primitive_read_dir(void)
 {
-       STRING* path;
+       F_STRING* path;
        DIR* dir;
        CELL result = F;
 
index a5c7824762a69ed5fd697e3643a3e62052bba29d..d14109497e78a62c8add0ad416a630b89f32724b 100644 (file)
@@ -1,26 +1,26 @@
 #include "factor.h"
 
-FIXNUM to_fixnum(CELL tagged)
+F_FIXNUM to_fixnum(CELL tagged)
 {
-       RATIO* r;
-       ARRAY* x;
-       ARRAY* y;
-       FLOAT* f;
+       F_RATIO* r;
+       F_ARRAY* x;
+       F_ARRAY* y;
+       F_FLOAT* f;
 
        switch(type_of(tagged))
        {
        case FIXNUM_TYPE:
                return untag_fixnum_fast(tagged);
        case BIGNUM_TYPE:
-               return (FIXNUM)s48_bignum_to_long((ARRAY*)UNTAG(tagged));
+               return (F_FIXNUM)s48_bignum_to_long((F_ARRAY*)UNTAG(tagged));
        case RATIO_TYPE:
-               r = (RATIO*)UNTAG(tagged);
+               r = (F_RATIO*)UNTAG(tagged);
                x = to_bignum(r->numerator);
                y = to_bignum(r->denominator);
                return to_fixnum(tag_object(s48_bignum_quotient(x,y)));
        case FLOAT_TYPE:
-               f = (FLOAT*)UNTAG(tagged);
-               return (FIXNUM)f->n;
+               f = (F_FLOAT*)UNTAG(tagged);
+               return (F_FIXNUM)f->n;
        default:
                type_error(FIXNUM_TYPE,tagged);
                return -1; /* can't happen */
@@ -34,22 +34,22 @@ void primitive_to_fixnum(void)
 
 void primitive_fixnum_eq(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_boolean(x == y);
 }
 
 void primitive_fixnum_add(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_integer(x + y);
 }
 
 void primitive_fixnum_subtract(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_integer(x - y);
 }
 
@@ -59,14 +59,14 @@ void primitive_fixnum_subtract(void)
  */
 void primitive_fixnum_multiply(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
 
        if(x == 0 || y == 0)
                dpush(tag_fixnum(0));
        else
        {
-               FIXNUM prod = x * y;
+               F_FIXNUM prod = x * y;
                /* if this is not equal, we have overflow */
                if(prod / x == y)
                        box_integer(prod);
@@ -82,51 +82,51 @@ void primitive_fixnum_multiply(void)
 
 void primitive_fixnum_divint(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_integer(x / y);
 }
 
 void primitive_fixnum_divfloat(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        dpush(tag_object(make_float((double)x / (double)y)));
 }
 
 void primitive_fixnum_divmod(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_integer(x / y);
        box_integer(x % y);
 }
 
 void primitive_fixnum_mod(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        dpush(tag_fixnum(x % y));
 }
 
 void primitive_fixnum_and(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        dpush(tag_fixnum(x & y));
 }
 
 void primitive_fixnum_or(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        dpush(tag_fixnum(x | y));
 }
 
 void primitive_fixnum_xor(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        dpush(tag_fixnum(x ^ y));
 }
 
@@ -137,8 +137,8 @@ void primitive_fixnum_xor(void)
  */
 void primitive_fixnum_shift(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
 
        if(y < 0)
        {
@@ -155,7 +155,7 @@ void primitive_fixnum_shift(void)
        }
        else if(y < WORD_SIZE - TAG_BITS)
        {
-               FIXNUM mask = (1 << (WORD_SIZE - 1 - TAG_BITS - y));
+               F_FIXNUM mask = (1 << (WORD_SIZE - 1 - TAG_BITS - y));
                if(x > 0)
                        mask = -mask;
 
@@ -172,29 +172,29 @@ void primitive_fixnum_shift(void)
 
 void primitive_fixnum_less(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_boolean(x < y);
 }
 
 void primitive_fixnum_lesseq(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_boolean(x <= y);
 }
 
 void primitive_fixnum_greater(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_boolean(x > y);
 }
 
 void primitive_fixnum_greatereq(void)
 {
-       FIXNUM y = untag_fixnum_fast(dpop());
-       FIXNUM x = untag_fixnum_fast(dpop());
+       F_FIXNUM y = untag_fixnum_fast(dpop());
+       F_FIXNUM x = untag_fixnum_fast(dpop());
        box_boolean(x >= y);
 }
 
index 08e84998f6947741059dbb1a290eb19f53b7ef2f..903ed07f085c97bd90383ded1ad5301fb0f2a5a8 100644 (file)
@@ -1,14 +1,14 @@
-INLINE FIXNUM untag_fixnum_fast(CELL tagged)
+INLINE F_FIXNUM untag_fixnum_fast(CELL tagged)
 {
-       return ((FIXNUM)tagged) >> TAG_BITS;
+       return ((F_FIXNUM)tagged) >> TAG_BITS;
 }
 
-INLINE CELL tag_fixnum(FIXNUM untagged)
+INLINE CELL tag_fixnum(F_FIXNUM untagged)
 {
        return RETAG(untagged << TAG_BITS,FIXNUM_TYPE);
 }
 
-FIXNUM to_fixnum(CELL tagged);
+F_FIXNUM to_fixnum(CELL tagged);
 void primitive_to_fixnum(void);
 
 void primitive_fixnum_eq(void);
index 31ee45c0d551ad007729254d179fe7facb20ee61..f1e6fe17c4459b716d9c5fc3563ed25385cea56a 100644 (file)
@@ -2,7 +2,7 @@
 
 double to_float(CELL tagged)
 {
-       RATIO* r;
+       F_RATIO* r;
        double x;
        double y;
 
@@ -11,14 +11,14 @@ double to_float(CELL tagged)
        case FIXNUM_TYPE:
                return (double)untag_fixnum_fast(tagged);
        case BIGNUM_TYPE:
-               return s48_bignum_to_double((ARRAY*)UNTAG(tagged));
+               return s48_bignum_to_double((F_ARRAY*)UNTAG(tagged));
        case RATIO_TYPE:
-               r = (RATIO*)UNTAG(tagged);
+               r = (F_RATIO*)UNTAG(tagged);
                x = to_float(r->numerator);
                y = to_float(r->denominator);
                return x / y;
        case FLOAT_TYPE:
-               return ((FLOAT*)UNTAG(tagged))->n;
+               return ((F_FLOAT*)UNTAG(tagged))->n;
        default:
                type_error(FLOAT_TYPE,tagged);
                return 0.0; /* can't happen */
@@ -33,7 +33,7 @@ void primitive_to_float(void)
 
 void primitive_str_to_float(void)
 {
-       STRING* str;
+       F_STRING* str;
        char *c_str, *end;
        double f;
 
index 01bb17cd3a564ad399d2fb32769ee3d8e820da25..c643be6380ca7bb58ef83ee4d2e3210b5baaed8b 100644 (file)
@@ -1,18 +1,18 @@
 typedef struct {
        CELL header;
        double n;
-} FLOAT;
+} F_FLOAT;
 
-INLINE FLOAT* make_float(double n)
+INLINE F_FLOAT* make_float(double n)
 {
-       FLOAT* flo = allot_object(FLOAT_TYPE,sizeof(FLOAT));
+       F_FLOAT* flo = allot_object(FLOAT_TYPE,sizeof(F_FLOAT));
        flo->n = n;
        return flo;
 }
 
 INLINE double untag_float_fast(CELL tagged)
 {
-       return ((FLOAT*)UNTAG(tagged))->n;
+       return ((F_FLOAT*)UNTAG(tagged))->n;
 }
 
 INLINE double untag_float(CELL tagged)
index a66b049e9275eaacd2daa918b18de25b604130db..35b030a74472f5fd32863266abc9b47f3270c20e 100644 (file)
@@ -63,19 +63,19 @@ void collect_object(void)
        switch(untag_header(get(scan)))
        {
        case WORD_TYPE:
-               collect_word((WORD*)scan);
+               collect_word((F_WORD*)scan);
                break;
        case ARRAY_TYPE:
-               collect_array((ARRAY*)scan);
+               collect_array((F_ARRAY*)scan);
                break;
        case VECTOR_TYPE:
-               collect_vector((VECTOR*)scan);
+               collect_vector((F_VECTOR*)scan);
                break;
        case SBUF_TYPE:
-               collect_sbuf((SBUF*)scan);
+               collect_sbuf((F_SBUF*)scan);
                break;
        case PORT_TYPE:
-               collect_port((PORT*)scan);
+               collect_port((F_PORT*)scan);
                break;
        }
        
index f526352ed86fbc2671f555d21c6ef22ea2d052ba..f76e3ac1ebcd168c977360bf35357a26bb25d58a 100644 (file)
@@ -72,6 +72,6 @@ bool save_image(char* filename)
 
 void primitive_save_image(void)
 {
-       STRING* filename = untag_string(dpop());
+       F_STRING* filename = untag_string(dpop());
        save_image(to_c_string(filename));
 }
index 66646ae93f8f2fc21874cf72b2f5885b6c02b430..584616323b2f08826ca77b8a9a62156d0daae704 100644 (file)
@@ -52,7 +52,7 @@ IO_TASK* add_io_task(
 }
 
 void remove_io_task(
-       PORT* port,
+       F_PORT* port,
        IO_TASK* io_tasks,
        int* fd_count)
 {
@@ -66,7 +66,7 @@ void remove_io_task(
                *fd_count = *fd_count - 1;
 }
 
-bool perform_copy_from_io_task(PORT* port, PORT* other_port)
+bool perform_copy_from_io_task(F_PORT* port, F_PORT* other_port)
 {
        if(port->buf_fill == 0)
        {
@@ -91,7 +91,7 @@ bool perform_copy_from_io_task(PORT* port, PORT* other_port)
        return false;
 }
 
-bool perform_copy_to_io_task(PORT* port, PORT* other_port)
+bool perform_copy_to_io_task(F_PORT* port, F_PORT* other_port)
 {
        bool success = perform_write_io_task(port);
        /* only return 'true' if the COPY_FROM task is done also. */
@@ -140,12 +140,12 @@ bool set_up_fd_set(fd_set* fdset, int fd_count, IO_TASK* io_tasks,
 
 CELL pop_io_task_callback(
        IO_TASK_TYPE type,
-       PORT* port,
+       F_PORT* port,
        IO_TASK* io_tasks,
        int* fd_count)
 {
        int fd = port->fd;
-       CONS* callbacks = untag_cons(io_tasks[fd].callbacks);
+       F_CONS* callbacks = untag_cons(io_tasks[fd].callbacks);
        CELL callback = callbacks->car;
        if(callbacks->cdr == F)
                remove_io_task(port,io_tasks,fd_count);
@@ -157,7 +157,7 @@ CELL pop_io_task_callback(
 CELL perform_io_task(IO_TASK* io_task, IO_TASK* io_tasks, int* fd_count)
 {
        bool success;
-       PORT* port = untag_port(io_task->port);
+       F_PORT* port = untag_port(io_task->port);
 
        switch(io_task->type)
        {
@@ -207,7 +207,7 @@ CELL perform_io_tasks(fd_set* fdset, IO_TASK* io_tasks, int* fd_count)
 
                if(typep(PORT_TYPE,io_task.port))
                {
-                       PORT* port = untag_port(io_task.port);
+                       F_PORT* port = untag_port(io_task.port);
                        if(port->closed)
                        {
                                return pop_io_task_callback(
@@ -276,7 +276,7 @@ void primitive_next_io_task(void)
 void primitive_close(void)
 {
        /* This does not flush. */
-       PORT* port = untag_port(dpop());
+       F_PORT* port = untag_port(dpop());
        close(port->fd);
        port->closed = true;
 }
index db87b6a9ab004d6da479ecd6e7201cccd5fda165..43a90899bf1f8be25fbd0c5c3925b00f8d4e38e5 100644 (file)
@@ -39,16 +39,16 @@ IO_TASK* add_io_task(
        IO_TASK* io_tasks,
        int* fd_count);
 void remove_io_task(
-       PORT* port,
+       F_PORT* port,
        IO_TASK* io_tasks,
        int* fd_count);
-void remove_io_tasks(PORT* port);
-bool perform_copy_from_io_task(PORT* port, PORT* other_port);
-bool perform_copy_to_io_task(PORT* port, PORT* other_port);
+void remove_io_tasks(F_PORT* port);
+bool perform_copy_from_io_task(F_PORT* port, F_PORT* other_port);
+bool perform_copy_to_io_task(F_PORT* port, F_PORT* other_port);
 void primitive_add_copy_io_task(void);
 CELL pop_io_task_callback(
        IO_TASK_TYPE type,
-       PORT* port,
+       F_PORT* port,
        IO_TASK* io_tasks,
        int* fd_count);
 bool set_up_fd_set(fd_set* fdset, int fd_count, IO_TASK* io_tasks,
index 59e72d5f25ea732643af275dd185e69bcaf789fc..0c871b194db641bcb3862156077ac2a750501565 100644 (file)
@@ -1,10 +1,10 @@
 #include "factor.h"
 
-PORT* untag_port(CELL tagged)
+F_PORT* untag_port(CELL tagged)
 {
-       PORT* p;
+       F_PORT* p;
        type_check(PORT_TYPE,tagged);
-       p = (PORT*)UNTAG(tagged);
+       p = (F_PORT*)UNTAG(tagged);
        /* after image load & save, ports are no longer valid */
        if(p->fd == -1)
                general_error(ERROR_EXPIRED,tagged);
@@ -13,9 +13,9 @@ PORT* untag_port(CELL tagged)
        return p;
 }
 
-PORT* port(PORT_MODE type, CELL fd)
+F_PORT* port(PORT_MODE type, CELL fd)
 {
-       PORT* port = allot_object(PORT_TYPE,sizeof(PORT));
+       F_PORT* port = allot_object(PORT_TYPE,sizeof(F_PORT));
        port->type = type;
        port->closed = false;
        port->fd = fd;
@@ -39,13 +39,13 @@ PORT* port(PORT_MODE type, CELL fd)
        return port;
 }
 
-void init_line_buffer(PORT* port, FIXNUM count)
+void init_line_buffer(F_PORT* port, F_FIXNUM count)
 {
        if(port->line == F)
                port->line = tag_object(sbuf(LINE_SIZE));
 }
 
-void fixup_port(PORT* port)
+void fixup_port(F_PORT* port)
 {
        port->fd = -1;
        fixup(&port->buffer);
@@ -55,7 +55,7 @@ void fixup_port(PORT* port)
        fixup(&port->io_error);
 }
 
-void collect_port(PORT* port)
+void collect_port(F_PORT* port)
 {
        copy_object(&port->buffer);
        copy_object(&port->line);
@@ -66,13 +66,13 @@ void collect_port(PORT* port)
 
 CELL make_io_error(const char* func)
 {
-       STRING* function = from_c_string(func);
-       STRING* error = from_c_string(strerror(errno));
+       F_STRING* function = from_c_string(func);
+       F_STRING* error = from_c_string(strerror(errno));
 
        return cons(tag_object(function),cons(tag_object(error),F));
 }
 
-void postpone_io_error(PORT* port, const char* func)
+void postpone_io_error(F_PORT* port, const char* func)
 {
        port->io_error = make_io_error(func);
 }
@@ -82,7 +82,7 @@ void io_error(const char* func)
        general_error(ERROR_IO,make_io_error(func));
 }
 
-void pending_io_error(PORT* port)
+void pending_io_error(F_PORT* port)
 {
        CELL io_error = port->io_error;
        if(io_error != F)
index 6a57cd8e1d004c339ed074a0e5ef1042290ba7a9..b398f7c69bbde23a211dbb1361107708f3051217 100644 (file)
@@ -11,7 +11,7 @@ typedef struct {
        CELL header;
        PORT_MODE type;
        bool closed;
-       FIXNUM fd;
+       F_FIXNUM fd;
        CELL buffer;
 
        /* top of buffer */
@@ -26,7 +26,7 @@ typedef struct {
        bool line_ready;
 
        /* count for read# */
-       FIXNUM count;
+       F_FIXNUM count;
 
        /* tagged client info used by accept_fd */
        CELL client_host;
@@ -36,14 +36,14 @@ typedef struct {
 
        /* a pending I/O error or F */
        CELL io_error;
-} PORT;
-
-PORT* untag_port(CELL tagged);
-PORT* port(PORT_MODE type, CELL fd);
-void init_line_buffer(PORT* port, FIXNUM count);
-void fixup_port(PORT* port);
-void collect_port(PORT* port);
-void postpone_io_error(PORT* port, const char* func);
+} F_PORT;
+
+F_PORT* untag_port(CELL tagged);
+F_PORT* port(PORT_MODE type, CELL fd);
+void init_line_buffer(F_PORT* port, F_FIXNUM count);
+void fixup_port(F_PORT* port);
+void collect_port(F_PORT* port);
+void postpone_io_error(F_PORT* port, const char* func);
 void io_error(const char* func);
-void pending_io_error(PORT* port);
+void pending_io_error(F_PORT* port);
 void primitive_pending_io_error(void);
index c8b0eb097f589479c4602826256b699945b25c10..e3e0a5caa67c02fd9eb5b9c501a4e3e37342fe46 100644 (file)
@@ -16,7 +16,7 @@ void primitive_from_fraction(void)
                dpush(numerator);
        else
        {
-               RATIO* ratio = allot(sizeof(RATIO));
+               F_RATIO* ratio = allot(sizeof(F_RATIO));
                ratio->numerator = numerator;
                ratio->denominator = denominator;
                dpush(tag_ratio(ratio));
index fd09cb9d44969c57c4460389837b2eb63c46069e..3cf91f9eac85c2af792b7ddc806f53ef029d28eb 100644 (file)
@@ -1,15 +1,15 @@
 typedef struct {
        CELL numerator;
        CELL denominator;
-} RATIO;
+} F_RATIO;
 
-INLINE RATIO* untag_ratio(CELL tagged)
+INLINE F_RATIO* untag_ratio(CELL tagged)
 {
        type_check(RATIO_TYPE,tagged);
-       return (RATIO*)UNTAG(tagged);
+       return (F_RATIO*)UNTAG(tagged);
 }
 
-INLINE CELL tag_ratio(RATIO* ratio)
+INLINE CELL tag_ratio(F_RATIO* ratio)
 {
        return RETAG(ratio,RATIO_TYPE);
 }
index 76c3a7f6877d735a2fe39fb1549991b2dca7732b..75a1cd9a5b84b793398cddb017c04753f4061615 100644 (file)
@@ -1,10 +1,10 @@
 #include "factor.h"
 
 /* Return true if something was read */
-bool read_step(PORT* port)
+bool read_step(F_PORT* port)
 {
-       FIXNUM amount = 0;
-       STRING* buffer = untag_string(port->buffer);
+       F_FIXNUM amount = 0;
+       F_STRING* buffer = untag_string(port->buffer);
        CELL capacity = buffer->capacity;
 
        if(port->type == PORT_RECV)
@@ -36,24 +36,24 @@ bool read_step(PORT* port)
        }
 }
 
-bool read_line_step(PORT* port)
+bool read_line_step(F_PORT* port)
 {
        int i;
        BYTE ch;
 
-       SBUF* line = untag_sbuf(port->line);
-       STRING* buffer = untag_string(port->buffer);
+       F_SBUF* line = untag_sbuf(port->line);
+       F_STRING* buffer = untag_string(port->buffer);
 
        for(i = port->buf_pos; i < port->buf_fill; i++)
        {
-               ch = bget((CELL)buffer + sizeof(STRING) + i);
+               ch = bget((CELL)buffer + sizeof(F_STRING) + i);
 
                if(ch == '\r')
                {
                        if(i != port->buf_fill - 1)
                        {
                                ch = bget((CELL)buffer
-                                       + sizeof(STRING) + i + 1);
+                                       + sizeof(F_STRING) + i + 1);
                                if(ch == '\n')
                                        i++;
                        }
@@ -80,7 +80,7 @@ bool read_line_step(PORT* port)
        return false;
 }
 
-bool can_read_line(PORT* port)
+bool can_read_line(F_PORT* port)
 {
        pending_io_error(port);
 
@@ -99,7 +99,7 @@ bool can_read_line(PORT* port)
 
 void primitive_can_read_line(void)
 {
-       PORT* port = untag_port(dpop());
+       F_PORT* port = untag_port(dpop());
        box_boolean(can_read_line(port));
 }
 
@@ -117,7 +117,7 @@ void primitive_add_read_line_io_task(void)
        init_line_buffer(untag_port(port),LINE_SIZE);
 }
 
-bool perform_read_line_io_task(PORT* port)
+bool perform_read_line_io_task(F_PORT* port)
 {
        if(port->buf_pos >= port->buf_fill)
        {
@@ -142,7 +142,7 @@ bool perform_read_line_io_task(PORT* port)
 
 void primitive_read_line_8(void)
 {
-       PORT* port;
+       F_PORT* port;
 
        maybe_garbage_collection();
 
@@ -161,17 +161,17 @@ void primitive_read_line_8(void)
 
 }
 
-bool read_count_step(PORT* port)
+bool read_count_step(F_PORT* port)
 {
        int i;
        BYTE ch;
 
-       SBUF* line = untag_sbuf(port->line);
-       STRING* buffer = untag_string(port->buffer);
+       F_SBUF* line = untag_sbuf(port->line);
+       F_STRING* buffer = untag_string(port->buffer);
 
        for(i = port->buf_pos; i < port->buf_fill; i++)
        {
-               ch = bget((CELL)buffer + sizeof(STRING) + i);
+               ch = bget((CELL)buffer + sizeof(F_STRING) + i);
                set_sbuf_nth(line,line->top,ch);
                if(line->top == port->count)
                {
@@ -186,7 +186,7 @@ bool read_count_step(PORT* port)
        return false;
 }
 
-bool can_read_count(PORT* port, FIXNUM count)
+bool can_read_count(F_PORT* port, F_FIXNUM count)
 {
        pending_io_error(port);
 
@@ -206,8 +206,8 @@ bool can_read_count(PORT* port, FIXNUM count)
 
 void primitive_can_read_count(void)
 {
-       PORT* port;
-       FIXNUM len;
+       F_PORT* port;
+       F_FIXNUM len;
 
        maybe_garbage_collection();
 
@@ -219,8 +219,8 @@ void primitive_can_read_count(void)
 void primitive_add_read_count_io_task(void)
 {
        CELL callback;
-       PORT* port;
-       FIXNUM count;
+       F_PORT* port;
+       F_FIXNUM count;
 
        maybe_garbage_collection();
 
@@ -235,7 +235,7 @@ void primitive_add_read_count_io_task(void)
        init_line_buffer(port,count);
 }
 
-bool perform_read_count_io_task(PORT* port)
+bool perform_read_count_io_task(F_PORT* port)
 {
        if(port->buf_pos >= port->buf_fill)
        {
@@ -251,8 +251,8 @@ bool perform_read_count_io_task(PORT* port)
 
 void primitive_read_count_8(void)
 {
-       PORT* port;
-       FIXNUM len;
+       F_PORT* port;
+       F_FIXNUM len;
 
        maybe_garbage_collection();
 
index 52b61e2da4a080f677591bee67fd2d7b97fff988..7d6f3dcc2ce9bd164d44af17d3c5e0709bf5c687 100644 (file)
@@ -1,19 +1,19 @@
-bool read_step(PORT* port);
+bool read_step(F_PORT* port);
 
 #define LINE_SIZE 80
 
-bool read_line_step(PORT* port);
-bool can_read_line(PORT* port);
+bool read_line_step(F_PORT* port);
+bool can_read_line(F_PORT* port);
 void primitive_can_read_line(void);
 void primitive_add_read_line_io_task(void);
-bool perform_read_line_io_task(PORT* port);
+bool perform_read_line_io_task(F_PORT* port);
 void primitive_read_line_8(void);
-bool read_count_step(PORT* port);
+bool read_count_step(F_PORT* port);
 
 #define CAN_READ_COUNT(port,count) (untag_sbuf(port->line)->top >= count)
 
-bool can_read_count(PORT* port, FIXNUM count);
+bool can_read_count(F_PORT* port, F_FIXNUM count);
 void primitive_can_read_count(void);
 void primitive_add_read_count_io_task(void);
-bool perform_read_count_io_task(PORT* port);
+bool perform_read_count_io_task(F_PORT* port);
 void primitive_read_count_8(void);
index 917288b82a78214cfc6787ffeef4e3ee21e2baa8..4dc61f2d6f170f5537d08195561535c054203a66 100644 (file)
@@ -11,22 +11,22 @@ void relocate_object()
        switch(untag_header(get(relocating)))
        {
        case WORD_TYPE:
-               fixup_word((WORD*)relocating);
+               fixup_word((F_WORD*)relocating);
                break;
        case ARRAY_TYPE:
-               fixup_array((ARRAY*)relocating);
+               fixup_array((F_ARRAY*)relocating);
                break;
        case VECTOR_TYPE:
-               fixup_vector((VECTOR*)relocating);
+               fixup_vector((F_VECTOR*)relocating);
                break;
        case STRING_TYPE:
-               rehash_string((STRING*)relocating);
+               rehash_string((F_STRING*)relocating);
                break;
        case SBUF_TYPE:
-               fixup_sbuf((SBUF*)relocating);
+               fixup_sbuf((F_SBUF*)relocating);
                break;
        case PORT_TYPE:
-               fixup_port((PORT*)relocating);
+               fixup_port((F_PORT*)relocating);
                break;
        case DLL_TYPE:
                fixup_dll((DLL*)relocating);
index 70f943f63d8c5beb837da87cf7a9117682c9af0d..31b04df22c5bced028889d033e66cebee9b66cb7 100644 (file)
@@ -54,7 +54,7 @@ void run(void)
 
                if(TAG(next) == WORD_TYPE)
                {
-                       executing = (WORD*)UNTAG(next);
+                       executing = (F_WORD*)UNTAG(next);
                        EXECUTE(executing);
                }
                else
@@ -110,7 +110,7 @@ void primitive_ifte(void)
 
 void primitive_getenv(void)
 {
-       FIXNUM e = to_fixnum(dpeek());
+       F_FIXNUM e = to_fixnum(dpeek());
        if(e < 0 || e >= USER_ENV)
                range_error(F,e,USER_ENV);
        drepl(userenv[e]);
@@ -118,7 +118,7 @@ void primitive_getenv(void)
 
 void primitive_setenv(void)
 {
-       FIXNUM e = to_fixnum(dpop());
+       F_FIXNUM e = to_fixnum(dpop());
        CELL value = dpop();
        if(e < 0 || e >= USER_ENV)
                range_error(F,e,USER_ENV);
index 32a5e8536190494b6efffc669760be692dd60720..e4cf581b9516d95c9cf314a8eaba733826d3ab31 100644 (file)
@@ -22,7 +22,7 @@ sigjmp_buf toplevel;
 CELL callframe;
 
 /* raw pointer to currently executing word */
-WORD* executing;
+F_WORD* executing;
 
 /* TAGGED user environment data; see getenv/setenv prims */
 CELL userenv[USER_ENV];
index 9126e94c4a927c451e6ac561e645ec533c9f655a..d9eadf52307636f2367f38cc0ca8f872a2d20eda 100644 (file)
@@ -42,7 +42,7 @@ MIT in each case. */
    you could write alternate versions that don't require this type). */
 /* #define BIGNUM_NO_ULONG */
 
-typedef ARRAY * bignum_type;
+typedef F_ARRAY * bignum_type;
 #define BIGNUM_OUT_OF_BAND ((bignum_type) 0)
 
 enum bignum_comparison
index 7b2dfb76e84974015060d09bf68cb283b4ea1391..3150b1bf7ae3460a15721190b3ec0fc26afe9994 100644 (file)
@@ -58,7 +58,7 @@ typedef long bignum_length_type;
    space when a bignum's length is reduced from its original value. */
 #define BIGNUM_REDUCE_LENGTH(target, source, length)            \
      target = shrink_array(source, length + 1)
-/* extern ARRAY* shrink_array(ARRAY* array, CELL capacity); */
+/* extern F_ARRAY* shrink_array(F_ARRAY* array, CELL capacity); */
 
 /* BIGNUM_DEALLOCATE is called when disposing of bignums which are
    created as intermediate temporaries; Scheme doesn't need this. */
@@ -102,9 +102,9 @@ typedef long bignum_length_type;
 
 /* These definitions are here to facilitate caching of the constants
    0, 1, and -1. */
-#define BIGNUM_ZERO() (ARRAY*)UNTAG(bignum_zero)
+#define BIGNUM_ZERO() (F_ARRAY*)UNTAG(bignum_zero)
 #define BIGNUM_ONE(neg_p) \
-   (ARRAY*)UNTAG(neg_p ? bignum_neg_one : bignum_pos_one)
+   (F_ARRAY*)UNTAG(neg_p ? bignum_neg_one : bignum_pos_one)
 
 #define BIGNUM_ONE_P(bignum,negative_p) ((bignum) == BIGNUM_ONE(negative_p))
 
index a0aaa926915fc0678f19453fe69677cdf9ab96bf..de8b3a54082d70f88b348168217069b5161cd06d 100644 (file)
@@ -1,8 +1,8 @@
 #include "factor.h"
 
-SBUF* sbuf(FIXNUM capacity)
+F_SBUF* sbuf(F_FIXNUM capacity)
 {
-       SBUF* sbuf = allot_object(SBUF_TYPE,sizeof(SBUF));
+       F_SBUF* sbuf = allot_object(SBUF_TYPE,sizeof(F_SBUF));
        sbuf->top = 0;
        sbuf->string = tag_object(string(capacity,'\0'));
        return sbuf;
@@ -21,9 +21,9 @@ void primitive_sbuf_length(void)
 
 void primitive_set_sbuf_length(void)
 {
-       SBUF* sbuf;
-       FIXNUM length;
-       STRING* str;
+       F_SBUF* sbuf;
+       F_FIXNUM length;
+       F_STRING* str;
 
        maybe_garbage_collection();
 
@@ -39,7 +39,7 @@ void primitive_set_sbuf_length(void)
 
 void primitive_sbuf_nth(void)
 {
-       SBUF* sbuf = untag_sbuf(dpop());
+       F_SBUF* sbuf = untag_sbuf(dpop());
        CELL index = to_fixnum(dpop());
 
        if(index < 0 || index >= sbuf->top)
@@ -47,16 +47,16 @@ void primitive_sbuf_nth(void)
        dpush(string_nth(untag_string(sbuf->string),index));
 }
 
-void sbuf_ensure_capacity(SBUF* sbuf, FIXNUM top)
+void sbuf_ensure_capacity(F_SBUF* sbuf, F_FIXNUM top)
 {
-       STRING* string = untag_string(sbuf->string);
+       F_STRING* string = untag_string(sbuf->string);
        CELL capacity = string->capacity;
        if(top >= capacity)
                sbuf->string = tag_object(grow_string(string,top * 2 + 1,F));
        sbuf->top = top;
 }
 
-void set_sbuf_nth(SBUF* sbuf, CELL index, uint16_t value)
+void set_sbuf_nth(F_SBUF* sbuf, CELL index, uint16_t value)
 {
        if(index < 0)
                range_error(tag_object(sbuf),index,sbuf->top);
@@ -69,8 +69,8 @@ void set_sbuf_nth(SBUF* sbuf, CELL index, uint16_t value)
 
 void primitive_set_sbuf_nth(void)
 {
-       SBUF* sbuf;
-       FIXNUM index;
+       F_SBUF* sbuf;
+       F_FIXNUM index;
        CELL value;
 
        maybe_garbage_collection();
@@ -82,20 +82,20 @@ void primitive_set_sbuf_nth(void)
        set_sbuf_nth(sbuf,index,value);
 }
 
-void sbuf_append_string(SBUF* sbuf, STRING* string)
+void sbuf_append_string(F_SBUF* sbuf, F_STRING* string)
 {
        CELL top = sbuf->top;
        CELL strlen = string->capacity;
-       STRING* str;
+       F_STRING* str;
        sbuf_ensure_capacity(sbuf,top + strlen);
        str = untag_string(sbuf->string);
-       memcpy((void*)((CELL)str + sizeof(STRING) + top * CHARS),
-               (void*)((CELL)string + sizeof(STRING)),strlen * CHARS);
+       memcpy((void*)((CELL)str + sizeof(F_STRING) + top * CHARS),
+               (void*)((CELL)string + sizeof(F_STRING)),strlen * CHARS);
 }
 
 void primitive_sbuf_append(void)
 {
-       SBUF* sbuf;
+       F_SBUF* sbuf;
        CELL object;
 
        maybe_garbage_collection();
@@ -120,8 +120,8 @@ void primitive_sbuf_append(void)
 
 void primitive_sbuf_to_string(void)
 {
-       SBUF* sbuf;
-       STRING* s;
+       F_SBUF* sbuf;
+       F_STRING* s;
 
        maybe_garbage_collection();
 
@@ -133,14 +133,14 @@ void primitive_sbuf_to_string(void)
 
 void primitive_sbuf_reverse(void)
 {
-       SBUF* sbuf = untag_sbuf(dpop());
+       F_SBUF* sbuf = untag_sbuf(dpop());
        string_reverse(untag_string(sbuf->string),sbuf->top);
 }
 
 void primitive_sbuf_clone(void)
 {
-       SBUF* s;
-       SBUF* new_s;
+       F_SBUF* s;
+       F_SBUF* new_s;
 
        maybe_garbage_collection();
 
@@ -151,7 +151,7 @@ void primitive_sbuf_clone(void)
        drepl(tag_object(new_s));
 }
 
-bool sbuf_eq(SBUF* s1, SBUF* s2)
+bool sbuf_eq(F_SBUF* s1, F_SBUF* s2)
 {
        if(s1 == s2)
                return true;
@@ -166,26 +166,26 @@ bool sbuf_eq(SBUF* s1, SBUF* s2)
 
 void primitive_sbuf_eq(void)
 {
-       SBUF* s1 = untag_sbuf(dpop());
+       F_SBUF* s1 = untag_sbuf(dpop());
        CELL with = dpop();
        if(typep(SBUF_TYPE,with))
-               dpush(tag_boolean(sbuf_eq(s1,(SBUF*)UNTAG(with))));
+               dpush(tag_boolean(sbuf_eq(s1,(F_SBUF*)UNTAG(with))));
        else
                dpush(F);
 }
 
 void primitive_sbuf_hashcode(void)
 {
-       SBUF* sbuf = untag_sbuf(dpop());
+       F_SBUF* sbuf = untag_sbuf(dpop());
        dpush(tag_fixnum(hash_string(untag_string(sbuf->string),sbuf->top)));
 }
 
-void fixup_sbuf(SBUF* sbuf)
+void fixup_sbuf(F_SBUF* sbuf)
 {
        fixup(&sbuf->string);
 }
 
-void collect_sbuf(SBUF* sbuf)
+void collect_sbuf(F_SBUF* sbuf)
 {
        copy_object(&sbuf->string);
 }
index 173c85863abe2bb967edad9b3926a4d8783b77dc..8d8246fe6b173ab4d4e187f89d724aea541be7cf 100644 (file)
@@ -5,30 +5,30 @@ typedef struct {
        CELL top;
        /* tagged */
        CELL string;
-} SBUF;
+} F_SBUF;
 
-INLINE SBUF* untag_sbuf(CELL tagged)
+INLINE F_SBUF* untag_sbuf(CELL tagged)
 {
        type_check(SBUF_TYPE,tagged);
-       return (SBUF*)UNTAG(tagged);
+       return (F_SBUF*)UNTAG(tagged);
 }
 
-SBUF* sbuf(FIXNUM capacity);
+F_SBUF* sbuf(F_FIXNUM capacity);
 
 void primitive_sbuf(void);
 void primitive_sbuf_length(void);
 void primitive_set_sbuf_length(void);
 void primitive_sbuf_nth(void);
-void sbuf_ensure_capacity(SBUF* sbuf, FIXNUM top);
-void set_sbuf_nth(SBUF* sbuf, CELL index, uint16_t value);
+void sbuf_ensure_capacity(F_SBUF* sbuf, F_FIXNUM top);
+void set_sbuf_nth(F_SBUF* sbuf, CELL index, uint16_t value);
 void primitive_set_sbuf_nth(void);
-void sbuf_append_string(SBUF* sbuf, STRING* string);
+void sbuf_append_string(F_SBUF* sbuf, F_STRING* string);
 void primitive_sbuf_append(void);
 void primitive_sbuf_to_string(void);
 void primitive_sbuf_reverse(void);
 void primitive_sbuf_clone(void);
-bool sbuf_eq(SBUF* s1, SBUF* s2);
+bool sbuf_eq(F_SBUF* s1, F_SBUF* s2);
 void primitive_sbuf_eq(void);
 void primitive_sbuf_hashcode(void);
-void fixup_sbuf(SBUF* sbuf);
-void collect_sbuf(SBUF* sbuf);
+void fixup_sbuf(F_SBUF* sbuf);
+void collect_sbuf(F_SBUF* sbuf);
index 5076dadfda1335e682953df49fe07fc60fd10bc8..5456091947621daf203f9188a49121514777b16f 100644 (file)
@@ -111,7 +111,7 @@ void primitive_add_accept_io_task(void)
                read_io_tasks,&read_fd_count);
 }
 
-CELL accept_connection(PORT* p)
+CELL accept_connection(F_PORT* p)
 {
        struct sockaddr_in clientname;
        size_t size = sizeof(clientname);
@@ -135,7 +135,7 @@ CELL accept_connection(PORT* p)
 
 void primitive_accept_fd(void)
 {
-       PORT* p;
+       F_PORT* p;
        maybe_garbage_collection();
        p = untag_port(dpop());
        pending_io_error(p);
index 3123c8ae5b0d2551f6b0f6f21f1e22bba5ae2336..b2b75b98c1767d4221c9e61365a72b23605c1a29 100644 (file)
@@ -5,5 +5,5 @@ void primitive_client_socket(void);
 int make_server_socket(uint16_t port);
 void primitive_server_socket(void);
 void primitive_add_accept_io_task(void);
-CELL accept_connection(PORT* p);
+CELL accept_connection(F_PORT* p);
 void primitive_accept_fd(void);
index 75ca782362bfc3174b18bde674a01331caadf29e..1f6d3e7a88f8d7f30fb8bf3f29f3479276fb2d19 100644 (file)
@@ -69,11 +69,11 @@ void primitive_from_r(void)
        dpush(cpop());
 }
 
-VECTOR* stack_to_vector(CELL bottom, CELL top)
+F_VECTOR* stack_to_vector(CELL bottom, CELL top)
 {
        CELL depth = (top - bottom + CELLS) / CELLS;
-       VECTOR* v = vector(depth);
-       ARRAY* a = untag_array(v->array);
+       F_VECTOR* v = vector(depth);
+       F_ARRAY* a = untag_array(v->array);
        memcpy(a + 1,(void*)bottom,depth * CELLS);
        v->top = depth;
        return v;
@@ -92,7 +92,7 @@ void primitive_callstack(void)
 }
 
 /* Returns top of stack */
-CELL vector_to_stack(VECTOR* vector, CELL bottom)
+CELL vector_to_stack(F_VECTOR* vector, CELL bottom)
 {
        CELL start = bottom;
        CELL len = vector->top * CELLS;
index 6dd994b1ee77bcd870cea2f3ad2231a5dfab451c..3d31205ca16c61faacff8bdb7cb075bd5b043fd3 100644 (file)
@@ -13,9 +13,9 @@ void primitive_over(void);
 void primitive_pick(void);
 void primitive_to_r(void);
 void primitive_from_r(void);
-VECTOR* stack_to_vector(CELL bottom, CELL top);
+F_VECTOR* stack_to_vector(CELL bottom, CELL top);
 void primitive_datastack(void);
 void primitive_callstack(void);
-CELL vector_to_stack(VECTOR* vector, CELL bottom);
+CELL vector_to_stack(F_VECTOR* vector, CELL bottom);
 void primitive_set_datastack(void);
 void primitive_set_callstack(void);
index d2c30410b15c78dfc051f5eb6001dd58804f1a07..1f387737fcad77b89450678dd00e7f312f07a5d4 100644 (file)
@@ -1,13 +1,13 @@
 #include "factor.h"
 
 /* untagged */
-STRING* allot_string(FIXNUM capacity)
+F_STRING* allot_string(F_FIXNUM capacity)
 {
-       STRING* string;
+       F_STRING* string;
        if(capacity < 0)
                general_error(ERROR_NEGATIVE_ARRAY_SIZE,tag_fixnum(capacity));
        string = allot_object(STRING_TYPE,
-               sizeof(STRING) + capacity * CHARS);
+               sizeof(F_STRING) + capacity * CHARS);
        string->capacity = capacity;
        return string;
 }
@@ -15,26 +15,26 @@ STRING* allot_string(FIXNUM capacity)
 /* call this after constructing a string */
 /* uses same algorithm as java.lang.String for compatibility with
 images generated from Java Factor. */
-FIXNUM hash_string(STRING* str, FIXNUM len)
+F_FIXNUM hash_string(F_STRING* str, F_FIXNUM len)
 {
-       FIXNUM hash = 0;
+       F_FIXNUM hash = 0;
        CELL i;
        for(i = 0; i < len; i++)
                hash = 31*hash + string_nth(str,i);
        return hash;
 }
 
-void rehash_string(STRING* str)
+void rehash_string(F_STRING* str)
 {
        str->hashcode = hash_string(str,str->capacity);
 }
 
 /* untagged */
-STRING* string(FIXNUM capacity, CELL fill)
+F_STRING* string(F_FIXNUM capacity, CELL fill)
 {
        CELL i;
 
-       STRING* string = allot_string(capacity);
+       F_STRING* string = allot_string(capacity);
 
        for(i = 0; i < capacity; i++)
                cput(SREF(string,i),fill);
@@ -44,12 +44,12 @@ STRING* string(FIXNUM capacity, CELL fill)
        return string;
 }
 
-STRING* grow_string(STRING* string, FIXNUM capacity, uint16_t fill)
+F_STRING* grow_string(F_STRING* string, F_FIXNUM capacity, uint16_t fill)
 {
        /* later on, do an optimization: if end of array is here, just grow */
        CELL i;
 
-       STRING* new_string = allot_string(capacity);
+       F_STRING* new_string = allot_string(capacity);
 
        memcpy(new_string + 1,string + 1,string->capacity * CHARS);
 
@@ -60,10 +60,10 @@ STRING* grow_string(STRING* string, FIXNUM capacity, uint16_t fill)
 }
 
 /* untagged */
-STRING* from_c_string(const BYTE* c_string)
+F_STRING* from_c_string(const BYTE* c_string)
 {
        CELL length = strlen(c_string);
-       STRING* s = allot_string(length);
+       F_STRING* s = allot_string(length);
        CELL i;
 
        for(i = 0; i < length; i++)
@@ -84,7 +84,7 @@ void box_c_string(const BYTE* c_string)
 }
 
 /* untagged */
-BYTE* to_c_string(STRING* s)
+BYTE* to_c_string(F_STRING* s)
 {
        CELL i;
 
@@ -99,9 +99,9 @@ BYTE* to_c_string(STRING* s)
 }
 
 /* untagged */
-BYTE* to_c_string_unchecked(STRING* s)
+BYTE* to_c_string_unchecked(F_STRING* s)
 {
-       STRING* _c_str = allot_string(s->capacity / CHARS + 1);
+       F_STRING* _c_str = allot_string(s->capacity / CHARS + 1);
        CELL i;
 
        BYTE* c_str = (BYTE*)(_c_str + 1);
@@ -127,7 +127,7 @@ void primitive_string_length(void)
 
 void primitive_string_nth(void)
 {
-       STRING* string = untag_string(dpop());
+       F_STRING* string = untag_string(dpop());
        CELL index = to_fixnum(dpop());
 
        if(index < 0 || index >= string->capacity)
@@ -135,7 +135,7 @@ void primitive_string_nth(void)
        dpush(tag_fixnum(string_nth(string,index)));
 }
 
-FIXNUM string_compare_head(STRING* s1, STRING* s2, CELL len)
+F_FIXNUM string_compare_head(F_STRING* s1, F_STRING* s2, CELL len)
 {
        CELL i = 0;
        while(i < len)
@@ -150,7 +150,7 @@ FIXNUM string_compare_head(STRING* s1, STRING* s2, CELL len)
        return 0;
 }
 
-FIXNUM string_compare(STRING* s1, STRING* s2)
+F_FIXNUM string_compare(F_STRING* s1, F_STRING* s2)
 {
        CELL len1 = s1->capacity;
        CELL len2 = s2->capacity;
@@ -166,13 +166,13 @@ FIXNUM string_compare(STRING* s1, STRING* s2)
 
 void primitive_string_compare(void)
 {
-       STRING* s2 = untag_string(dpop());
-       STRING* s1 = untag_string(dpop());
+       F_STRING* s2 = untag_string(dpop());
+       F_STRING* s1 = untag_string(dpop());
 
        dpush(tag_fixnum(string_compare(s1,s2)));
 }
 
-bool string_eq(STRING* s1, STRING* s2)
+bool string_eq(F_STRING* s1, F_STRING* s2)
 {
        if(s1 == s2)
                return true;
@@ -184,10 +184,10 @@ bool string_eq(STRING* s1, STRING* s2)
 
 void primitive_string_eq(void)
 {
-       STRING* s1 = untag_string(dpop());
+       F_STRING* s1 = untag_string(dpop());
        CELL with = dpop();
        if(typep(STRING_TYPE,with))
-               dpush(tag_boolean(string_eq(s1,(STRING*)UNTAG(with))));
+               dpush(tag_boolean(string_eq(s1,(F_STRING*)UNTAG(with))));
        else
                dpush(F);
 }
@@ -197,7 +197,7 @@ void primitive_string_hashcode(void)
        drepl(tag_fixnum(untag_string(dpeek())->hashcode));
 }
 
-CELL index_of_ch(CELL index, STRING* string, CELL ch)
+CELL index_of_ch(CELL index, F_STRING* string, CELL ch)
 {
        while(index < string->capacity)
        {
@@ -209,7 +209,7 @@ CELL index_of_ch(CELL index, STRING* string, CELL ch)
        return -1;
 }
 
-INLINE FIXNUM index_of_str(FIXNUM index, STRING* string, STRING* substring)
+INLINE F_FIXNUM index_of_str(F_FIXNUM index, F_STRING* string, F_STRING* substring)
 {
        CELL i = index;
        CELL limit = string->capacity - substring->capacity;
@@ -245,8 +245,8 @@ outer:      if(i <= limit)
 void primitive_index_of(void)
 {
        CELL ch = dpop();
-       STRING* string;
-       FIXNUM index;
+       F_STRING* string;
+       F_FIXNUM index;
        CELL result;
        string = untag_string(dpop());
        index = to_fixnum(dpop());
@@ -262,9 +262,9 @@ void primitive_index_of(void)
        dpush(tag_fixnum(result));
 }
 
-INLINE STRING* substring(CELL start, CELL end, STRING* string)
+INLINE F_STRING* substring(CELL start, CELL end, F_STRING* string)
 {
-       STRING* result;
+       F_STRING* result;
 
        if(start < 0)
                range_error(tag_object(string),start,string->capacity);
@@ -284,7 +284,7 @@ INLINE STRING* substring(CELL start, CELL end, STRING* string)
 /* start end string -- string */
 void primitive_substring(void)
 {
-       STRING* string;
+       F_STRING* string;
        CELL end, start;
 
        maybe_garbage_collection();
@@ -296,7 +296,7 @@ void primitive_substring(void)
 }
 
 /* DESTRUCTIVE - don't use with user-visible strings */
-void string_reverse(STRING* s, int len)
+void string_reverse(F_STRING* s, int len)
 {
        int i, j;
        uint16_t ch1, ch2;
@@ -311,16 +311,16 @@ void string_reverse(STRING* s, int len)
 }
 
 /* Doesn't rehash the string! */
-STRING* string_clone(STRING* s, int len)
+F_STRING* string_clone(F_STRING* s, int len)
 {
-       STRING* copy = allot_string(len);
+       F_STRING* copy = allot_string(len);
        memcpy(copy + 1,s + 1,len * CHARS);
        return copy;
 }
 
 void primitive_string_reverse(void)
 {
-       STRING* s;
+       F_STRING* s;
 
        maybe_garbage_collection();
 
index eaa4331c80caebd83e6cc5d7dc93698675cdd2a5..e9f28d50d5b846b02298afac562ed263d049d27c 100644 (file)
@@ -3,52 +3,52 @@ typedef struct {
        /* untagged */
        CELL capacity;
        /* untagged */
-       FIXNUM hashcode;
-} STRING;
+       F_FIXNUM hashcode;
+} F_STRING;
 
-INLINE STRING* untag_string(CELL tagged)
+INLINE F_STRING* untag_string(CELL tagged)
 {
        type_check(STRING_TYPE,tagged);
-       return (STRING*)UNTAG(tagged);
+       return (F_STRING*)UNTAG(tagged);
 }
 
-STRING* allot_string(FIXNUM capacity);
-STRING* string(FIXNUM capacity, CELL fill);
-FIXNUM hash_string(STRING* str, FIXNUM len);
-void rehash_string(STRING* str);
-STRING* grow_string(STRING* string, FIXNUM capacity, uint16_t fill);
-BYTE* to_c_string(STRING* s);
-BYTE* to_c_string_unchecked(STRING* s);
+F_STRING* allot_string(F_FIXNUM capacity);
+F_STRING* string(F_FIXNUM capacity, CELL fill);
+F_FIXNUM hash_string(F_STRING* str, F_FIXNUM len);
+void rehash_string(F_STRING* str);
+F_STRING* grow_string(F_STRING* string, F_FIXNUM capacity, uint16_t fill);
+BYTE* to_c_string(F_STRING* s);
+BYTE* to_c_string_unchecked(F_STRING* s);
 void box_c_string(const BYTE* c_string);
-STRING* from_c_string(const BYTE* c_string);
+F_STRING* from_c_string(const BYTE* c_string);
 BYTE* unbox_c_string(void);
 
-#define SREF(string,index) ((CELL)string + sizeof(STRING) + index * CHARS)
+#define SREF(string,index) ((CELL)string + sizeof(F_STRING) + index * CHARS)
 
-#define SSIZE(pointer) align8(sizeof(STRING) + \
-       ((STRING*)pointer)->capacity * CHARS)
+#define SSIZE(pointer) align8(sizeof(F_STRING) + \
+       ((F_STRING*)pointer)->capacity * CHARS)
 
 /* untagged & unchecked */
-INLINE CELL string_nth(STRING* string, CELL index)
+INLINE CELL string_nth(F_STRING* string, CELL index)
 {
        return cget(SREF(string,index));
 }
 
 /* untagged & unchecked */
-INLINE void set_string_nth(STRING* string, CELL index, uint16_t value)
+INLINE void set_string_nth(F_STRING* string, CELL index, uint16_t value)
 {
        cput(SREF(string,index),value);
 }
 
 void primitive_string_length(void);
 void primitive_string_nth(void);
-FIXNUM string_compare_head(STRING* s1, STRING* s2, CELL len);
-FIXNUM string_compare(STRING* s1, STRING* s2);
+F_FIXNUM string_compare_head(F_STRING* s1, F_STRING* s2, CELL len);
+F_FIXNUM string_compare(F_STRING* s1, F_STRING* s2);
 void primitive_string_compare(void);
 void primitive_string_eq(void);
 void primitive_string_hashcode(void);
 void primitive_index_of(void);
 void primitive_substring(void);
-void string_reverse(STRING* s, int len);
-STRING* string_clone(STRING* s, int len);
+void string_reverse(F_STRING* s, int len);
+F_STRING* string_clone(F_STRING* s, int len);
 void primitive_string_reverse(void);
index 0504cdb2951dfe93ad9c39e3c7deaaba3eb21c38..d5bd376d55ef7de2b3a7c8f5f9b1f6fcf5d32e39 100644 (file)
@@ -40,16 +40,16 @@ CELL object_size(CELL pointer)
                size = 0;
                break;
        case CONS_TYPE:
-               size = sizeof(CONS);
+               size = sizeof(F_CONS);
                break;
        case WORD_TYPE:
-               size = sizeof(WORD);
+               size = sizeof(F_WORD);
                break;
        case RATIO_TYPE:
-               size = sizeof(RATIO);
+               size = sizeof(F_RATIO);
                break;
        case COMPLEX_TYPE:
-               size = sizeof(COMPLEX);
+               size = sizeof(F_COMPLEX);
                break;
        case OBJECT_TYPE:
                size = untagged_object_size(UNTAG(pointer));
@@ -73,7 +73,7 @@ CELL untagged_object_size(CELL pointer)
        switch(untag_header(get(pointer)))
        {
        case WORD_TYPE:
-               size = sizeof(WORD);
+               size = sizeof(F_WORD);
                break;
        case T_TYPE:
                size = CELLS * 2;
@@ -83,19 +83,19 @@ CELL untagged_object_size(CELL pointer)
                size = ASIZE(pointer);
                break;
        case VECTOR_TYPE:
-               size = sizeof(VECTOR);
+               size = sizeof(F_VECTOR);
                break;
        case STRING_TYPE:
                size = SSIZE(pointer);
                break;
        case SBUF_TYPE:
-               size = sizeof(SBUF);
+               size = sizeof(F_SBUF);
                break;
        case FLOAT_TYPE:
-               size = sizeof(FLOAT);
+               size = sizeof(F_FLOAT);
                break;
        case PORT_TYPE:
-               size = sizeof(PORT);
+               size = sizeof(F_PORT);
                break;
        case DLL_TYPE:
                size = sizeof(DLL);
index fdf756dc2d829b76cdb23fe54edb7691139dcb7f..d1db998b25534e737cba920710cd6322cbe161d3 100644 (file)
@@ -37,11 +37,11 @@ CELL T;
 #define TYPE_COUNT 17
 
 /* Pseudo-types. For error reporting only. */
-#define INTEGER_TYPE 100 /* FIXNUM or BIGNUM */
-#define RATIONAL_TYPE 101 /* INTEGER or RATIO */
-#define REAL_TYPE 102 /* RATIONAL or FLOAT */
-#define NUMBER_TYPE 103 /* COMPLEX or REAL */
-#define TEXT_TYPE 104 /* FIXNUM or STRING */
+#define INTEGER_TYPE 100 /* F_FIXNUM or BIGNUM */
+#define RATIONAL_TYPE 101 /* INTEGER or F_RATIO */
+#define REAL_TYPE 102 /* RATIONAL or F_FLOAT */
+#define NUMBER_TYPE 103 /* F_COMPLEX or REAL */
+#define TEXT_TYPE 104 /* F_FIXNUM or F_STRING */
 
 CELL type_of(CELL tagged);
 bool typep(CELL type, CELL tagged);
index 244127f369e5a21bb93e547f855b5f09c03b92a1..f796ed500f114968458bcbe1670b91d3406b83fa 100644 (file)
@@ -1,8 +1,8 @@
 #include "factor.h"
 
-VECTOR* vector(FIXNUM capacity)
+F_VECTOR* vector(F_FIXNUM capacity)
 {
-       VECTOR* vector = allot_object(VECTOR_TYPE,sizeof(VECTOR));
+       F_VECTOR* vector = allot_object(VECTOR_TYPE,sizeof(F_VECTOR));
        vector->top = 0;
        vector->array = tag_object(array(capacity,F));
        return vector;
@@ -21,9 +21,9 @@ void primitive_vector_length(void)
 
 void primitive_set_vector_length(void)
 {
-       VECTOR* vector;
-       FIXNUM length;
-       ARRAY* array;
+       F_VECTOR* vector;
+       F_FIXNUM length;
+       F_ARRAY* array;
 
        maybe_garbage_collection();
 
@@ -40,7 +40,7 @@ void primitive_set_vector_length(void)
 
 void primitive_vector_nth(void)
 {
-       VECTOR* vector = untag_vector(dpop());
+       F_VECTOR* vector = untag_vector(dpop());
        CELL index = to_fixnum(dpop());
 
        if(index < 0 || index >= vector->top)
@@ -48,9 +48,9 @@ void primitive_vector_nth(void)
        dpush(array_nth(untag_array(vector->array),index));
 }
 
-void vector_ensure_capacity(VECTOR* vector, CELL index)
+void vector_ensure_capacity(F_VECTOR* vector, CELL index)
 {
-       ARRAY* array = untag_array(vector->array);
+       F_ARRAY* array = untag_array(vector->array);
        CELL capacity = array->capacity;
        if(index >= capacity)
                array = grow_array(array,index * 2 + 1,F);
@@ -60,8 +60,8 @@ void vector_ensure_capacity(VECTOR* vector, CELL index)
 
 void primitive_set_vector_nth(void)
 {
-       VECTOR* vector;
-       FIXNUM index;
+       F_VECTOR* vector;
+       F_FIXNUM index;
        CELL value;
 
        maybe_garbage_collection();
@@ -79,12 +79,12 @@ void primitive_set_vector_nth(void)
        set_array_nth(untag_array(vector->array),index,value);
 }
 
-void fixup_vector(VECTOR* vector)
+void fixup_vector(F_VECTOR* vector)
 {
        fixup(&vector->array);
 }
 
-void collect_vector(VECTOR* vector)
+void collect_vector(F_VECTOR* vector)
 {
        copy_object(&vector->array);
 }
index 9cf9328c98418c60c203b2cee904e76c51ab565e..1bbd5916afb471f6e12d93b33aa523d0ccc4e1fe 100644 (file)
@@ -5,21 +5,21 @@ typedef struct {
        CELL top;
        /* tagged */
        CELL array;
-} VECTOR;
+} F_VECTOR;
 
-INLINE VECTOR* untag_vector(CELL tagged)
+INLINE F_VECTOR* untag_vector(CELL tagged)
 {
        type_check(VECTOR_TYPE,tagged);
-       return (VECTOR*)UNTAG(tagged);
+       return (F_VECTOR*)UNTAG(tagged);
 }
 
-VECTOR* vector(FIXNUM capacity);
+F_VECTOR* vector(F_FIXNUM capacity);
 
 void primitive_vector(void);
 void primitive_vector_length(void);
 void primitive_set_vector_length(void);
 void primitive_vector_nth(void);
-void vector_ensure_capacity(VECTOR* vector, CELL index);
+void vector_ensure_capacity(F_VECTOR* vector, CELL index);
 void primitive_set_vector_nth(void);
-void fixup_vector(VECTOR* vector);
-void collect_vector(VECTOR* vector);
+void fixup_vector(F_VECTOR* vector);
+void collect_vector(F_VECTOR* vector);
index 86ff360a9966e6f561dd341a38afb3ef8285d86e..41952ef772c4a5f54aa78ed4a0a66a983222e457 100644 (file)
@@ -1,8 +1,8 @@
 #include "factor.h"
 
-WORD* word(CELL primitive, CELL parameter, CELL plist)
+F_WORD* word(CELL primitive, CELL parameter, CELL plist)
 {
-       WORD* word = allot_object(WORD_TYPE,sizeof(WORD));
+       F_WORD* word = allot_object(WORD_TYPE,sizeof(F_WORD));
        word->hashcode = (CELL)word; /* initial address */
        word->xt = primitive_to_xt(primitive);
        word->primitive = primitive;
@@ -17,7 +17,7 @@ WORD* word(CELL primitive, CELL parameter, CELL plist)
 /* When a word is executed we jump to the value of the xt field. However this
    value is an unportable function pointer, so in the image we store a primitive
    number that indexes a list of xts. */
-void update_xt(WORD* word)
+void update_xt(F_WORD* word)
 {
        word->xt = primitive_to_xt(word->primitive);
 }
@@ -26,7 +26,7 @@ void update_xt(WORD* word)
 void primitive_word(void)
 {
        CELL plist, parameter;
-       FIXNUM primitive;
+       F_FIXNUM primitive;
 
        maybe_garbage_collection();
 
@@ -48,7 +48,7 @@ void primitive_word_xt(void)
 
 void primitive_set_word_xt(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->xt = unbox_integer();
 }
 
@@ -59,7 +59,7 @@ void primitive_word_primitive(void)
 
 void primitive_set_word_primitive(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->primitive = to_fixnum(dpop());
        update_xt(word);
 }
@@ -71,7 +71,7 @@ void primitive_word_parameter(void)
 
 void primitive_set_word_parameter(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->parameter = dpop();
 }
 
@@ -82,7 +82,7 @@ void primitive_word_plist(void)
 
 void primitive_set_word_plist(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->plist = dpop();
 }
 
@@ -93,7 +93,7 @@ void primitive_word_call_count(void)
 
 void primitive_set_word_call_count(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->call_count = to_fixnum(dpop());
 }
 
@@ -104,24 +104,24 @@ void primitive_word_allot_count(void)
 
 void primitive_set_word_allot_count(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        word->allot_count = to_fixnum(dpop());
 }
 
 void primitive_word_compiledp(void)
 {
-       WORD* word = untag_word(dpop());
+       F_WORD* word = untag_word(dpop());
        box_boolean(word->xt != (CELL)docol && word->xt != (CELL)dosym);
 }
 
-void fixup_word(WORD* word)
+void fixup_word(F_WORD* word)
 {
        update_xt(word);
        fixup(&word->parameter);
        fixup(&word->plist);
 }
 
-void collect_word(WORD* word)
+void collect_word(F_WORD* word)
 {
        copy_object(&word->parameter);
        copy_object(&word->plist);
index a76c0b96f6321e076d17e03c39400ba143c9c530..89cdcb92c84d7da40c349b5cbacd4639c775b1d6 100644 (file)
@@ -17,21 +17,21 @@ typedef struct {
        CELL call_count;
        /* UNTAGGED amount of memory allocated in word */
        CELL allot_count;
-} WORD;
+} F_WORD;
 
-INLINE WORD* untag_word(CELL tagged)
+INLINE F_WORD* untag_word(CELL tagged)
 {
        type_check(WORD_TYPE,tagged);
-       return (WORD*)UNTAG(tagged);
+       return (F_WORD*)UNTAG(tagged);
 }
 
-INLINE CELL tag_word(WORD* word)
+INLINE CELL tag_word(F_WORD* word)
 {
        return RETAG(word,WORD_TYPE);
 }
 
-WORD* word(CELL primitive, CELL parameter, CELL plist);
-void update_xt(WORD* word);
+F_WORD* word(CELL primitive, CELL parameter, CELL plist);
+void update_xt(F_WORD* word);
 void primitive_word(void);
 void primitive_word_hashcode(void);
 void primitive_word_primitive(void);
@@ -47,5 +47,5 @@ void primitive_set_word_call_count(void);
 void primitive_word_allot_count(void);
 void primitive_set_word_allot_count(void);
 void primitive_word_compiledp(void);
-void fixup_word(WORD* word);
-void collect_word(WORD* word);
+void fixup_word(F_WORD* word);
+void collect_word(F_WORD* word);
index 70c81b7fe315908f3b061565633408173a6bd855..a781756b267d7488c20f713e5ff2de81ac62fb4a 100644 (file)
@@ -1,11 +1,11 @@
 #include "factor.h"
 
 /* Return true if write was done */
-void write_step(PORT* port)
+void write_step(F_PORT* port)
 {
-       BYTE* chars = (BYTE*)untag_string(port->buffer) + sizeof(STRING);
+       BYTE* chars = (BYTE*)untag_string(port->buffer) + sizeof(F_STRING);
 
-       FIXNUM amount = write(port->fd,chars + port->buf_pos,
+       F_FIXNUM amount = write(port->fd,chars + port->buf_pos,
                port->buf_fill - port->buf_pos);
 
        if(amount == -1)
@@ -17,7 +17,7 @@ void write_step(PORT* port)
                port->buf_pos += amount;
 }
 
-bool can_write(PORT* port, FIXNUM len)
+bool can_write(F_PORT* port, F_FIXNUM len)
 {
        CELL buf_capacity;
 
@@ -38,8 +38,8 @@ bool can_write(PORT* port, FIXNUM len)
 
 void primitive_can_write(void)
 {
-       PORT* port;
-       FIXNUM len;
+       F_PORT* port;
+       F_FIXNUM len;
 
        maybe_garbage_collection();
        
@@ -61,7 +61,7 @@ void primitive_add_write_io_task(void)
                write_io_tasks,&write_fd_count);
 }
 
-bool perform_write_io_task(PORT* port)
+bool perform_write_io_task(F_PORT* port)
 {
        if(port->buf_pos == port->buf_fill || port->io_error != F)
        {
@@ -77,7 +77,7 @@ bool perform_write_io_task(PORT* port)
        }
 }
 
-void write_char_8(PORT* port, FIXNUM ch)
+void write_char_8(F_PORT* port, F_FIXNUM ch)
 {
        BYTE c = (BYTE)ch;
 
@@ -86,21 +86,21 @@ void write_char_8(PORT* port, FIXNUM ch)
        if(!can_write(port,1))
                io_error(__FUNCTION__);
 
-       bput((CELL)untag_string(port->buffer) + sizeof(STRING) + port->buf_fill,c);
+       bput((CELL)untag_string(port->buffer) + sizeof(F_STRING) + port->buf_fill,c);
        port->buf_fill++;
 }
 
 /* Caller must ensure buffer is of the right size. */
-void write_string_raw(PORT* port, BYTE* str, CELL len)
+void write_string_raw(F_PORT* port, BYTE* str, CELL len)
 {
        /* Append string to buffer */
-       memcpy((void*)((CELL)untag_string(port->buffer) + sizeof(STRING)
+       memcpy((void*)((CELL)untag_string(port->buffer) + sizeof(F_STRING)
                + port->buf_fill),str,len);
 
        port->buf_fill += len;
 }
 
-void write_string_8(PORT* port, STRING* str)
+void write_string_8(F_PORT* port, F_STRING* str)
 {
        BYTE* c_str;
        
@@ -116,9 +116,9 @@ void write_string_8(PORT* port, STRING* str)
 
 void primitive_write_8(void)
 {
-       PORT* port;
+       F_PORT* port;
        CELL text, type;
-       STRING* str;
+       F_STRING* str;
 
        maybe_garbage_collection();
 
index a42bb2cf71899034aa26b90024cf8c36bdf51261..64cb51eb94a9ad587cc73da4a979b66c6c87bdeb 100644 (file)
@@ -1,9 +1,9 @@
-void write_step(PORT* port);
-bool can_write(PORT* port, FIXNUM len);
+void write_step(F_PORT* port);
+bool can_write(F_PORT* port, F_FIXNUM len);
 void primitive_can_write(void);
 void primitive_add_write_io_task(void);
-bool perform_write_io_task(PORT* port);
-void write_char_8(PORT* port, FIXNUM ch);
-void write_string_raw(PORT* port, BYTE* str, CELL len);
-void write_string_8(PORT* port, STRING* str);
+bool perform_write_io_task(F_PORT* port);
+void write_char_8(F_PORT* port, F_FIXNUM ch);
+void write_string_raw(F_PORT* port, BYTE* str, CELL len);
+void write_string_8(F_PORT* port, F_STRING* str);
 void primitive_write_8(void);