Generate BLR for a negated zero (take care about possible DECFLOAT).
| 7634 | |
| 7635 | // Generate BLR for a negated zero (take care about possible DECFLOAT). |
| 7636 | void LiteralNode::genNegZero(DsqlCompilerScratch* dsqlScratch, int prec) |
| 7637 | { |
| 7638 | char buf[32]; // 18 bytes for max number of digits + some reserve |
| 7639 | char* s = buf; |
| 7640 | *s++ = '-'; |
| 7641 | *s++ = '0'; |
| 7642 | |
| 7643 | if (prec) |
| 7644 | { |
| 7645 | *s++ = '.'; |
| 7646 | while (prec--) |
| 7647 | *s++ = '0'; |
| 7648 | } |
| 7649 | *s = 0; |
| 7650 | |
| 7651 | dsc desc; |
| 7652 | desc.dsc_dtype = dtype_double; |
| 7653 | desc.dsc_scale = 0; |
| 7654 | desc.dsc_length = sizeof(double); |
| 7655 | desc.dsc_address = (UCHAR*) buf; |
| 7656 | |
| 7657 | GEN_descriptor(dsqlScratch, &desc, true); |
| 7658 | |
| 7659 | const USHORT len = static_cast<USHORT>(s - buf); |
| 7660 | dsqlScratch->appendUShort(len); |
| 7661 | if (len) |
| 7662 | dsqlScratch->appendBytes(desc.dsc_address, len); |
| 7663 | } |
| 7664 | |
| 7665 | // Generate BLR for a constant. |
| 7666 | void LiteralNode::genConstant(DsqlCompilerScratch* dsqlScratch, const dsc* desc, bool negateValue, USHORT numStringLength) |
nothing calls this directly
no test coverage detected