From 1ed1edf94d2c57c3622e6d82a5ee78ed4d187598 Mon Sep 17 00:00:00 2001 From: Manoel Trapier Date: Tue, 19 Mar 2013 15:05:37 +0100 Subject: [PATCH] Correct an incoherency with arith and label types. --- lang/cem/cemcom.ansi/arith.h | 4 +++- lang/cem/cemcom/arith.h | 4 +++- lang/cem/cpp.ansi/arith.h | 2 +- modules/h/em_arith.h | 7 ++++++- modules/h/em_code.h | 10 ++++------ modules/h/em_label.h | 3 ++- modules/src/flt_arith/flt_arith.h | 5 +---- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lang/cem/cemcom.ansi/arith.h b/lang/cem/cemcom.ansi/arith.h index b51e7d549..ba4f43145 100644 --- a/lang/cem/cemcom.ansi/arith.h +++ b/lang/cem/cemcom.ansi/arith.h @@ -23,7 +23,9 @@ /* All preprocessor arithmetic should be done in longs. */ -#define arith long /* dummy */ +#include + +typedef int32_t arith; /* dummy */ #endif /* SPECIAL_ARITHMETICS */ diff --git a/lang/cem/cemcom/arith.h b/lang/cem/cemcom/arith.h index 6cdc09bfe..184b6f30e 100644 --- a/lang/cem/cemcom/arith.h +++ b/lang/cem/cemcom/arith.h @@ -22,6 +22,8 @@ #else /* SPECIAL_ARITHMETICS */ /* not implemented yet */ -#define arith int /* dummy */ +#include + +typedef int32_t arith; /* dummy */ #endif /* SPECIAL_ARITHMETICS */ diff --git a/lang/cem/cpp.ansi/arith.h b/lang/cem/cpp.ansi/arith.h index 96dc435af..852e9063c 100644 --- a/lang/cem/cpp.ansi/arith.h +++ b/lang/cem/cpp.ansi/arith.h @@ -20,6 +20,6 @@ #include -#define arith int32_t /* dummy */ +typedef int32_t arith; /* dummy */ #endif /* LANG_CEM_CPP_ANSI_ARITH_H */ diff --git a/modules/h/em_arith.h b/modules/h/em_arith.h index 3387e2760..b1d29165a 100644 --- a/modules/h/em_arith.h +++ b/modules/h/em_arith.h @@ -3,5 +3,10 @@ * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* $Id$ */ +#ifndef H_EM_ARITH_H +#define H_EM_ARITH_H +#include -#define arith long +typedef int32_t arith; + +#endif /* H_EM_ARITH_H */ \ No newline at end of file diff --git a/modules/h/em_code.h b/modules/h/em_code.h index cb2773e9d..04a51504f 100644 --- a/modules/h/em_code.h +++ b/modules/h/em_code.h @@ -8,17 +8,14 @@ #include "em_mesX.h" #include "ansi.h" +#include +#include void C_flush(); void C_internal_error(); void C_putbyte(int c); -#ifndef arith -#define arith long -#endif -#ifndef label -#define label unsigned int -#endif +struct e_instr; _PROTOTYPE(void C_ms_com, (char *)); _PROTOTYPE(void C_ms_ego, (int, arith, arith, int)); @@ -36,6 +33,7 @@ _PROTOTYPE(void C_ms_stb_dnam, (char *, int, int, char *, arith)); _PROTOTYPE(void C_ms_stb_ilb, (char *, int, int, label)); _PROTOTYPE(void C_ms_stb_pnam, (char *, int, int, char *)); _PROTOTYPE(void C_ms_std, (char *, int, int)); +_PROTOTYPE(int C_out, (struct e_instr *p)); #ifdef PEEPHOLE #include "em_codeO.h" diff --git a/modules/h/em_label.h b/modules/h/em_label.h index 1782c27ed..5f748c603 100644 --- a/modules/h/em_label.h +++ b/modules/h/em_label.h @@ -5,7 +5,8 @@ /* $Id$ */ #ifndef H_LABEL_H #define H_LABEL_H +#include -#define label unsigned int +typedef int32_t label; #endif /* H_LABEL_H */ \ No newline at end of file diff --git a/modules/src/flt_arith/flt_arith.h b/modules/src/flt_arith/flt_arith.h index bd6ecb157..9ab6cf102 100644 --- a/modules/src/flt_arith/flt_arith.h +++ b/modules/src/flt_arith/flt_arith.h @@ -8,10 +8,7 @@ #define __FLT_INCLUDED__ #include "ansi.h" - -#ifndef arith -#define arith long -#endif +#include struct flt_mantissa { long flt_h_32; /* high order 32 bits of mantissa */ -- 2.34.1