mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 06:30:16 +00:00
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
This commit is contained in:
parent
300919d61f
commit
a3039d57fc
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user