Changeset 330:cd1ac06b5601 in finroc_core-java


Ignore:
Timestamp:
03.12.2019 14:39:49 (6 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
default
Phase:
public
Message:

Adapts to changes in rrlib_rtti_conversion (support for single static casts operations from/to underlying types of underlying types)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remote/RemoteRuntime.java

    r327 r330  
    283283        RemoteTypeConversion staticCast = getTypeConversionOperation(RemoteTypeConversion.SupportedTypeFilter.STATIC_CAST); 
    284284        if (sourceType.getUnderlyingType() > 0) { 
    285             fromSourceType.add(new GetCastOperationEntry(staticCast, remoteTypes.get(sourceType.getUnderlyingType()), (sourceType.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     285            GetCastOperationEntry entry = new GetCastOperationEntry(staticCast, remoteTypes.get(sourceType.getUnderlyingType()), (sourceType.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0); 
     286            fromSourceType.add(entry); 
     287            if (entry.intermediateType.getUnderlyingType() > 0) { 
     288                fromSourceType.add(new GetCastOperationEntry(staticCast, remoteTypes.get(entry.intermediateType.getUnderlyingType()), entry.implicitCast && (entry.intermediateType.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     289            } 
    286290        } 
    287291        for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    288292            RemoteType type = remoteTypes.get(i); 
    289             if (type.getUnderlyingType() == sourceUid && (type.getTypeTraits() & DataTypeBase.IS_REINTERPRET_CAST_FROM_UNDERLYING_TYPE_VALID) != 0) { 
    290                 fromSourceType.add(new GetCastOperationEntry(staticCast, type, (sourceType.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     293            if (type.getUnderlyingType() > 0 && (type.getTypeTraits() & DataTypeBase.IS_REINTERPRET_CAST_FROM_UNDERLYING_TYPE_VALID) != 0) { 
     294                if (type.getUnderlyingType() == sourceUid) { 
     295                    fromSourceType.add(new GetCastOperationEntry(staticCast, type, (type.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     296                } else { 
     297                    RemoteType interType = remoteTypes.get(type.getUnderlyingType()); 
     298                    if (interType.getUnderlyingType() == sourceUid && (interType.getTypeTraits() & DataTypeBase.IS_REINTERPRET_CAST_FROM_UNDERLYING_TYPE_VALID) != 0) { 
     299                        fromSourceType.add(new GetCastOperationEntry(staticCast, type, (type.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0 && (interType.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     300                    } 
     301                } 
    291302            } 
    292303        } 
     
    298309        } 
    299310        if (destinationType.getUnderlyingType() > 0 && (destinationType.getTypeTraits() & DataTypeBase.IS_REINTERPRET_CAST_FROM_UNDERLYING_TYPE_VALID) != 0) { 
    300             fromDestinationType.add(new GetCastOperationEntry(staticCast, remoteTypes.get(destinationType.getUnderlyingType()), (sourceType.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     311            GetCastOperationEntry entry = new GetCastOperationEntry(staticCast, remoteTypes.get(destinationType.getUnderlyingType()), (destinationType.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0); 
     312            fromDestinationType.add(entry); 
     313            if (entry.intermediateType.getUnderlyingType() > 0 && (entry.intermediateType.getTypeTraits() & DataTypeBase.IS_REINTERPRET_CAST_FROM_UNDERLYING_TYPE_VALID) != 0) { 
     314                fromSourceType.add(new GetCastOperationEntry(staticCast, remoteTypes.get(entry.intermediateType.getUnderlyingType()), entry.implicitCast && (entry.intermediateType.getTypeTraits() & DataTypeBase.IS_CAST_FROM_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     315            } 
    301316        } 
    302317        for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    303318            RemoteType type = remoteTypes.get(i); 
    304             if (type.getUnderlyingType() == destinationUid) { 
    305                 fromDestinationType.add(new GetCastOperationEntry(staticCast, type, (sourceType.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     319            if (type.getUnderlyingType() > 0) { 
     320                if (type.getUnderlyingType() == destinationUid) { 
     321                    fromDestinationType.add(new GetCastOperationEntry(staticCast, type, (type.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     322                } else { 
     323                    RemoteType interType = remoteTypes.get(type.getUnderlyingType()); 
     324                    if (interType.getUnderlyingType() == destinationUid) { 
     325                        fromDestinationType.add(new GetCastOperationEntry(staticCast, type, (type.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0 && (interType.getTypeTraits() & DataTypeBase.IS_CAST_TO_UNDERLYING_TYPE_IMPLICIT) != 0)); 
     326                    } 
     327                } 
    306328            } 
    307329        } 
Note: See TracChangeset for help on using the changeset viewer.