Format the runtime sources.
diff --git a/objectivec/GPBRootObject.m b/objectivec/GPBRootObject.m
index bad2f9a..3126440 100644
--- a/objectivec/GPBRootObject.m
+++ b/objectivec/GPBRootObject.m
@@ -73,26 +73,22 @@
// to worry about deallocation. All of the items are added to it at
// startup, and so the keys don't need to be retained/released.
// Keys are NULL terminated char *.
-static const void *GPBRootExtensionKeyRetain(CFAllocatorRef allocator,
- const void *value) {
+static const void *GPBRootExtensionKeyRetain(CFAllocatorRef allocator, const void *value) {
#pragma unused(allocator)
return value;
}
-static void GPBRootExtensionKeyRelease(CFAllocatorRef allocator,
- const void *value) {
+static void GPBRootExtensionKeyRelease(CFAllocatorRef allocator, const void *value) {
#pragma unused(allocator)
#pragma unused(value)
}
static CFStringRef GPBRootExtensionCopyKeyDescription(const void *value) {
const char *key = (const char *)value;
- return CFStringCreateWithCString(kCFAllocatorDefault, key,
- kCFStringEncodingUTF8);
+ return CFStringCreateWithCString(kCFAllocatorDefault, key, kCFStringEncodingUTF8);
}
-static Boolean GPBRootExtensionKeyEqual(const void *value1,
- const void *value2) {
+static Boolean GPBRootExtensionKeyEqual(const void *value1, const void *value2) {
const char *key1 = (const char *)value1;
const char *key2 = (const char *)value2;
return strcmp(key1, key2) == 0;
@@ -117,17 +113,16 @@
if (!gExtensionSingletonDictionary) {
gExtensionSingletonDictionarySemaphore = dispatch_semaphore_create(1);
CFDictionaryKeyCallBacks keyCallBacks = {
- // See description above for reason for using custom dictionary.
- 0,
- GPBRootExtensionKeyRetain,
- GPBRootExtensionKeyRelease,
- GPBRootExtensionCopyKeyDescription,
- GPBRootExtensionKeyEqual,
- GPBRootExtensionKeyHash,
+ // See description above for reason for using custom dictionary.
+ 0,
+ GPBRootExtensionKeyRetain,
+ GPBRootExtensionKeyRelease,
+ GPBRootExtensionCopyKeyDescription,
+ GPBRootExtensionKeyEqual,
+ GPBRootExtensionKeyHash,
};
- gExtensionSingletonDictionary =
- CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &keyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
+ gExtensionSingletonDictionary = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &keyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
gDefaultExtensionRegistry = [[GPBExtensionRegistry alloc] init];
}
@@ -147,8 +142,7 @@
+ (void)globallyRegisterExtension:(GPBExtensionDescriptor *)field {
const char *key = [field singletonNameC];
- dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore,
- DISPATCH_TIME_FOREVER);
+ dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore, DISPATCH_TIME_FOREVER);
CFDictionarySetValue(gExtensionSingletonDictionary, key, field);
dispatch_semaphore_signal(gExtensionSingletonDictionarySemaphore);
}
@@ -189,8 +183,7 @@
// initialized and Message classes ensure their Root was also initialized.
NSAssert(gExtensionSingletonDictionary, @"Startup order broken!");
- dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore,
- DISPATCH_TIME_FOREVER);
+ dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore, DISPATCH_TIME_FOREVER);
id extension = (id)CFDictionaryGetValue(gExtensionSingletonDictionary, key);
// We can't remove the key from the dictionary here (as an optimization),
// two threads could have gone into +resolveClassMethod: for the same method,
@@ -212,8 +205,7 @@
// file.
id extension = ExtensionForName(self, sel);
if (extension != nil) {
- const char *encoding =
- GPBMessageEncodingForSelector(@selector(getClassValue), NO);
+ const char *encoding = GPBMessageEncodingForSelector(@selector(getClassValue), NO);
Class metaClass = objc_getMetaClass(class_getName(self));
IMP imp = imp_implementationWithBlock(^(id obj) {
#pragma unused(obj)
@@ -234,7 +226,6 @@
return NO;
}
-
+ (BOOL)resolveClassMethod:(SEL)sel {
if (GPBResolveExtensionClassMethod(self, sel)) {
return YES;