From b10f3a3bba4bdcd409dbbf8509c964b423b1dd26 Mon Sep 17 00:00:00 2001
From: zesstra <zesstra@zesstra.de>
Date: Wed, 15 Apr 2009 23:53:14 +0200
Subject: [PATCH 06/12] Removed checks for AMIGA

Amiga systems are anyway not supported any longer.

Signed-off-by: zesstra <zesstra@zesstra.de>
---
 src/alloca.c        |    4 ----
 src/lex.c           |   10 ----------
 src/make_func.y     |    3 ---
 src/object.c        |    4 ++--
 src/slaballoc.c     |    4 ++--
 src/smalloc.c       |    4 ++--
 src/svalue.h        |   47 ++---------------------------------------------
 src/util/overhead.c |    2 +-
 8 files changed, 9 insertions(+), 69 deletions(-)

diff --git a/src/alloca.c b/src/alloca.c
index 9ad5ad4..0b55567 100644
--- a/src/alloca.c
+++ b/src/alloca.c
@@ -48,10 +48,6 @@ typedef void *pointer;  /* generic pointer type */
  * STACK_DIRECTION = 0 => direction of growth unknown
  */
 
-#if defined(AMIGA)
-#    define STACK_DIRECTION -1
-#endif
-
 #ifndef STACK_DIRECTION
 #    define STACK_DIRECTION  0  /* direction unknown */
 #endif
diff --git a/src/lex.c b/src/lex.c
index 80ee8ab..9b59cd3 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -698,11 +698,6 @@ init_lexer(void)
     {
         ident_t *p;
 
-#if defined(AMIGA) && defined(_DCC) && defined(DICE30)
-        if (n >= NELEM(instrs)-1)
-            continue;
-#endif
-
         if (instrs[n].Default == -1)
             continue;
 
@@ -736,11 +731,6 @@ init_lexer(void)
     {
         ident_t *p;
 
-#if defined(AMIGA) && defined(_DCC) && defined(DICE30)
-        if (i >= NELEM(reswords)-1)
-            continue;
-#endif
-
         p = make_shared_identifier(reswords[i].name, I_TYPE_RESWORD, 0);
         if (!p)
             fatal("Out of memory\n");
diff --git a/src/make_func.y b/src/make_func.y
index 2608559..1004a04 100644
--- a/src/make_func.y
+++ b/src/make_func.y
@@ -2703,9 +2703,6 @@ read_machine (void)
 {
     /* Some predefined macros */
 
-#ifdef AMIGA
-    add_define("AMIGA",-1,"");
-#endif
 #ifdef DEBUG
     add_define("DEBUG", -1, "");
 #endif
diff --git a/src/object.c b/src/object.c
index 646d1c6..84708aa 100644
--- a/src/object.c
+++ b/src/object.c
@@ -6871,7 +6871,7 @@ v_save_object (svalue_t *sp, int numarg)
         i = 0; /* Result from efun */
 
         unlink(name);
-#if !defined(MSDOS_FS) && !defined(AMIGA)
+#if !defined(MSDOS_FS)
         if (link(tmp_name, name) == -1)
 #else
         close(f);
@@ -6884,7 +6884,7 @@ v_save_object (svalue_t *sp, int numarg)
             add_message("Failed to save object !\n");
             i = 1;
         }
-#if !defined(MSDOS_FS) && !defined(AMIGA)
+#if !defined(MSDOS_FS)
         close(f);
         unlink(tmp_name);
 #endif
diff --git a/src/slaballoc.c b/src/slaballoc.c
index 7278596..d1cddaa 100644
--- a/src/slaballoc.c
+++ b/src/slaballoc.c
@@ -2092,7 +2092,7 @@ mem_realloc (POINTER p, size_t size)
 
 /* Extra types and definitions for the AVL routines */
 
-#if defined (sun) || defined(AMIGA) || defined(__linux__)
+#if defined (sun) || defined(__linux__)
     /* there is a type signed char */
     typedef signed char balance_t;
 #   define BALANCE_T_BITS 8
@@ -2100,7 +2100,7 @@ mem_realloc (POINTER p, size_t size)
     typedef short balance_t;
 #   define BALANCE_T_BITS 16
 #endif
-#if defined(sparc) || defined(AMIGA)
+#if defined(sparc)
     /* try to avoid multiple shifts, because these are costly */
 #   define NO_BARREL_SHIFT
 #endif
diff --git a/src/smalloc.c b/src/smalloc.c
index 5fd23e7..334e24b 100644
--- a/src/smalloc.c
+++ b/src/smalloc.c
@@ -1885,7 +1885,7 @@ mem_realloc (POINTER p, size_t size)
 
 /* Extra types and definitions for the AVL routines */
 
-#if defined (sun) || defined(AMIGA) || defined(__linux__)
+#if defined (sun) || defined(__linux__)
     /* there is a type signed char */
     typedef signed char balance_t;
 #   define BALANCE_T_BITS 8
@@ -1893,7 +1893,7 @@ mem_realloc (POINTER p, size_t size)
     typedef short balance_t;
 #   define BALANCE_T_BITS 16
 #endif
-#if defined(sparc) || defined(AMIGA)
+#if defined(sparc)
     /* try to avoid multiple shifts, because these are costly */
 #   define NO_BARREL_SHIFT
 #endif
diff --git a/src/svalue.h b/src/svalue.h
index 7ade63b..65365b2 100644
--- a/src/svalue.h
+++ b/src/svalue.h
@@ -334,10 +334,8 @@ struct svalue_s
  * be well below all existing host floating point formats so that we get
  * the same accuracy on all platforms.
  *
- * The functions to encode/decode float numbers exist in two version, one
- * fast one using internal knowledge about how the compiler stores its
- * numbers, and a second portable one. To keep the implementation
- * transparent, the following macros/functions are defined:
+ * To keep the implementation transparent, the following macros/functions are
+ * defined:
  *
  *   int FLOAT_FORMAT:
  *     0 for the portable format, 1 for the fast format.
@@ -360,47 +358,6 @@ struct svalue_s
  *     Declaration of a local variable which STORE_DOUBLE needs.
  */
 
-/* --- The fast format */
-
-#if (defined(AMIGA) && defined(_DCC))
-
-#define FLOAT_FORMAT_1
-
-/* Faster routines, using inline and knowlegde about double format.
- * The exponent isn't actually in 'exponent', but that doesn't really matter
- * as long as the accesses are consistent.
- *
- * The DICE compiler for the Amiga lacks the ldexp() and frexp() functions,
- * therefore these functions here are the only way to get things done.
- *
- * STORE_DOUBLE doesn't do any rounding, but truncates off the least
- * significant bits of the mantissa that won't fit together with the exponent
- * into 48 bits. To compensate for this, we initialise the unknown bits of
- * the mantissa with 0x7fff in READ_DOUBLE . This keeps the maximum precision
- * loss of a store/read pair to the same value as rounding, while being faster
- * and being more stable.
- */
-
-static INLINE
-double READ_DOUBLE(struct svalue *svalue_pnt)
-{        double tmp;
-        (*(long*)&tmp) = svalue_pnt->u.mantissa;
-        ((short*)&tmp)[2] = svalue_pnt->x.exponent;
-        ((short*)&tmp)[3] = 0x7fff;
-        return tmp;
-}
-
-#define SPLIT_DOUBLE(double_value, int_pnt) (\
-            (*(int_pnt) = ((short*)&double_value)[2]),\
-            *((long*)&double_value)\
-        )
-
-#define STORE_DOUBLE_USED
-#define STORE_DOUBLE(dest, double_value) (\
-            (dest)->u.mantissa = *((long*)&double_value),\
-            (dest)->x.exponent = ((short*)&double_value)[2]\
-        )
-#endif
 
 /* --- The portable format, used if no other format is defined */
 
diff --git a/src/util/overhead.c b/src/util/overhead.c
index 63706b8..49e25cf 100644
--- a/src/util/overhead.c
+++ b/src/util/overhead.c
@@ -17,7 +17,7 @@
  */
 
 #include <stdio.h>
-#if defined(HAVE_STDLIB_H) || defined(AMIGA)
+#if defined(HAVE_STDLIB_H)
 #  include <stdlib.h>
 #endif
 #ifdef HAVE_LIBC_H
-- 
1.6.1

