From 7e93e2f52a534ff2fb1434ae7bca88dc8bd8e4df Mon Sep 17 00:00:00 2001 From: "craig.schlenter@chromium.org" Date: Mon, 7 Sep 2009 19:01:41 +0000 Subject: Fix some gcc 4.4 issues when compiling with toolkit_views. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most of these squash harmless compiler warnings but the custom_button.cc change fixes a real problem with the accelerator key bitmask calculation (+ preceeds << in terms of operator precedence) The change to tab_strip.cc is ugly but it fixes the following error: chrome/browser/views/tabs/tab_strip.cc: In member function ‘void TabStrip::StartRemoveTabAnimation(int, TabContents*)’: chrome/browser/views/tabs/tab_strip.cc:201: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false As an added bonus, this makes the Linux shared build of toolkit_views work too. Review URL: http://codereview.chromium.org/199025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25602 0039d316-1c4b-4281-b951-d872f2087c98 --- views/controls/button/custom_button.cc | 4 ++-- views/widget/drop_target_gtk.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc index 69ac840..f9a58f6 100644 --- a/views/controls/button/custom_button.cc +++ b/views/controls/button/custom_button.cc @@ -96,8 +96,8 @@ bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) { memset(&gdk_key, 0, sizeof(GdkEventKey)); gdk_key.type = GDK_KEY_RELEASE; gdk_key.keyval = accelerator.GetKeyCode(); - gdk_key.state = accelerator.IsAltDown() << 3 + - accelerator.IsCtrlDown() << 2 + + gdk_key.state = (accelerator.IsAltDown() << 3) + + (accelerator.IsCtrlDown() << 2) + accelerator.IsShiftDown(); KeyEvent key_event(&gdk_key, false); #endif diff --git a/views/widget/drop_target_gtk.cc b/views/widget/drop_target_gtk.cc index d262e3e..2947e63 100644 --- a/views/widget/drop_target_gtk.cc +++ b/views/widget/drop_target_gtk.cc @@ -302,7 +302,7 @@ void DropTargetGtk::RequestFormats(GdkDragContext* context, requested_formats_ |= OSExchangeData::FILE_CONTENTS; NOTIMPLEMENTED(); } - if ((formats & OSExchangeData::FILE_NAME != 0) && + if (((formats & OSExchangeData::FILE_NAME) != 0) && (requested_formats_ & OSExchangeData::FILE_NAME) == 0) { requested_formats_ |= OSExchangeData::FILE_NAME; NOTIMPLEMENTED(); -- cgit v1.1