aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBExtensionInternals.m
diff options
context:
space:
mode:
Diffstat (limited to 'objectivec/GPBExtensionInternals.m')
-rw-r--r--objectivec/GPBExtensionInternals.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/objectivec/GPBExtensionInternals.m b/objectivec/GPBExtensionInternals.m
index 634c3369..290c82a1 100644
--- a/objectivec/GPBExtensionInternals.m
+++ b/objectivec/GPBExtensionInternals.m
@@ -33,7 +33,7 @@
#import <objc/runtime.h>
#import "GPBCodedInputStream_PackagePrivate.h"
-#import "GPBCodedOutputStream.h"
+#import "GPBCodedOutputStream_PackagePrivate.h"
#import "GPBDescriptor_PackagePrivate.h"
#import "GPBMessage_PackagePrivate.h"
#import "GPBUtilities_PackagePrivate.h"
@@ -45,6 +45,8 @@ static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension,
__attribute__((ns_returns_retained));
GPB_INLINE size_t DataTypeSize(GPBDataType dataType) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wswitch-enum"
switch (dataType) {
case GPBDataTypeBool:
return 1;
@@ -59,6 +61,7 @@ GPB_INLINE size_t DataTypeSize(GPBDataType dataType) {
default:
return 0;
}
+#pragma clang diagnostic pop
}
static size_t ComputePBSerializedSizeNoTagOfObject(GPBDataType dataType, id object) {
@@ -261,6 +264,12 @@ static void WriteArrayIncludingTagsToCodedOutputStream(
}
}
+// Direct access is use for speed, to avoid even internally declaring things
+// read/write, etc. The warning is enabled in the project to ensure code calling
+// protos can turn on -Wdirect-ivar-access without issues.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdirect-ivar-access"
+
void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension,
BOOL isPackedOnStream,
GPBCodedInputStream *input,
@@ -378,3 +387,5 @@ static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension,
return nil;
}
+
+#pragma clang diagnostic pop