| @@ -233,7 +233,10 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) · 232 unmodified lines |
| 233 | 233 | ts = tcc_malloc(sizeof(TokenSym) + len); |
| 234 | 234 | table_ident[i] = ts; |
| 235 | 235 | ts->tok = tok_ident++; |
| 236 | | − ts->sym_define = NULL; |
| 236 | + ts->sym_define.data = tcc_malloc(sizeof(Sym**)); |
| 237 | + ts->sym_define.off = 0; |
| 238 | + ts->sym_define.data[0] = NULL; |
| 239 | + ts->sym_define.size = 1; |
| 237 | 240 | ts->sym_label = NULL; |
| 238 | 241 | ts->sym_struct = NULL; |
| 239 | 242 | ts->sym_identifier = NULL; |
| @@ -1052,52 +1055,62 @@ static int macro_is_equal(const int *a, const int *b) · 812 unmodified lines |
| 1052 | 1055 | ST_INLN void define_push(int v, int macro_type, int *str, Sym *first_arg) |
| 1053 | 1056 | { |
| 1054 | 1057 | Sym *s; |
| 1055 | | − |
| 1058 | + CSym *def; |
| 1056 | 1059 | s = define_find(v); |
| 1057 | 1060 | if (s && !macro_is_equal(s->d, str)) |
| 1058 | 1061 | tcc_warning("%s redefined", get_tok_str(v, NULL)); |
| 1059 | | − |
| 1060 | 1062 | s = sym_push2(&define_stack, v, macro_type, 0); |
| 1061 | 1063 | s->d = str; |
| 1062 | 1064 | s->next = first_arg; |
| 1063 | | − table_ident[v - TOK_IDENT]->sym_define = s; |
| 1065 | + def = &table_ident[v - TOK_IDENT]->sym_define; |
| 1066 | + def->data[def->off] = s; |
| 1064 | 1067 | } |
| 1065 | 1068 | |
| 1066 | 1069 | /* undefined a define symbol. Its name is just set to zero */ |
| 1067 | 1070 | ST_FUNC void define_undef(Sym *s) |
| 1068 | 1071 | { |
| 1069 | 1072 | int v; |
| 1070 | | − v = s->v; |
| 1071 | | − if (v >= TOK_IDENT && v < tok_ident) |
| 1072 | | − table_ident[v - TOK_IDENT]->sym_define = NULL; |
| 1073 | | − s->v = 0; |
| 1073 | + CSym *def; |
| 1074 | + v = s->v - TOK_IDENT; |
| 1075 | + if ((unsigned)v < (unsigned)(tok_ident - TOK_IDENT)){ |
| 1076 | + def = &table_ident[v]->sym_define; |
| 1077 | + def->data[def->off] = NULL; |
| 1078 | + } |
| 1074 | 1079 | } |
| 1075 | 1080 | |
| 1076 | 1081 | ST_INLN Sym *define_find(int v) |
| 1077 | 1082 | { |
| 1083 | + CSym *def; |
| 1078 | 1084 | v -= TOK_IDENT; |
| 1079 | 1085 | if ((unsigned)v >= (unsigned)(tok_ident - TOK_IDENT)) |
| 1080 | 1086 | return NULL; |
| 1081 | | − return table_ident[v]->sym_define; |
| 1087 | + def = &table_ident[v]->sym_define; |
| 1088 | + return def->data[def->off]; |
| 1082 | 1089 | } |
| 1083 | 1090 | |
| 1084 | 1091 | /* free define stack until top reaches 'b' */ |
| 1085 | 1092 | ST_FUNC void free_defines(Sym *b) |
| 1086 | 1093 | { |
| 1087 | | − Sym *top, *top1; |
| 1094 | + Sym *top, *tmp; |
| 1088 | 1095 | int v; |
| 1096 | + CSym *def; |
| 1089 | 1097 | |
| 1090 | 1098 | top = define_stack; |
| 1091 | 1099 | while (top != b) { |
| 1092 | | − top1 = top->prev; |
| 1100 | + tmp = top->prev; |
| 1093 | 1101 | /* do not free args or predefined defines */ |
| 1094 | 1102 | if (top->d) |
| 1095 | 1103 | tok_str_free(top->d); |
| 1096 | | − v = top->v; |
| 1097 | | − if (v >= TOK_IDENT && v < tok_ident) |
| 1098 | | − table_ident[v - TOK_IDENT]->sym_define = NULL; |
| 1104 | + v = top->v - TOK_IDENT; |
| 1105 | + if ((unsigned)v < (unsigned)(tok_ident - TOK_IDENT)){ |
| 1106 | + def = &table_ident[v]->sym_define; |
| 1107 | + if(def->off) |
| 1108 | + def->off = 0; |
| 1109 | + if(def->data[0]) |
| 1110 | + def->data[0] = NULL; |
| 1111 | + } |
| 1099 | 1112 | sym_free(top); |
| 1100 | | − top = top1; |
| 1113 | + top = tmp; |
| 1101 | 1114 | } |
| 1102 | 1115 | define_stack = b; |
| 1103 | 1116 | } |
| @@ -1338,66 +1351,18 @@ static inline void add_cached_include(TCCState *s1, const char *filename, int if · 234 unmodified lines |
| 1338 | 1351 | s1->cached_includes_hash[h] = s1->nb_cached_includes; |
| 1339 | 1352 | } |
| 1340 | 1353 | |
| 1341 | | −static void pragma_parse(TCCState *s1) |
| 1342 | | −{ |
| 1343 | | − int val; |
| 1344 | | − |
| 1345 | | − next(); |
| 1346 | | − if (tok == TOK_pack) { |
| 1347 | | − /* |
| 1348 | | − This may be: |
| 1349 | | − #pragma pack(1) // set |
| 1350 | | − #pragma pack() // reset to default |
| 1351 | | − #pragma pack(push,1) // push & set |
| 1352 | | − #pragma pack(pop) // restore previous |
| 1353 | | − */ |
| 1354 | | − next(); |
| 1355 | | − skip('('); |
| 1356 | | − if (tok == TOK_ASM_pop) { |
| 1357 | | − next(); |
| 1358 | | − if (s1->pack_stack_ptr <= s1->pack_stack) { |
| 1359 | | − stk_error: |
| 1360 | | − tcc_error("out of pack stack"); |
| 1361 | | − } |
| 1362 | | − s1->pack_stack_ptr--; |
| 1363 | | − } else { |
| 1364 | | − val = 0; |
| 1365 | | − if (tok != ')') { |
| 1366 | | − if (tok == TOK_ASM_push) { |
| 1367 | | − next(); |
| 1368 | | − if (s1->pack_stack_ptr >= s1->pack_stack + PACK_STACK_SIZE - 1) |
| 1369 | | − goto stk_error; |
| 1370 | | − s1->pack_stack_ptr++; |
| 1371 | | − skip(','); |
| 1372 | | − } |
| 1373 | | − if (tok != TOK_CINT) { |
| 1374 | | − pack_error: |
| 1375 | | − tcc_error("invalid pack pragma"); |
| 1376 | | − } |
| 1377 | | − val = tokc.i; |
| 1378 | | − if (val < 1 || val > 16 || (val & (val - 1)) != 0) |
| 1379 | | − goto pack_error; |
| 1380 | | − next(); |
| 1381 | | − } |
| 1382 | | − *s1->pack_stack_ptr = val; |
| 1383 | | − skip(')'); |
| 1384 | | − } |
| 1385 | | − } |
| 1386 | | −} |
| 1387 | | − |
| 1388 | 1354 | /* is_bof is true if first non space token at beginning of file */ |
| 1389 | 1355 | ST_FUNC void preprocess(int is_bof) |
| 1390 | 1356 | { |
| 1391 | 1357 | TCCState *s1 = tcc_state; |
| 1392 | 1358 | int i, c, n, saved_parse_flags; |
| 1393 | | − char buf[1024], *q; |
| 1359 | + uint8_t buf[1024], *p; |
| 1394 | 1360 | Sym *s; |
| 1395 | 1361 | |
| 1396 | 1362 | saved_parse_flags = parse_flags; |
| 1397 | | − parse_flags = PARSE_FLAG_PREPROCESS | PARSE_FLAG_TOK_NUM | |
| 1398 | | − PARSE_FLAG_LINEFEED; |
| 1363 | + parse_flags = PARSE_FLAG_PREPROCESS | PARSE_FLAG_TOK_NUM | PARSE_FLAG_LINEFEED; |
| 1399 | 1364 | next_nomacro(); |
| 1400 | | − redo: |
| 1365 | +redo: |
| 1401 | 1366 | switch(tok) { |
| 1402 | 1367 | case TOK_DEFINE: |
| 1403 | 1368 | next_nomacro(); |
| @@ -1420,19 +1385,21 @@ ST_FUNC void preprocess(int is_bof) · 16 unmodified lines |
| 1420 | 1385 | goto read_name; |
| 1421 | 1386 | } else if (ch == '\"') { |
| 1422 | 1387 | c = ch; |
| 1423 | | − read_name: |
| 1388 | +read_name: |
| 1424 | 1389 | inp(); |
| 1425 | | − q = buf; |
| 1390 | + p = buf; |
| 1426 | 1391 | while (ch != c && ch != '\n' && ch != CH_EOF) { |
| 1427 | | − if ((q - buf) < sizeof(buf) - 1) |
| 1428 | | − *q++ = ch; |
| 1392 | + if ((p - buf) < sizeof(buf) - 1) |
| 1393 | + *p++ = ch; |
| 1429 | 1394 | if (ch == '\\') { |
| 1430 | 1395 | if (handle_stray_noerror() == 0) |
| 1431 | | − --q; |
| 1396 | + --p; |
| 1432 | 1397 | } else |
| 1433 | 1398 | inp(); |
| 1434 | 1399 | } |
| 1435 | | − *q = '\0'; |
| 1400 | + if (ch != c) |
| 1401 | + goto include_syntax; |
| 1402 | + *p = '\0'; |
| 1436 | 1403 | minp(); |
| 1437 | 1404 | #if 0 |
| 1438 | 1405 | /* eat all spaces and comments after include */ |
| @@ -1470,6 +1437,8 @@ ST_FUNC void preprocess(int is_bof) · 31 unmodified lines |
| 1470 | 1437 | c = '>'; |
| 1471 | 1438 | } |
| 1472 | 1439 | } |
| 1440 | + if(!buf[0]) |
| 1441 | + tcc_error(" empty filename in #include"); |
| 1473 | 1442 | |
| 1474 | 1443 | if (s1->include_stack_ptr >= s1->include_stack + INCLUDE_STACK_SIZE) |
| 1475 | 1444 | tcc_error("#include recursion too deep"); |
| @@ -1536,8 +1505,7 @@ include_trynext: · 60 unmodified lines |
| 1536 | 1505 | printf("%s: including %s\n", file->prev->filename, file->filename); |
| 1537 | 1506 | #endif |
| 1538 | 1507 | /* update target deps */ |
| 1539 | | − dynarray_add((void ***)&s1->target_deps, &s1->nb_target_deps, |
| 1540 | | − tcc_strdup(buf1)); |
| 1508 | + dynarray_add((void ***)&s1->target_deps, &s1->nb_target_deps, tcc_strdup(buf1)); |
| 1541 | 1509 | /* push current file in stack */ |
| 1542 | 1510 | ++s1->include_stack_ptr; |
| 1543 | 1511 | /* add include file debug info */ |
| @@ -1570,7 +1538,7 @@ include_done: · 26 unmodified lines |
| 1570 | 1538 | file->ifndef_macro = tok; |
| 1571 | 1539 | } |
| 1572 | 1540 | } |
| 1573 | | − c = (define_find(tok) != 0) ^ c; |
| 1541 | + c = !!define_find(tok) ^ c; |
| 1574 | 1542 | do_if: |
| 1575 | 1543 | if (s1->ifdef_stack_ptr >= s1->ifdef_stack + IFDEF_STACK_SIZE) |
| 1576 | 1544 | tcc_error("memory full (ifdef)"); |
| @@ -1594,12 +1562,12 @@ include_done: · 17 unmodified lines |
| 1594 | 1562 | goto skip; |
| 1595 | 1563 | c = expr_preprocess(); |
| 1596 | 1564 | s1->ifdef_stack_ptr[-1] = c; |
| 1597 | | − test_else: |
| 1565 | +test_else: |
| 1598 | 1566 | if (s1->ifdef_stack_ptr == file->ifdef_stack_ptr + 1) |
| 1599 | 1567 | file->ifndef_macro = 0; |
| 1600 | | − test_skip: |
| 1568 | +test_skip: |
| 1601 | 1569 | if (!(c & 1)) { |
| 1602 | | − skip: |
| 1570 | +skip: |
| 1603 | 1571 | preprocess_skip(); |
| 1604 | 1572 | is_bof = 0; |
| 1605 | 1573 | goto redo; |
| @@ -1617,11 +1585,11 @@ include_done: · 11 unmodified lines |
| 1617 | 1585 | /* need to set to zero to avoid false matches if another |
| 1618 | 1586 | #ifndef at middle of file */ |
| 1619 | 1587 | file->ifndef_macro = 0; |
| 1620 | | − while (tok != TOK_LINEFEED) |
| 1621 | | − next_nomacro(); |
| 1622 | 1588 | tok_flags |= TOK_FLAG_ENDIF; |
| 1623 | | − goto the_end; |
| 1624 | 1589 | } |
| 1590 | + next_nomacro(); |
| 1591 | + if (tok != TOK_LINEFEED) |
| 1592 | + tcc_warning("Ignoring: %s", get_tok_str(tok, &tokc)); |
| 1625 | 1593 | break; |
| 1626 | 1594 | case TOK_LINE: |
| 1627 | 1595 | next(); |
| @@ -1632,8 +1600,7 @@ include_done: · 4 unmodified lines |
| 1632 | 1600 | if (tok != TOK_LINEFEED) { |
| 1633 | 1601 | if (tok != TOK_STR) |
| 1634 | 1602 | tcc_error("#line"); |
| 1635 | | − pstrcpy(file->filename, sizeof(file->filename), |
| 1636 | | − (char *)tokc.cstr->data); |
| 1603 | + pstrcpy(file->filename, sizeof(file->filename), (char *)tokc.cstr->data); |
| 1637 | 1604 | } |
| 1638 | 1605 | break; |
| 1639 | 1606 | case TOK_ERROR: |
| @@ -1641,24 +1608,161 @@ include_done: · 1 unmodified line |
| 1641 | 1608 | c = tok; |
| 1642 | 1609 | ch = file->buf_ptr[0]; |
| 1643 | 1610 | skip_spaces(); |
| 1644 | | − q = buf; |
| 1611 | + p = buf; |
| 1645 | 1612 | while (ch != '\n' && ch != CH_EOF) { |
| 1646 | | − if ((q - buf) < sizeof(buf) - 1) |
| 1647 | | − *q++ = ch; |
| 1613 | + if ((p - buf) < sizeof(buf) - 1) |
| 1614 | + *p++ = ch; |
| 1648 | 1615 | if (ch == '\\') { |
| 1649 | 1616 | if (handle_stray_noerror() == 0) |
| 1650 | | − --q; |
| 1617 | + --p; |
| 1651 | 1618 | } else |
| 1652 | 1619 | inp(); |
| 1653 | 1620 | } |
| 1654 | | − *q = '\0'; |
| 1621 | + *p = '\0'; |
| 1655 | 1622 | if (c == TOK_ERROR) |
| 1656 | 1623 | tcc_error("#error %s", buf); |
| 1657 | 1624 | else |
| 1658 | 1625 | tcc_warning("#warning %s", buf); |
| 1659 | 1626 | break; |
| 1660 | 1627 | case TOK_PRAGMA: |
| 1661 | | − pragma_parse(s1); |
| 1628 | + next(); |
| 1629 | + if (tok == TOK_pack && parse_flags & PARSE_FLAG_PACK) { |
| 1630 | + /* |
| 1631 | + This may be: |
| 1632 | + #pragma pack(1) // set |
| 1633 | + #pragma pack() // reset to default |
| 1634 | + #pragma pack(push,1) // push & set |
| 1635 | + #pragma pack(pop) // restore previous |
| 1636 | + */ |
| 1637 | + next(); |
| 1638 | + skip('('); |
| 1639 | + if (tok == TOK_ASM_pop) { |
| 1640 | + next(); |
| 1641 | + if (s1->pack_stack_ptr <= s1->pack_stack) { |
| 1642 | +stk_error: |
| 1643 | + tcc_error("out of pack stack"); |
| 1644 | + } |
| 1645 | + s1->pack_stack_ptr--; |
| 1646 | + } else { |
| 1647 | + int val = 0; |
| 1648 | + if (tok != ')') { |
| 1649 | + if (tok == TOK_ASM_push) { |
| 1650 | + next(); |
| 1651 | + s1->pack_stack_ptr++; |
| 1652 | + if (s1->pack_stack_ptr >= s1->pack_stack + PACK_STACK_SIZE) |
| 1653 | + goto stk_error; |
| 1654 | + skip(','); |
| 1655 | + } |
| 1656 | + if (tok != TOK_CINT) { |
| 1657 | +pack_error: |
| 1658 | + tcc_error("invalid pack pragma"); |
| 1659 | + } |
| 1660 | + val = tokc.i; |
| 1661 | + if (val < 1 || val > 16) |
| 1662 | + goto pack_error; |
| 1663 | + if (val < 1 || val > 16) |
| 1664 | + tcc_error("Value must be greater than 1 is less than or equal to 16"); |
| 1665 | + if ((val & (val - 1)) != 0) |
| 1666 | + tcc_error("Value must be a power of 2 curtain"); |
| 1667 | + next(); |
| 1668 | + } |
| 1669 | + *s1->pack_stack_ptr = val; |
| 1670 | + skip(')'); |
| 1671 | + } |
| 1672 | + }else if (tok == TOK_PUSH_MACRO || tok == TOK_POP_MACRO) { |
| 1673 | + TokenSym *ts; |
| 1674 | + CSym *def; |
| 1675 | + uint8_t *p1; |
| 1676 | + int len, t; |
| 1677 | + t = tok; |
| 1678 | + ch = file->buf_ptr[0]; |
| 1679 | + skip_spaces(); |
| 1680 | + if (ch != '(') |
| 1681 | + goto macro_xxx_syntax; |
| 1682 | + /* XXX: incorrect if comments : use next_nomacro with a special mode */ |
| 1683 | + inp(); |
| 1684 | + skip_spaces(); |
| 1685 | + if (ch == '\"'){ |
| 1686 | + inp(); |
| 1687 | + p = buf; |
| 1688 | + while (ch != '\"' && ch != '\n' && ch != CH_EOF) { |
| 1689 | + if ((p - buf) < sizeof(buf) - 1) |
| 1690 | + *p++ = ch; |
| 1691 | + if (ch == CH_EOB) { |
| 1692 | + --p; |
| 1693 | + handle_stray(); |
| 1694 | + }else |
| 1695 | + inp(); |
| 1696 | + } |
| 1697 | + if(ch != '\"') |
| 1698 | + goto macro_xxx_syntax; |
| 1699 | + *p = '\0'; |
| 1700 | + minp(); |
| 1701 | + next(); |
| 1702 | + }else{ |
| 1703 | + /* computed #pragma macro_xxx for #define xxx */ |
| 1704 | + next(); |
| 1705 | + buf[0] = '\0'; |
| 1706 | + while (tok != ')') { |
| 1707 | + if (tok != TOK_STR) { |
| 1708 | + macro_xxx_syntax: |
| 1709 | + tcc_error("'macro_xxx' expects (\"NAME\")"); |
| 1710 | + } |
| 1711 | + pstrcat(buf, sizeof(buf), (char *)tokc.cstr->data); |
| 1712 | + next(); |
| 1713 | + } |
| 1714 | + } |
| 1715 | + skip (')'); |
| 1716 | + if(!buf[0]) |
| 1717 | + tcc_error(" empty string in #pragma"); |
| 1718 | + /* find TokenSym */ |
| 1719 | + p = buf; |
| 1720 | + while (is_space(*p)) |
| 1721 | + p++; |
| 1722 | + p1 = p; |
| 1723 | + for(;;){ |
| 1724 | + if (!isidnum_table[p[0] - CH_EOF]) |
| 1725 | + break; |
| 1726 | + ++p; |
| 1727 | + } |
| 1728 | + len = p - p1; |
| 1729 | + while (is_space(*p)) |
| 1730 | + p++; |
| 1731 | + if(!p) //'\0' |
| 1732 | + tcc_error("unrecognized string: %s", buf); |
| 1733 | + ts = tok_alloc(p1, len); |
| 1734 | + if(ts){ |
| 1735 | + def = &ts->sym_define; |
| 1736 | + if(t == TOK_PUSH_MACRO){ |
| 1737 | + void *tmp = def->data[def->off]; |
| 1738 | + if(tmp){ |
| 1739 | + def->off++; |
| 1740 | + if(def->off >= def->size){ |
| 1741 | + int size = def->size; |
| 1742 | + size *= 2; |
| 1743 | + if (size >= MACRO_STACK_SIZE) |
| 1744 | + tcc_error("stack full"); |
| 1745 | + def->data = tcc_realloc(def->data, size*sizeof(Sym**)); |
| 1746 | + def->size = size; |
| 1747 | + } |
| 1748 | + def->data[def->off] = tmp; |
| 1749 | + } |
| 1750 | + }else{ |
| 1751 | + if(def->off){ |
| 1752 | + --def->off; |
| 1753 | + }else{ |
| 1754 | + tcc_warning("stack empty"); |
| 1755 | + } |
| 1756 | + } |
| 1757 | + } |
| 1758 | + }else{ |
| 1759 | + fputs("#pragma ", s1->ppfp); |
| 1760 | + while (tok != TOK_LINEFEED){ |
| 1761 | + fputs(get_tok_str(tok, &tokc), s1->ppfp); |
| 1762 | + next(); |
| 1763 | + } |
| 1764 | + goto the_end; |
| 1765 | + } |
| 1662 | 1766 | break; |
| 1663 | 1767 | default: |
| 1664 | 1768 | if (tok == TOK_LINEFEED || tok == '!' || tok == TOK_PPNUM) { |
| @@ -1678,7 +1782,7 @@ include_done: · 13 unmodified lines |
| 1678 | 1782 | /* ignore other preprocess commands or #! for C scripts */ |
| 1679 | 1783 | while (tok != TOK_LINEFEED) |
| 1680 | 1784 | next_nomacro(); |
| 1681 | | − the_end: |
| 1785 | +the_end: |
| 1682 | 1786 | parse_flags = saved_parse_flags; |
| 1683 | 1787 | } |
| 1684 | 1788 | |
| @@ -3030,12 +3134,13 @@ ST_FUNC int tcc_preprocess(TCCState *s1) · 1345 unmodified lines |
| 3030 | 3134 | ch = file->buf_ptr[0]; |
| 3031 | 3135 | tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF; |
| 3032 | 3136 | parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS | |
| 3033 | | − PARSE_FLAG_LINEFEED | PARSE_FLAG_SPACES; |
| 3137 | + PARSE_FLAG_LINEFEED | PARSE_FLAG_SPACES; |
| 3034 | 3138 | token_seen = 0; |
| 3035 | 3139 | line_ref = 0; |
| 3036 | 3140 | file_ref = NULL; |
| 3037 | 3141 | iptr = s1->include_stack_ptr; |
| 3038 | | − |
| 3142 | + tok = TOK_LINEFEED; /* print line */ |
| 3143 | + goto print_line; |
| 3039 | 3144 | for (;;) { |
| 3040 | 3145 | next(); |
| 3041 | 3146 | if (tok == TOK_EOF) { |
| @@ -3043,11 +3148,11 @@ ST_FUNC int tcc_preprocess(TCCState *s1) · 1 unmodified line |
| 3043 | 3148 | } else if (file != file_ref) { |
| 3044 | 3149 | goto print_line; |
| 3045 | 3150 | } else if (tok == TOK_LINEFEED) { |
| 3046 | | − if (!token_seen) |
| 3151 | + if (token_seen) |
| 3047 | 3152 | continue; |
| 3048 | 3153 | ++line_ref; |
| 3049 | | − token_seen = 0; |
| 3050 | | − } else if (!token_seen) { |
| 3154 | + token_seen = 1; |
| 3155 | + } else if (token_seen) { |
| 3051 | 3156 | d = file->line_num - line_ref; |
| 3052 | 3157 | if (file != file_ref || d < 0 || d >= 8) { |
| 3053 | 3158 | print_line: |
| @@ -3055,8 +3160,7 @@ print_line: · 1 unmodified line |
| 3055 | 3160 | s = iptr_new > iptr ? " 1" |
| 3056 | 3161 | : iptr_new < iptr ? " 2" |
| 3057 | 3162 | : iptr_new > s1->include_stack ? " 3" |
| 3058 | | − : "" |
| 3059 | | − ; |
| 3163 | + : ""; |
| 3060 | 3164 | iptr = iptr_new; |
| 3061 | 3165 | fprintf(s1->ppfp, "# %d \"%s\"%s\n", file->line_num, file->filename, s); |
| 3062 | 3166 | } else { |
| @@ -3064,8 +3168,8 @@ print_line: · 1 unmodified line |
| 3064 | 3168 | fputs("\n", s1->ppfp), --d; |
| 3065 | 3169 | } |
| 3066 | 3170 | line_ref = (file_ref = file)->line_num; |
| 3067 | | − token_seen = tok != TOK_LINEFEED; |
| 3068 | | − if (!token_seen) |
| 3171 | + token_seen = tok == TOK_LINEFEED; |
| 3172 | + if (token_seen) |
| 3069 | 3173 | continue; |
| 3070 | 3174 | } |
| 3071 | 3175 | fputs(get_tok_str(tok, &tokc), s1->ppfp); |