mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 22:30:12 +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. */
|
/* Output translation of type array. */
|
||||||
{
|
{
|
||||||
type T;
|
type T;
|
||||||
unsigned long Size;
|
long Size;
|
||||||
|
|
||||||
/* Walk over the complete string */
|
/* Walk over the complete string */
|
||||||
while ((T = *Type++) != T_END) {
|
while ((T = *Type++) != T_END) {
|
||||||
@ -297,7 +297,7 @@ void PrintType (FILE* F, const type* Type)
|
|||||||
/* Recursive call */
|
/* Recursive call */
|
||||||
PrintType (F, Type + DECODE_SIZE);
|
PrintType (F, Type + DECODE_SIZE);
|
||||||
Size = Decode (Type);
|
Size = Decode (Type);
|
||||||
if (Size == 0) {
|
if (Size == UNSPECIFIED) {
|
||||||
fprintf (F, "[]");
|
fprintf (F, "[]");
|
||||||
} else {
|
} else {
|
||||||
fprintf (F, "[%lu]", Size);
|
fprintf (F, "[%lu]", Size);
|
||||||
@ -484,7 +484,7 @@ unsigned SizeOf (const type* T)
|
|||||||
|
|
||||||
case T_ARRAY:
|
case T_ARRAY:
|
||||||
ElementCount = GetElementCount (T);
|
ElementCount = GetElementCount (T);
|
||||||
if (ElementCount < 0) {
|
if (ElementCount == UNSPECIFIED) {
|
||||||
/* Array with unspecified size */
|
/* Array with unspecified size */
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
@ -763,7 +763,7 @@ long GetElementCount (const type* T)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
CHECK (IsTypeArray (T));
|
CHECK (IsTypeArray (T));
|
||||||
return (unsigned) Decode (T+1);
|
return Decode (T+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user