/* don't indent comments & labels */
if (head->line &&
(*head->line == ';' ||
- head->line[strlen (head->line) - 1] == ':'))
+ head->line[strlen (head->line) - 1] == ':')) {
fprintf (of, "%s\n", head->line);
- else
+ } else {
+ if (head->isInline && *head->line=='#') {
+ // comment out preprocessor directives in inline asm
+ fprintf (of, ";");
+ }
fprintf (of, "\t%s\n", head->line);
+ }
head = head->next;
}
}
/* first get the value of the variable */
vvx = *s;
- /* the value is ended by a ',' or space or newline or null */
+ /* the value is ended by a ',' or space or newline or null or ) */
while (*vvx &&
*vvx != ',' &&
!isspace (*vvx) &&
*vvx != '\n' &&
- *vvx != ':')
+ *vvx != ':' &&
+ *vvx != ')')
{
char ubb = 0;
/* if we find a '(' then we need to balance it */
{
lineNode *cl = NULL;
lineNode *pl = NULL, *lhead = NULL;
- char lb[MAX_PATTERN_LEN];
+ /* a long function name and long variable name can evaluate to
+ 4x max pattern length e.g. "mov dptr,((fie_var>>8)<<8)+fie_var" */
+ char lb[MAX_PATTERN_LEN*4];
char *lbp;
lineNode *comment = NULL;
l++;
continue;
}
- while (*v)
+ while (*v) {
*lbp++ = *v++;
+ }
l++;
- while (isdigit (*l))
+ while (isdigit (*l)) {
l++;
+ }
continue;
}
*lbp++ = *l++;
for (spl = *pls; spl; spl = spl->next)
{
-
/* if inline assembler then no peep hole */
if (spl->isInline)
continue;