blackbox support - unary operations
| 528 | |
| 529 | /// blackbox support - unary operations |
| 530 | BOOLEAN pyobject_Op1(int op, leftv res, leftv head) |
| 531 | { |
| 532 | switch(op) |
| 533 | { |
| 534 | case INT_CMD: // built-in return types first |
| 535 | { |
| 536 | long value = PyInt_AsLong(PythonCastStatic<>(head)); |
| 537 | if( (value == -1) && PyErr_Occurred() ) |
| 538 | { |
| 539 | WerrorS("'pyobject` cannot be converted to integer"); |
| 540 | PyErr_Clear(); |
| 541 | return TRUE; |
| 542 | } |
| 543 | res->data = (void*) value; |
| 544 | res->rtyp = INT_CMD; |
| 545 | return FALSE; |
| 546 | } |
| 547 | case TYPEOF_CMD: |
| 548 | res->data = (void*) omStrDup("pyobject"); |
| 549 | res->rtyp = STRING_CMD; |
| 550 | return FALSE; |
| 551 | } |
| 552 | |
| 553 | if (!PythonCastStatic<>(head)(op).assign_to(res)) |
| 554 | return FALSE; |
| 555 | |
| 556 | BOOLEAN newstruct_Op1(int, leftv, leftv); // forward declaration |
| 557 | return newstruct_Op1(op, res, head); |
| 558 | } |
| 559 | |
| 560 | |
| 561 | /// blackbox support - binary operations |
nothing calls this directly
no test coverage detected