From 58afc19c2607b62cba71b4b97348507973144713 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 2 Feb 2015 14:47:16 -0500 Subject: [PATCH] Make string constants C constants, not macros. --- MasterPassword/C/mpw-util.h | 2 ++ MasterPassword/ObjC/MPTypes.h | 20 ++++++++--------- MasterPassword/ObjC/MPTypes.m | 22 +++++++++++++++++++ .../project.pbxproj | 10 +++++++++ .../project.pbxproj | 4 ++++ MasterPassword/homebrew-mpw.rb | 9 ++++---- 6 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 MasterPassword/ObjC/MPTypes.m diff --git a/MasterPassword/C/mpw-util.h b/MasterPassword/C/mpw-util.h index 41eb6d8a..44ac0644 100644 --- a/MasterPassword/C/mpw-util.h +++ b/MasterPassword/C/mpw-util.h @@ -15,8 +15,10 @@ #define trc(...) fprintf( stderr, __VA_ARGS__ ) #endif #else +#ifndef trc #define trc(...) do {} while (0) #endif +#endif #ifndef ftl #define ftl(...) do { fprintf( stderr, __VA_ARGS__ ); abort(); } while (0) #endif diff --git a/MasterPassword/ObjC/MPTypes.h b/MasterPassword/ObjC/MPTypes.h index 4d86cce7..8b64c6c3 100644 --- a/MasterPassword/ObjC/MPTypes.h +++ b/MasterPassword/ObjC/MPTypes.h @@ -6,15 +6,15 @@ // Copyright (c) 2012 Lyndir. All rights reserved. // -#define MPErrorDomain @"MPErrorDomain" +NSString *const MPErrorDomain; -#define MPSignedInNotification @"MPSignedInNotification" -#define MPSignedOutNotification @"MPSignedOutNotification" -#define MPKeyForgottenNotification @"MPKeyForgottenNotification" -#define MPSiteUpdatedNotification @"MPSiteUpdatedNotification" -#define MPCheckConfigNotification @"MPCheckConfigNotification" -#define MPSitesImportedNotification @"MPSitesImportedNotification" -#define MPFoundInconsistenciesNotification @"MPFoundInconsistenciesNotification" +NSString *const MPSignedInNotification; +NSString *const MPSignedOutNotification; +NSString *const MPKeyForgottenNotification; +NSString *const MPSiteUpdatedNotification; +NSString *const MPCheckConfigNotification; +NSString *const MPSitesImportedNotification; +NSString *const MPFoundInconsistenciesNotification; -#define MPSitesImportedNotificationUserKey @"MPSitesImportedNotificationUserKey" -#define MPInconsistenciesFixResultUserKey @"MPInconsistenciesFixResultUserKey" +NSString *const MPSitesImportedNotificationUserKey; +NSString *const MPInconsistenciesFixResultUserKey; diff --git a/MasterPassword/ObjC/MPTypes.m b/MasterPassword/ObjC/MPTypes.m new file mode 100644 index 00000000..228d5fd0 --- /dev/null +++ b/MasterPassword/ObjC/MPTypes.m @@ -0,0 +1,22 @@ +// +// MPTypes.c +// MasterPassword +// +// Created by Maarten Billemont on 02/01/12. +// Copyright (c) 2012 Lyndir. All rights reserved. +// + +#import "MPTypes.h" + +NSString *const MPErrorDomain = @"MPErrorDomain"; + +NSString *const MPSignedInNotification = @"MPSignedInNotification"; +NSString *const MPSignedOutNotification = @"MPSignedOutNotification"; +NSString *const MPKeyForgottenNotification = @"MPKeyForgottenNotification"; +NSString *const MPSiteUpdatedNotification = @"MPSiteUpdatedNotification"; +NSString *const MPCheckConfigNotification = @"MPCheckConfigNotification"; +NSString *const MPSitesImportedNotification = @"MPSitesImportedNotification"; +NSString *const MPFoundInconsistenciesNotification = @"MPFoundInconsistenciesNotification"; + +NSString *const MPSitesImportedNotificationUserKey = @"MPSitesImportedNotificationUserKey"; +NSString *const MPInconsistenciesFixResultUserKey = @"MPInconsistenciesFixResultUserKey"; diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj index 15ccccda..51a87fa0 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -57,6 +57,8 @@ DA3B8456190FC89700246EEA /* MPFixable.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3B8454190FC89700246EEA /* MPFixable.m */; }; DA3BCFCD19BD09E0006B2681 /* SourceCodePro-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = DA3BCFCC19BD09E0006B2681 /* SourceCodePro-Regular.otf */; }; DA4DA1D91564471A00F6F596 /* libjrswizzle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6326C148680650075AEA5 /* libjrswizzle.a */; }; + DA4DAE941A7D8117003E5423 /* MPAlgorithmV3.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4DAE921A7D8117003E5423 /* MPAlgorithmV3.m */; }; + DA4DAE951A7D8117003E5423 /* MPTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4DAE931A7D8117003E5423 /* MPTypes.m */; }; DA5180CA19FF2F9200A587E9 /* MPAlgorithmV2.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5180C719FF2F9200A587E9 /* MPAlgorithmV2.m */; }; DA5180CE19FF307E00A587E9 /* MPAppDelegate_Store.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5180CD19FF307E00A587E9 /* MPAppDelegate_Store.m */; }; DA5E5C9417248AA1003798D8 /* libscryptenc-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */; }; @@ -328,6 +330,9 @@ DA3B8454190FC89700246EEA /* MPFixable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPFixable.m; sourceTree = ""; }; DA3B8455190FC89700246EEA /* MPFixable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPFixable.h; sourceTree = ""; }; DA3BCFCC19BD09E0006B2681 /* SourceCodePro-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-Regular.otf"; sourceTree = ""; }; + DA4DAE911A7D8117003E5423 /* MPAlgorithmV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV3.h; sourceTree = ""; }; + DA4DAE921A7D8117003E5423 /* MPAlgorithmV3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithmV3.m; sourceTree = ""; }; + DA4DAE931A7D8117003E5423 /* MPTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTypes.m; sourceTree = ""; }; DA5180C619FF2F9200A587E9 /* MPAlgorithmV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV2.h; sourceTree = ""; }; DA5180C719FF2F9200A587E9 /* MPAlgorithmV2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithmV2.m; sourceTree = ""; }; DA5180CC19FF307E00A587E9 /* MPAppDelegate_Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAppDelegate_Store.h; sourceTree = ""; }; @@ -1065,6 +1070,8 @@ DA5E5C9C1724A667003798D8 /* MPAlgorithmV1.m */, DA5180C619FF2F9200A587E9 /* MPAlgorithmV2.h */, DA5180C719FF2F9200A587E9 /* MPAlgorithmV2.m */, + DA4DAE911A7D8117003E5423 /* MPAlgorithmV3.h */, + DA4DAE921A7D8117003E5423 /* MPAlgorithmV3.m */, DA5E5C9D1724A667003798D8 /* MPAppDelegate_Key.h */, DA5E5C9E1724A667003798D8 /* MPAppDelegate_Key.m */, DA5E5C9F1724A667003798D8 /* MPAppDelegate_Shared.h */, @@ -1088,6 +1095,7 @@ DA32CFDA19CF1C70004F3F0E /* MPStoredSiteEntity.h */, DA32CFDB19CF1C70004F3F0E /* MPStoredSiteEntity.m */, DA5E5CAF1724A667003798D8 /* MPTypes.h */, + DA4DAE931A7D8117003E5423 /* MPTypes.m */, DA32CFE319CF1C71004F3F0E /* MPUserEntity.h */, DA32CFE419CF1C71004F3F0E /* MPUserEntity.m */, ); @@ -2256,6 +2264,8 @@ 93D394C4254EEB45FB335AFB /* MPSitesTableView.m in Sources */, DA6774291A4746AF004F356A /* mpw-algorithm.c in Sources */, 93D395E4830290EBB6E71F34 /* MPNoStateButton.m in Sources */, + DA4DAE941A7D8117003E5423 /* MPAlgorithmV3.m in Sources */, + DA4DAE951A7D8117003E5423 /* MPTypes.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj index 25bc0484..01fc85a2 100644 --- a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -61,6 +61,7 @@ 93D39DF2E77B937D77C10414 /* install in Resources */ = {isa = PBXBuildFile; fileRef = 93D39ACD33E79386E6F33601 /* install */; }; 93D39E281E3658B30550CB55 /* NSDictionary+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */; }; 93D39E34FD28D24FE3442C48 /* UITextView+PearlAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3977321EB249981821AB0 /* UITextView+PearlAttributes.m */; }; + 93D39E5F7F6D7F5C0FAD090F /* MPTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39D72239990DDAC2D75B0 /* MPTypes.m */; }; 93D39EAA4D064193074D3021 /* MPFixable.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A813CA9D7E192261ED2 /* MPFixable.m */; }; 93D39F8A9254177891F38705 /* MPSetupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A28369954D147E239BA /* MPSetupViewController.m */; }; 93D39FAE1BB6A393BFE15FD0 /* mpw.bashrc in Resources */ = {isa = PBXBuildFile; fileRef = 93D39245A478883C672818F3 /* mpw.bashrc */; }; @@ -546,6 +547,7 @@ 93D39CF8ADF4542CDC4CD385 /* MPCombinedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCombinedViewController.h; sourceTree = ""; }; 93D39D4E713564B7654341B0 /* mpw-algorithm_v3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mpw-algorithm_v3.c"; sourceTree = ""; }; 93D39D6604447D7708039155 /* MPAnswersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAnswersViewController.h; sourceTree = ""; }; + 93D39D72239990DDAC2D75B0 /* MPTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTypes.m; sourceTree = ""; }; 93D39D8A953779B35403AF6E /* PearlUICollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlUICollectionView.m; sourceTree = ""; }; 93D39DA27D768B53C8B1330C /* MPAvatarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAvatarCell.h; sourceTree = ""; }; 93D39DE2CB351D4E3789462B /* UIScrollView+PearlAdjustInsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+PearlAdjustInsets.h"; sourceTree = ""; }; @@ -2595,6 +2597,7 @@ DABD3BB81711E2DC00CF925C /* MPTypes.h */, DA32CFE719CF1C8F004F3F0E /* MPUserEntity.h */, DA32CFE619CF1C8F004F3F0E /* MPUserEntity.m */, + 93D39D72239990DDAC2D75B0 /* MPTypes.m */, ); name = ObjC; path = ..; @@ -3652,6 +3655,7 @@ 93D395B715D15F2B56F2A2EE /* mpw-types.c in Sources */, 93D39943D01E70DAC3B0DF76 /* mpw-util.c in Sources */, 93D39577FD8BB0945DB2F0A3 /* MPAlgorithmV3.m in Sources */, + 93D39E5F7F6D7F5C0FAD090F /* MPTypes.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MasterPassword/homebrew-mpw.rb b/MasterPassword/homebrew-mpw.rb index e882b906..cdded4be 100644 --- a/MasterPassword/homebrew-mpw.rb +++ b/MasterPassword/homebrew-mpw.rb @@ -1,9 +1,8 @@ -require "formula" - class Mpw < Formula homepage "http://masterpasswordapp.com" - url "https://ssl.masterpasswordapp.com/mpw-2.1-cli3-3-gd5ff215.tar.gz" - sha1 "c9fca230cd0c2b22082bc54fe85053219888212a" + url "https://ssl.masterpasswordapp.com/mpw-2.1-cli4-0-gf6b2287.tar.gz" + sha1 "036b3d8f4bd6f0676ae16e7e9c3de65f6030874f" + version "2.1-cli4" depends_on "automake" => :build depends_on "autoconf" => :build @@ -18,7 +17,7 @@ class Mpw < Formula resource("libscrypt").stage buildpath/"lib/scrypt" touch "lib/scrypt/.unpacked" - ENV["targets"]="mpw mpw-tests" + ENV["targets"] = "mpw mpw-tests" system "./build" system "./mpw-tests"