From d2ebc47c1ee3fb2b4577bd182a0635c4c74fbe5e Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Tue, 29 Jul 2014 20:03:10 -0600 Subject: [PATCH] =?UTF-8?q?Have=20Sparkle=E2=80=99s=20error=20codes=20be?= =?UTF-8?q?=20defined=20using=20NS=5FENUM.=20This=20has=20the=20benefit=20?= =?UTF-8?q?of=20setting=20their=20size/type=20(OSStatus),=20and=20more=20u?= =?UTF-8?q?sable=20with=20Swift.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sparkle/SUConstants.h | 38 ++++++++++++++++++++------------------ Sparkle/SUConstants.m | 17 ----------------- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index c07d9f40..4072d79a 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -62,26 +62,28 @@ extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This // ----------------------------------------------------------------------------- extern NSString *const SUSparkleErrorDomain; -// Appcast phase errors. -extern OSStatus SUAppcastParseError; -extern OSStatus SUNoUpdateError; -extern OSStatus SUAppcastError; -extern OSStatus SURunningFromDiskImageError; +typedef NS_ENUM(OSStatus, SUError) { + // Appcast phase errors. + SUAppcastParseError = 1000, + SUNoUpdateError = 1001, + SUAppcastError = 1002, + SURunningFromDiskImageError = 1003, -// Downlaod phase errors. -extern OSStatus SUTemporaryDirectoryError; + // Downlaod phase errors. + SUTemporaryDirectoryError = 2000, -// Extraction phase errors. -extern OSStatus SUUnarchivingError; -extern OSStatus SUSignatureError; + // Extraction phase errors. + SUUnarchivingError = 3000, + SUSignatureError = 3001, -// Installation phase errors. -extern OSStatus SUFileCopyFailure; -extern OSStatus SUAuthenticationFailure; -extern OSStatus SUMissingUpdateError; -extern OSStatus SUMissingInstallerToolError; -extern OSStatus SURelaunchError; -extern OSStatus SUInstallationError; -extern OSStatus SUDowngradeError; + // Installation phase errors. + SUFileCopyFailure = 4000, + SUAuthenticationFailure = 4001, + SUMissingUpdateError = 4002, + SUMissingInstallerToolError = 4003, + SURelaunchError = 4004, + SUInstallationError = 4005, + SUDowngradeError = 4006 +}; #endif diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 832391ef..7fcc74e8 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -37,20 +37,3 @@ NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInsta NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain"; NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain"; -OSStatus SUAppcastParseError = 1000; -OSStatus SUNoUpdateError = 1001; -OSStatus SUAppcastError = 1002; -OSStatus SURunningFromDiskImageError = 1003; - -OSStatus SUTemporaryDirectoryError = 2000; - -OSStatus SUUnarchivingError = 3000; -OSStatus SUSignatureError = 3001; - -OSStatus SUFileCopyFailure = 4000; -OSStatus SUAuthenticationFailure = 4001; -OSStatus SUMissingUpdateError = 4002; -OSStatus SUMissingInstallerToolError = 4003; -OSStatus SURelaunchError = 4004; -OSStatus SUInstallationError = 4005; -OSStatus SUDowngradeError = 4006;