if (ival) {
// set ival's lineno to where the symbol was defined
- setAstLineno (ival, lineno=sym->lineDef);
+ setAstFileLine (ival, filename = sym->fileDef, lineno = sym->lineDef);
// check if this is not a constant expression
if (!constExprTree(ival)) {
werror (E_CONST_EXPECTED, "found expression");
(IS_BITFIELD(lsym->next->type)) &&
(SPEC_BSTR(lsym->next->etype)))) break;
lsym = lsym->next;
- lilist = lilist->next;
+ lilist = lilist ? lilist->next : NULL;
} while (1);
switch (size) {
case 1:
case 2:
dbuf_tprintf (oBuf, "\t!dw !constword\n",ival);
break;
- case 4: /* EEP: why is this db and not dw? */
- dbuf_tprintf (oBuf, "\t!db !constword,!constword\n",
- (ival >> 8) & 0xffff, (ival & 0xffff));
+ case 4:
+ dbuf_tprintf (oBuf, "\t!dw !constword,!constword\n",
+ (ival >> 16) & 0xffff, (ival & 0xffff));
break;
}
*sym = lsym;
sym->rname,
SPEC_ADDR (sym->etype));
}
- else {
+ else
+ {
int size = getSize(sym->type);
if (size==0) {
}
}
-
-/*-----------------------------------------------------------------*/
-/* spacesToUnderscores - replace spaces with underscores */
-/*-----------------------------------------------------------------*/
-static char *
-spacesToUnderscores (char *dest, const char *src, size_t len)
-{
- unsigned int i;
- char *p;
-
- assert(dest != NULL);
- assert(src != NULL);
- assert(len > 0);
-
- --len;
- for (p = dest, i = 0; *src != '\0' && i < len; ++src, ++i) {
- *p++ = isspace((unsigned char)*src) ? '_' : *src;
- }
- *p = '\0';
-
- return dest;
-}
-
-
/*-----------------------------------------------------------------*/
/* glue - the final glue that hold the whole thing together */
/*-----------------------------------------------------------------*/
struct dbuf_s vBuf;
struct dbuf_s ovrBuf;
FILE *asmFile;
- char moduleBuf[PATH_MAX];
int mcs51_like;
dbuf_init (&vBuf, 4096);