#if defined(__z80) || defined(__gbz80) || defined(__hc08)
typedef unsigned char * va_list;
-#define va_start(marker, last) { marker = (unsigned char *)&last + sizeof(last); }
+#define va_start(marker, last) { marker = (va_list)&last + sizeof(last); }
#define va_arg(marker, type) *((type *)((marker += sizeof(type)) - sizeof(type)))
#elif defined(__ds390) || defined(__ds400)
typedef unsigned char * va_list;
-#define va_start(marker, first) { marker = &first; }
+#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type *)(marker -= sizeof(type)))
#elif defined(SDCC_USE_XSTACK)
typedef unsigned char __pdata * va_list;
-#define va_start(marker, first) { marker = (va_list)((char __pdata *)&first); }
+#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type __pdata *)(marker -= sizeof(type)))
#else
typedef unsigned char __data * va_list;
-#define va_start(marker, first) { marker = (va_list) ((char __data * )&first); }
+#define va_start(marker, first) { marker = (va_list)&first; }
#define va_arg(marker, type) *((type __data * )(marker -= sizeof(type)))
#endif
}
/*-----------------------------------------------------------------*/
-/* newBucket - allocates & returns a new bucket */
+/* newBucket - allocates & returns a new bucket */
/*-----------------------------------------------------------------*/
bucket *
newBucket ()
int checkType)
{
int i; /* index into the hash Table */
- bucket *bp; /* temp bucket * */
+ bucket *bp; /* temp bucket * */
if (checkType) {
symbol *csym = (symbol *)sym;
/* get a free entry */
bp = Safe_alloc ( sizeof (bucket));
- bp->sym = sym; /* update the symbol pointer */
- bp->level = level; /* update the nest level */
+ bp->sym = sym; /* update the symbol pointer */
+ bp->level = level; /* update the nest level */
bp->block = block;
strncpyz (bp->name, sname, sizeof(bp->name)); /* copy the name into place */
}
/*-----------------------------------------------------------------*/
-/* deleteSym - deletes a symbol from the hash Table entry */
+/* deleteSym - deletes a symbol from the hash Table entry */
/*-----------------------------------------------------------------*/
void
deleteSym (bucket ** stab, void *sym, char *sname)
}
/*-----------------------------------------------------------------*/
-/* findSym - finds a symbol in a table */
+/* findSym - finds a symbol in a table */
/*-----------------------------------------------------------------*/
void *
findSym (bucket ** stab, void *sym, const char *sname)
return dest;
}
-/*------------------------------------------------------------------*/
+/*-------------------------------------------------------------------*/
/* genSymName - generates and returns a name used for anonymous vars */
-/*------------------------------------------------------------------*/
+/*-------------------------------------------------------------------*/
char *
genSymName (int level)
{
}
/*------------------------------------------------------------------*/
-/* newFixed16x16Link - a new Float type */
+/* newFixed16x16Link - a new Float type */
/*------------------------------------------------------------------*/
sym_link *
newFixed16x16Link ()
}
/*------------------------------------------------------------------*/
-/* reverseSyms - reverses the links for a symbol chain */
+/* reverseSyms - reverses the links for a symbol chain */
/*------------------------------------------------------------------*/
symbol *
reverseSyms (symbol * sym)
}
/*------------------------------------------------------------------*/
-/* reverseLink - reverses the links for a type chain */
+/* reverseLink - reverses the links for a type chain */
/*------------------------------------------------------------------*/
sym_link *
reverseLink (sym_link * type)
}
/*------------------------------------------------------------------*/
-/* checkDecl - does semantic validation of a declaration */
+/* checkDecl - does semantic validation of a declaration */
/*------------------------------------------------------------------*/
int
checkDecl (symbol * sym, int isProto)
{
- checkSClass (sym, isProto); /* check the storage class */
- changePointer (sym->type); /* change pointers if required */
+ checkSClass (sym, isProto); /* check the storage class */
+ changePointer (sym->type); /* change pointers if required */
/* if this is an array without any dimension
then update the dimension from the initial value */
(IS_GENPTR (dest) ||
((DCL_TYPE(src) == POINTER) && (DCL_TYPE(dest) == IPOINTER))
))
- return -1;
+ {
+ if (compareType (dest->next, src->next))
+ return -1;
+ else
+ return 0;
+ }
if (IS_PTR (dest) && IS_ARRAY (src))
{
value *val=aggregateToPointer (valFromType(src));
return 0;
}
+ if (IS_PTR (src) && IS_VOID (dest))
+ return -1;
+
/* if one is a specifier and the other is not */
if ((IS_SPEC (src) && !IS_SPEC (dest)) ||
(IS_SPEC (dest) && !IS_SPEC (src)))
}
/*------------------------------------------------------------------*/
-/* inCalleeSaveList - return 1 if found in callee save list */
+/* inCalleeSaveList - return 1 if found in callee save list */
/*------------------------------------------------------------------*/
static int
calleeCmp(void *p1, void *p2)