From 7457d894f85363f0cb7cd0864aa2cf34e5496e95 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 23 Jan 2009 15:52:28 +0000 Subject: [PATCH] Tweaked the C and C++ backends to take the replacement for Int from the TypeSizes module rather than calculate it locally --- backends/GenerateC.hs | 4 +--- backends/GenerateCPPCSP.hs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/backends/GenerateC.hs b/backends/GenerateC.hs index 4e0c2b9..06a33ff 100644 --- a/backends/GenerateC.hs +++ b/backends/GenerateC.hs @@ -317,9 +317,7 @@ cgetScalarType A.UInt16 = Just "uint16_t" cgetScalarType A.UInt32 = Just "uint32_t" cgetScalarType A.UInt64 = Just "uint64_t" cgetScalarType A.Int8 = Just "int8_t" -cgetScalarType A.Int | cIntSize == 2 = cgetScalarType A.Int16 - | cIntSize == 4 = cgetScalarType A.Int32 - | cIntSize == 8 = cgetScalarType A.Int64 +cgetScalarType A.Int = cgetScalarType cIntReplacement cgetScalarType A.Int16 = Just "int16_t" cgetScalarType A.Int32 = Just "int32_t" cgetScalarType A.Int64 = Just "int64_t" diff --git a/backends/GenerateCPPCSP.hs b/backends/GenerateCPPCSP.hs index d886875..bd40933 100644 --- a/backends/GenerateCPPCSP.hs +++ b/backends/GenerateCPPCSP.hs @@ -648,9 +648,7 @@ cppgetScalarType A.UInt16 = Just "uint16_t" cppgetScalarType A.UInt32 = Just "uint32_t" cppgetScalarType A.UInt64 = Just "uint64_t" cppgetScalarType A.Int8 = Just "int8_t" -cppgetScalarType A.Int | cxxIntSize == 2 = cppgetScalarType A.Int16 - | cxxIntSize == 4 = cppgetScalarType A.Int32 - | cxxIntSize == 8 = cppgetScalarType A.Int64 +cppgetScalarType A.Int = cppgetScalarType cXXIntReplacement cppgetScalarType A.Int16 = Just "int16_t" cppgetScalarType A.Int32 = Just "int32_t" cppgetScalarType A.Int64 = Just "int64_t"