| 16 | // available, GB_Type_compatible should be called instead. |
| 17 | |
| 18 | static inline bool GB_code_compatible // true if two types can be typecast |
| 19 | ( |
| 20 | const GB_Type_code acode, // type code of a |
| 21 | const GB_Type_code bcode // type code of b |
| 22 | ) |
| 23 | { |
| 24 | |
| 25 | bool a_user = (acode == GB_UDT_code) ; |
| 26 | bool b_user = (bcode == GB_UDT_code) ; |
| 27 | |
| 28 | if (a_user || b_user) |
| 29 | { |
| 30 | // both a and b must be user-defined. They should be the same |
| 31 | // user-defined type, but the caller does not have the actual type, |
| 32 | // just the code. |
| 33 | return (a_user && b_user) ; |
| 34 | } |
| 35 | else |
| 36 | { |
| 37 | // any built-in domain is compatible with any other built-in domain |
| 38 | return (true) ; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | #endif |
| 43 |
no outgoing calls
no test coverage detected