* */
| 529 | * |
| 530 | */ |
| 531 | void |
| 532 | Constant::Output(std::ostream &out) const |
| 533 | { |
| 534 | //enclose negative numbers in parenthesis to avoid syntax errors such as "--8" |
| 535 | if (!value.empty() && value[0] == '-') { |
| 536 | output_cast(out); |
| 537 | out << "(" << value << ")"; |
| 538 | } else if (type->eType == ePointer && equals(0)){ |
| 539 | // don't output cast for NULL: |
| 540 | if (CGOptions::lang_cpp()) { |
| 541 | if (CGOptions::cpp11()) |
| 542 | out << "nullptr"; |
| 543 | else |
| 544 | out << "NULL"; |
| 545 | } else { |
| 546 | out << "(void*)" << value; |
| 547 | } |
| 548 | } else { |
| 549 | output_cast(out); |
| 550 | out << value; |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | /////////////////////////////////////////////////////////////////////////////// |
| 555 |
nothing calls this directly
no outgoing calls
no test coverage detected