| 826 | } |
| 827 | |
| 828 | NULLCRef NULLC::AutoArrayAssignRev(NULLCRef left, NULLCAutoArray *right) |
| 829 | { |
| 830 | NULLCRef ret = { 0, 0 }; |
| 831 | if(!nullcIsArray(left.typeID)) |
| 832 | { |
| 833 | nullcThrowError("ERROR: cannot convert from 'auto[]' to '%s'", nullcGetTypeName(left.typeID)); |
| 834 | return ret; |
| 835 | } |
| 836 | if(nullcGetSubType(left.typeID) != right->typeID) |
| 837 | { |
| 838 | nullcThrowError("ERROR: cannot convert from 'auto[]' (actual type '%s[%d]') to '%s'", nullcGetTypeName(right->typeID), right->len, nullcGetTypeName(left.typeID)); |
| 839 | return ret; |
| 840 | } |
| 841 | unsigned int leftLength = nullcGetArraySize(left.typeID); |
| 842 | if(leftLength == ~0u) |
| 843 | { |
| 844 | NULLCArray *arr = (NULLCArray*)left.ptr; |
| 845 | arr->len = right->len; |
| 846 | arr->ptr = right->ptr; |
| 847 | }else{ |
| 848 | if(leftLength != right->len) |
| 849 | { |
| 850 | nullcThrowError("ERROR: cannot convert from 'auto[]' (actual type '%s[%d]') to '%s'", nullcGetTypeName(right->typeID), right->len, nullcGetTypeName(left.typeID)); |
| 851 | return ret; |
| 852 | } |
| 853 | memcpy(left.ptr, right->ptr, leftLength * nullcGetTypeSize(right->typeID)); |
| 854 | } |
| 855 | return left; |
| 856 | } |
| 857 | |
| 858 | NULLCAutoArray* NULLC::AutoArrayAssignSelf(NULLCAutoArray* left, NULLCAutoArray* right) |
| 859 | { |
nothing calls this directly
no test coverage detected