Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: crypto/mock_keychain_mac.cc

Issue 10798003: Fix 64-bit Mac compilation errors in src/crypto. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/mock_keychain_mac.h ('k') | third_party/mach_override/mach_override.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/mock_keychain_mac.cc
===================================================================
--- crypto/mock_keychain_mac.cc (revision 147091)
+++ crypto/mock_keychain_mac.cc (working copy)
@@ -92,7 +92,7 @@
return &(attribute_list.attr[attribute_index]);
}
-void MockKeychain::SetTestDataBytes(int item,
+void MockKeychain::SetTestDataBytes(unsigned int item,
UInt32 tag,
const void* data,
size_t length) {
@@ -110,25 +110,27 @@
}
}
-void MockKeychain::SetTestDataString(int item, UInt32 tag, const char* value) {
+void MockKeychain::SetTestDataString(unsigned int item,
+ UInt32 tag,
+ const char* value) {
SetTestDataBytes(item, tag, value, value ? strlen(value) : 0);
}
-void MockKeychain::SetTestDataPort(int item, UInt32 value) {
+void MockKeychain::SetTestDataPort(unsigned int item, UInt32 value) {
SecKeychainAttribute* attribute = AttributeWithTag(keychain_attr_list_[item],
kSecPortItemAttr);
UInt32* data = static_cast<UInt32*>(attribute->data);
*data = value;
}
-void MockKeychain::SetTestDataProtocol(int item, SecProtocolType value) {
+void MockKeychain::SetTestDataProtocol(unsigned int item, SecProtocolType value) {
SecKeychainAttribute* attribute = AttributeWithTag(keychain_attr_list_[item],
kSecProtocolItemAttr);
SecProtocolType* data = static_cast<SecProtocolType*>(attribute->data);
*data = value;
}
-void MockKeychain::SetTestDataAuthType(int item, SecAuthenticationType value) {
+void MockKeychain::SetTestDataAuthType(unsigned int item, SecAuthenticationType value) {
SecKeychainAttribute* attribute = AttributeWithTag(
keychain_attr_list_[item], kSecAuthenticationTypeItemAttr);
SecAuthenticationType* data = static_cast<SecAuthenticationType*>(
@@ -136,21 +138,21 @@
*data = value;
}
-void MockKeychain::SetTestDataNegativeItem(int item, Boolean value) {
+void MockKeychain::SetTestDataNegativeItem(unsigned int item, Boolean value) {
SecKeychainAttribute* attribute = AttributeWithTag(keychain_attr_list_[item],
kSecNegativeItemAttr);
Boolean* data = static_cast<Boolean*>(attribute->data);
*data = value;
}
-void MockKeychain::SetTestDataCreator(int item, OSType value) {
+void MockKeychain::SetTestDataCreator(unsigned int item, OSType value) {
SecKeychainAttribute* attribute = AttributeWithTag(keychain_attr_list_[item],
kSecCreatorItemAttr);
OSType* data = static_cast<OSType*>(attribute->data);
*data = value;
}
-void MockKeychain::SetTestDataPasswordBytes(int item, const void* data,
+void MockKeychain::SetTestDataPasswordBytes(unsigned int item, const void* data,
size_t length) {
keychain_data_[item].length = length;
if (length > 0) {
@@ -163,7 +165,8 @@
}
}
-void MockKeychain::SetTestDataPasswordString(int item, const char* value) {
+void MockKeychain::SetTestDataPasswordString(unsigned int item,
+ const char* value) {
SetTestDataPasswordBytes(item, value, value ? strlen(value) : 0);
}
@@ -175,7 +178,7 @@
UInt32* length,
void** outData) const {
DCHECK(itemRef);
- unsigned int key = reinterpret_cast<unsigned int>(itemRef) - 1;
+ unsigned int key = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(itemRef)) - 1;
if (keychain_attr_list_.find(key) == keychain_attr_list_.end())
return errSecInvalidItemRef;
@@ -204,7 +207,7 @@
return errSecAuthFailed;
}
- unsigned int key = reinterpret_cast<unsigned int>(itemRef) - 1;
+ unsigned int key = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(itemRef)) - 1;
if (keychain_attr_list_.find(key) == keychain_attr_list_.end())
return errSecInvalidItemRef;
@@ -232,7 +235,7 @@
}
OSStatus MockKeychain::ItemDelete(SecKeychainItemRef itemRef) const {
- unsigned int key = reinterpret_cast<unsigned int>(itemRef) - 1;
+ unsigned int key = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(itemRef)) - 1;
for (unsigned int i = 0; i < keychain_attr_list_[key].count; ++i) {
if (keychain_attr_list_[key].attr[i].data)
@@ -483,7 +486,7 @@
if (!ref)
return;
- if (reinterpret_cast<int>(ref) == kDummySearchRef) {
+ if (static_cast<unsigned int>(reinterpret_cast<uintptr_t>(ref)) == kDummySearchRef) {
--search_copy_count_;
} else {
--keychain_item_copy_count_;
« no previous file with comments | « crypto/mock_keychain_mac.h ('k') | third_party/mach_override/mach_override.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698