summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/common.gypi7
-rw-r--r--chrome/browser/autofill/autofill_text_field_mac.mm12
-rw-r--r--chrome/browser/cocoa/authorization_util.mm3
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller.mm7
-rw-r--r--gpu/command_buffer/client/fenced_allocator.h4
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc11
-rw-r--r--ipc/ipc_channel_posix.cc3
7 files changed, 34 insertions, 13 deletions
diff --git a/build/common.gypi b/build/common.gypi
index d81c567..66294115 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1234,6 +1234,13 @@
['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
{'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
],
+ ['clang==1', {
+ 'WARNING_CFLAGS': [
+ # Don't die on dtoa code that uses a char as an array index.
+ # This is required solely for base/third_party/dmg_fp/dtoa.cc.
+ '-Wno-char-subscripts',
+ ],
+ }],
],
},
'target_conditions': [
diff --git a/chrome/browser/autofill/autofill_text_field_mac.mm b/chrome/browser/autofill/autofill_text_field_mac.mm
index 509b1a6..5db2ffb 100644
--- a/chrome/browser/autofill/autofill_text_field_mac.mm
+++ b/chrome/browser/autofill/autofill_text_field_mac.mm
@@ -24,10 +24,16 @@
}
}
-- (void)setObjectValue:(id)object {
- if (isCreditCardField_ && [object isKindOfClass:[NSString class]]) {
+- (void)setObjectValue:(id<NSCopying>)anObject {
+ // -[NSControl setObjectValue:] says that the passed-in object has type
+ // |id<NSCopying>|, but this function needs to call the NSObject method
+ // -isKindOfClass: on the parameter. In theory, this is not correct, but this
+ // is probably a bug in the method signature.
+ NSObject<NSCopying>* object = static_cast<NSObject<NSCopying>*>(anObject);
+ if (isCreditCardField_ &&
+ [object isKindOfClass:[NSString class]]) {
// Obfuscate the number.
- NSString* string = object;
+ NSString* string = static_cast<NSString*>(object);
CreditCard card;
card.SetInfo(AutoFillType(CREDIT_CARD_NUMBER),
base::SysNSStringToUTF16(string));
diff --git a/chrome/browser/cocoa/authorization_util.mm b/chrome/browser/cocoa/authorization_util.mm
index fdd4387..e255993 100644
--- a/chrome/browser/cocoa/authorization_util.mm
+++ b/chrome/browser/cocoa/authorization_util.mm
@@ -48,7 +48,8 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
// The OS will append " Type an administrator's name and password to allow
// <CFBundleDisplayName> to make changes."
- NSString* prompt_ns = reinterpret_cast<const NSString*>(prompt);
+ NSString* prompt_ns = const_cast<NSString*>(
+ reinterpret_cast<const NSString*>(prompt));
const char* prompt_c = [prompt_ns UTF8String];
size_t prompt_length = prompt_c ? strlen(prompt_c) : 0;
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm
index 9c6f8d5..0c7ec9d 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller.mm
@@ -874,7 +874,12 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
// Enable or disable items. We are the menu delegate for both the bar
// and for bookmark folder buttons.
-- (BOOL)validateUserInterfaceItem:(id)item {
+- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)anItem {
+ // NSUserInterfaceValidations says that the passed-in object has type
+ // |id<NSValidatedUserInterfaceItem>|, but this function needs to call the
+ // NSObject method -isKindOfClass: on the parameter. In theory, this is not
+ // correct, but this is probably a bug in the method signature.
+ NSMenuItem* item = static_cast<NSMenuItem*>(anItem);
// Yes for everything we don't explicitly deny.
if (![item isKindOfClass:[NSMenuItem class]])
return YES;
diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h
index fb97e37..fd162db41 100644
--- a/gpu/command_buffer/client/fenced_allocator.h
+++ b/gpu/command_buffer/client/fenced_allocator.h
@@ -212,7 +212,9 @@ class FencedAllocatorWrapper {
// Gets the offset to a memory block given the base memory and the address.
// It translates NULL to FencedAllocator::kInvalidOffset.
FencedAllocator::Offset GetOffset(void *pointer) {
- return pointer ? static_cast<char *>(pointer) - static_cast<char *>(base_) :
+ return pointer ?
+ static_cast<FencedAllocator::Offset>(
+ static_cast<char*>(pointer) - static_cast<char*>(base_)) :
FencedAllocator::kInvalidOffset;
}
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 6dad4e2..58ddd2b 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -311,8 +311,8 @@ class ClientSideBufferHelper {
size_t bytes_per_element =
GLES2Util::GetGLTypeSizeForTexturesAndBuffers(info.type()) *
info.size();
- GLsizei real_stride =
- info.stride() ? info.stride() : bytes_per_element;
+ GLsizei real_stride = info.stride() ?
+ info.stride() : static_cast<GLsizei>(bytes_per_element);
GLsizei bytes_collected = CollectData(
info.pointer(), bytes_per_element, real_stride, num_elements);
gl->BufferSubData(
@@ -814,8 +814,8 @@ void GLES2Implementation::ShaderSource(
uint32 total_size = 1;
for (GLsizei ii = 0; ii < count; ++ii) {
if (source[ii]) {
- total_size +=
- (length && length[ii] >= 0) ? length[ii] : strlen(source[ii]);
+ total_size += (length && length[ii] >= 0) ?
+ static_cast<size_t>(length[ii]) : strlen(source[ii]);
}
}
@@ -826,7 +826,8 @@ void GLES2Implementation::ShaderSource(
for (GLsizei ii = 0; ii <= count; ++ii) {
const char* src = ii < count ? source[ii] : "";
if (src) {
- uint32 size = ii < count ? (length ? length[ii] : strlen(src)) : 1;
+ uint32 size = ii < count ?
+ (length ? static_cast<size_t>(length[ii]) : strlen(src)) : 1;
while (size) {
uint32 part_size = std::min(size, max_size);
void* buffer = transfer_buffer_.Alloc(part_size);
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index e4852b4..1c1b4e6 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -135,8 +135,7 @@ int ChannelNameToFD(const std::string& channel_id) {
}
//------------------------------------------------------------------------------
-sockaddr_un sizecheck;
-const size_t kMaxPipeNameLength = sizeof(sizecheck.sun_path);
+const size_t kMaxPipeNameLength = sizeof(((sockaddr_un*)0)->sun_path);
// Creates a Fifo with the specified name ready to listen on.
bool CreateServerFifo(const std::string& pipe_name, int* server_listen_fd) {