@@ -90,13 +90,13 @@ [OFSecureData preallocateMemoryWithSize: class_getInstanceSize([OFSHA512Hash class])]; sandbox = [[OFSandbox alloc] init]; @try { - [sandbox setAllowsStdIO: true]; - [sandbox setAllowsReadingFiles: true]; - [sandbox setAllowsUserDatabaseReading: true]; + sandbox.allowsStdIO = true; + sandbox.allowsReadingFiles = true; + sandbox.allowsUserDatabaseReading = true; for (OFString *path in arguments) { if (first) { first = false; continue; @@ -120,14 +120,14 @@ [OFLocale addLanguageDirectory: @LANGUAGE_DIR]; #else [OFLocale addLanguageDirectory: @"PROGDIR:/share/ofhash/lang"]; #endif - if ([arguments count] < 2) + if (arguments.count < 2) help(); - if ((hash = hashForName([arguments firstObject])) == nil) + if ((hash = hashForName(arguments.firstObject)) == nil) help(); for (OFString *path in arguments) { void *pool; OFStream *file; @@ -147,36 +147,36 @@ @try { file = [OFFile fileWithPath: path mode: @"r"]; } @catch (OFOpenItemFailedException *e) { OFString *error = [OFString - stringWithCString: strerror([e errNo]) + stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; [of_stderr writeLine: OF_LOCALIZED( @"failed_to_open_file", @"Failed to open file %[file]: %[error]", - @"file", [e path], + @"file", e.path, @"error", error)]; exitStatus = 1; goto outer_loop_end; } } [hash reset]; - while (![file isAtEndOfStream]) { + while (!file.atEndOfStream) { uint8_t buffer[1024]; size_t length; @try { length = [file readIntoBuffer: buffer length: 1024]; } @catch (OFReadFailedException *e) { OFString *error = [OFString - stringWithCString: strerror([e errNo]) + stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; [of_stderr writeLine: OF_LOCALIZED( @"failed_to_read_file", @"Failed to read %[file]: %[error]", @@ -191,12 +191,12 @@ length: length]; } [file close]; - digest = [hash digest]; - digestSize = [[hash class] digestSize]; + digest = hash.digest; + digestSize = hash.digestSize; for (size_t i = 0; i < digestSize; i++) [of_stdout writeFormat: @"%02x", digest[i]]; [of_stdout writeFormat: @" %@\n", path];