From a3039d57fce6ecfef23deddbbe3c4986e46e2be6 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 10 Jun 2004 13:03:28 +0000 Subject: [PATCH] Fixed problems on 64 bit platforms and some other sloopyness when working with the element count of an array. git-svn-id: svn://svn.cc65.org/cc65/trunk@3120 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/datatype.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc65/datatype.c b/src/cc65/datatype.c index c57ba62ab..c35bb241b 100644 --- a/src/cc65/datatype.c +++ b/src/cc65/datatype.c @@ -244,7 +244,7 @@ void PrintType (FILE* F, const type* Type) /* Output translation of type array. */ { type T; - unsigned long Size; + long Size; /* Walk over the complete string */ while ((T = *Type++) != T_END) { @@ -297,7 +297,7 @@ void PrintType (FILE* F, const type* Type) /* Recursive call */ PrintType (F, Type + DECODE_SIZE); Size = Decode (Type); - if (Size == 0) { + if (Size == UNSPECIFIED) { fprintf (F, "[]"); } else { fprintf (F, "[%lu]", Size); @@ -484,7 +484,7 @@ unsigned SizeOf (const type* T) case T_ARRAY: ElementCount = GetElementCount (T); - if (ElementCount < 0) { + if (ElementCount == UNSPECIFIED) { /* Array with unspecified size */ return 0; } else { @@ -763,7 +763,7 @@ long GetElementCount (const type* T) */ { CHECK (IsTypeArray (T)); - return (unsigned) Decode (T+1); + return Decode (T+1); }