@@ -32,12 +32,11 @@ #import "OFOutOfRangeException.h" #import "OFSetWindowsRegistryValueFailedException.h" OF_DIRECT_MEMBERS @interface OFWindowsRegistryKey () -- (instancetype)of_initWithHKey: (HKEY)hKey - close: (bool)close; +- (instancetype)of_initWithHKey: (HKEY)hKey close: (bool)close; @end @implementation OFWindowsRegistryKey + (instancetype)classesRootKey { @@ -67,12 +66,11 @@ { return [[[self alloc] of_initWithHKey: HKEY_USERS close: false] autorelease]; } -- (instancetype)of_initWithHKey: (HKEY)hKey - close: (bool)close +- (instancetype)of_initWithHKey: (HKEY)hKey close: (bool)close { self = [super init]; _hKey = hKey; _close = close; @@ -183,12 +181,11 @@ return [[[OFWindowsRegistryKey alloc] of_initWithHKey: subKey close: true] autorelease]; } -- (OFData *)dataForValueNamed: (OFString *)name - type: (DWORD *)type +- (OFData *)dataForValueNamed: (OFString *)name type: (DWORD *)type { void *pool = objc_autoreleasePoolPush(); BYTE stackBuffer[256], *buffer = stackBuffer; DWORD length = sizeof(stackBuffer); OFMutableData *ret = nil; @@ -268,21 +265,18 @@ status: status]; } - (OFString *)stringForValueNamed: (OFString *)name { - return [self stringForValueNamed: name - type: NULL]; + return [self stringForValueNamed: name type: NULL]; } -- (OFString *)stringForValueNamed: (OFString *)name - type: (DWORD *)typeOut +- (OFString *)stringForValueNamed: (OFString *)name type: (DWORD *)typeOut { void *pool = objc_autoreleasePoolPush(); DWORD type; - OFData *data = [self dataForValueNamed: name - type: &type]; + OFData *data = [self dataForValueNamed: name type: &type]; OFString *ret; if (data == nil) return nil; @@ -340,16 +334,13 @@ objc_autoreleasePoolPop(pool); return [ret autorelease]; } -- (void)setString: (OFString *)string - forValueNamed: (OFString *)name +- (void)setString: (OFString *)string forValueNamed: (OFString *)name { - [self setString: string - forValueNamed: name - type: REG_SZ]; + [self setString: string forValueNamed: name type: REG_SZ]; } - (void)setString: (OFString *)string forValueNamed: (OFString *)name type: (DWORD)type @@ -364,17 +355,14 @@ else { of_string_encoding_t encoding = [OFLocale encoding]; const char *cString = [string cStringWithEncoding: encoding]; size_t length = [string cStringLengthWithEncoding: encoding]; - data = [OFData dataWithItems: cString - count: length + 1]; + data = [OFData dataWithItems: cString count: length + 1]; } - [self setData: data - forValueNamed: name - type: type]; + [self setData: data forValueNamed: name type: type]; objc_autoreleasePoolPop(pool); } - (void)deleteValueNamed: (OFString *)name