| 712 | } |
| 713 | |
| 714 | NULLCFuncPtr<> __redirect(NULLCRef r, NULLCArray<int>* arr, void* unused) |
| 715 | { |
| 716 | unsigned int *funcs = (unsigned int*)arr->ptr; |
| 717 | NULLCFuncPtr<> ret; |
| 718 | if(r.typeID > arr->size) |
| 719 | { |
| 720 | nullcThrowError("ERROR: type index is out of bounds of redirection table"); |
| 721 | return ret; |
| 722 | } |
| 723 | // If there is no implementation for a method |
| 724 | if(!funcs[r.typeID]) |
| 725 | { |
| 726 | // Find implemented function ID as a type reference |
| 727 | unsigned int found = 0; |
| 728 | for(; found < arr->size; found++) |
| 729 | { |
| 730 | if(funcs[found]) |
| 731 | break; |
| 732 | } |
| 733 | //if(found == arr->size) |
| 734 | nullcThrowError("ERROR: type '%s' doesn't implement method", nullcGetTypeName(r.typeID)); |
| 735 | //else |
| 736 | // nullcThrowError("ERROR: type '%s' doesn't implement method '%s%s' of type '%s'", nullcGetTypeName(r.typeID), nullcGetTypeName(r.typeID), strchr(nullcGetFunctionName(funcs[found]), ':'), nullcGetTypeName(nullcGetFunctionType(funcs[found]))); |
| 737 | return ret; |
| 738 | } |
| 739 | ret.context = r.ptr; |
| 740 | ret.id = funcs[r.typeID]; |
| 741 | return ret; |
| 742 | } |
| 743 | |
| 744 | |
| 745 | NULLCArray<char>* __operatorSet(NULLCArray<char>* dst, NULLCArray<int> src, void* unused) |
nothing calls this directly
no test coverage detected