mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
NFC: Ignore some -Wcast-qual warnings in swift-reflection-test.c.
This commit is contained in:
@@ -187,7 +187,10 @@ static int PipeMemoryReader_queryDataLayout(void *Context,
|
||||
|
||||
static void PipeMemoryReader_freeBytes(void *reader_context, const void *bytes,
|
||||
void *context) {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcast-qual"
|
||||
free((void *)bytes);
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
static
|
||||
@@ -652,10 +655,13 @@ int reflectEnumValue(SwiftReflectionContextRef RC,
|
||||
void *outFreeContext = NULL;
|
||||
// !!! FIXME !!! obtain the pointer by properly projecting the enum value
|
||||
// Next lines are a hack to prove the concept.
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcast-qual"
|
||||
const void *rawPtr
|
||||
= PipeMemoryReader_readBytes((void *)&Pipe, EnumInstance, 8, &outFreeContext);
|
||||
uintptr_t instance = *(uintptr_t *)rawPtr & 0xffffffffffffff8ULL;
|
||||
PipeMemoryReader_freeBytes((void *)&Pipe, rawPtr, outFreeContext);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Indirect enum stores the payload as the first field of a closure context
|
||||
swift_typeinfo_t TI = swift_reflection_infoForInstance(RC, instance);
|
||||
|
||||
Reference in New Issue
Block a user