25
25
#include " SwiftRemoteMirrorLegacyInteropTypes.h"
26
26
#include " SwiftRemoteMirror.h"
27
27
28
+ #include < string.h>
28
29
#include < dlfcn.h>
29
30
#include < mach-o/getsect.h>
30
31
@@ -678,14 +679,14 @@ swift_reflection_interop_addImageLegacy(
678
679
}
679
680
680
681
info.LocalStartAddress = (uintptr_t )Buf;
681
- info.RemoteStartAddress = ImageStart;
682
+ info.RemoteStartAddress = ( uintptr_t ) ImageStart;
682
683
683
684
Library->Functions .addReflectionInfoLegacy (Library->Context , info);
684
685
685
686
// Find the data segment and add it to our list.
686
687
unsigned long DataSize;
687
688
const uint8_t *DataSegment = getsegmentdata (Header, " __DATA" , &DataSize);
688
- uintptr_t DataSegmentStart = DataSegment - (const uint8_t *)Buf + ImageStart;
689
+ uintptr_t DataSegmentStart = ( uintptr_t )( DataSegment - (const uint8_t *)Buf + ImageStart) ;
689
690
690
691
struct SwiftReflectionInteropContextLegacyImageRangeList *Node =
691
692
(struct SwiftReflectionInteropContextLegacyImageRangeList *)malloc (sizeof (*Node));
@@ -697,12 +698,12 @@ swift_reflection_interop_addImageLegacy(
697
698
// If the buffer needs to be freed, save buffer and free context to free it when the
698
699
// reflection context is destroyed.
699
700
if (ContextRef->FreeBytes != NULL ) {
700
- struct SwiftReflectionInteropContextFreeList *Node =
701
- (struct SwiftReflectionInteropContextFreeList *)malloc (sizeof (*Node ));
702
- Node ->Next = ContextRef->FreeList ;
703
- Node ->Pointer = Buf;
704
- Node ->Context = FreeContext;
705
- ContextRef->FreeList = Node ;
701
+ struct SwiftReflectionInteropContextFreeList *FreeListNode =
702
+ (struct SwiftReflectionInteropContextFreeList *)malloc (sizeof (*FreeListNode ));
703
+ FreeListNode ->Next = ContextRef->FreeList ;
704
+ FreeListNode ->Pointer = Buf;
705
+ FreeListNode ->Context = FreeContext;
706
+ ContextRef->FreeList = FreeListNode ;
706
707
}
707
708
708
709
return 1 ;
@@ -746,7 +747,7 @@ swift_reflection_interop_lookupMetadata(SwiftReflectionInteropContextRef Context
746
747
swift_reflection_interop_libraryForAddress (ContextRef, Metadata);
747
748
if (Library != NULL ) {
748
749
Result.Metadata = Metadata;
749
- Result.Library = LIBRARY_INDEX;
750
+ Result.Library = ( int ) LIBRARY_INDEX;
750
751
}
751
752
return Result;
752
753
}
@@ -772,7 +773,7 @@ swift_reflection_interop_typeRefForInstance(SwiftReflectionInteropContextRef Con
772
773
swift_typeref_t Typeref = Library->Functions .typeRefForInstance (Library->Context ,
773
774
Object);
774
775
Result.Typeref = Typeref;
775
- Result.Library = LIBRARY_INDEX;
776
+ Result.Library = ( int ) LIBRARY_INDEX;
776
777
}
777
778
return Result;
778
779
}
@@ -790,7 +791,7 @@ swift_reflection_interop_typeRefForMangledTypeName(
790
791
continue ;
791
792
792
793
Result.Typeref = Typeref;
793
- Result.Library = LIBRARY_INDEX;
794
+ Result.Library = ( int ) LIBRARY_INDEX;
794
795
return Result;
795
796
}
796
797
@@ -877,7 +878,7 @@ swift_reflection_interop_childOfInstance(SwiftReflectionInteropContextRef Contex
877
878
Result.Offset = LibResult.Offset ;
878
879
Result.Kind = LibResult.Kind ;
879
880
Result.TR .Typeref = LibResult.TR ;
880
- Result.TR .Library = LIBRARY_INDEX;
881
+ Result.TR .Library = ( int ) LIBRARY_INDEX;
881
882
} else {
882
883
Result.Kind = SWIFT_UNKNOWN;
883
884
}
0 commit comments