Check that two types can be stored in different components in the same location. They must be the same type, except signed/unsigned integers are considered compatible.
| 2095 | // Check that two types can be stored in different components in the same location. |
| 2096 | // They must be the same type, except signed/unsigned integers are considered compatible. |
| 2097 | static bool checkCompatibleTypes(TBasicType t1, TBasicType t2) { |
| 2098 | if (t1 != t2) { |
| 2099 | if ((t1 == EbtInt8 && t2 == EbtUint8) || |
| 2100 | (t2 == EbtInt8 && t1 == EbtUint8) || |
| 2101 | (t1 == EbtInt16 && t2 == EbtUint16) || |
| 2102 | (t2 == EbtInt16 && t1 == EbtUint16)|| |
| 2103 | (t1 == EbtInt && t2 == EbtUint) || |
| 2104 | (t2 == EbtInt && t1 == EbtUint)|| |
| 2105 | (t1 == EbtInt64 && t2 == EbtUint64) || |
| 2106 | (t2 == EbtInt64 && t1 == EbtUint64)) { |
| 2107 | return true; |
| 2108 | } |
| 2109 | } |
| 2110 | return t1 == t2; |
| 2111 | } |
| 2112 | |
| 2113 | // Compare a new (the passed in) 'range' against the existing set, and see |
| 2114 | // if there are any collisions. |