diff options
20 files changed, 41 insertions, 44 deletions
diff --git a/base/i18n/bidi_line_iterator.cc b/base/i18n/bidi_line_iterator.cc index 5e9cd11..e81a36b 100644 --- a/base/i18n/bidi_line_iterator.cc +++ b/base/i18n/bidi_line_iterator.cc @@ -32,7 +32,7 @@ bool BiDiLineIterator::Open(const string16& text, ubidi_setPara(bidi_, text.data(), static_cast<int>(text.length()), right_to_left ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, NULL, &error); - return U_SUCCESS(error) ? true : false; + return (U_SUCCESS(error) == TRUE); } int BiDiLineIterator::CountRuns() { diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index f005a44..b141a42 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -98,7 +98,7 @@ static std::string HexStringToID(const std::string& hexstr) { // decent chance of being unique among the registered components. It also has // the nice property that can be trivially computed by hand. static int CrxIdtoUMAId(const std::string& id) { - CHECK(id.size() > 2); + CHECK_GT(id.size(), 2U); return id[0] + id[1] + id[2] - ('a' * 3); } @@ -618,7 +618,7 @@ void CrxUpdateService::ParseManifest(const std::string& xml) { void CrxUpdateService::OnParseUpdateManifestSucceeded( const UpdateManifest::Results& results) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - int update_pending = 0; + size_t update_pending = 0; std::vector<UpdateManifest::Result>::const_iterator it; for (it = results.list.begin(); it != results.list.end(); ++it) { CrxUpdateItem* crx = FindUpdateItemById(it->extension_id); @@ -665,7 +665,7 @@ void CrxUpdateService::OnParseUpdateManifestSucceeded( ChangeItemStatus(CrxUpdateItem::kChecking, CrxUpdateItem::kUpToDate); // If there are updates pending we do a short wait. - ScheduleNextRun(update_pending ? true : false); + ScheduleNextRun(update_pending > 0); } void CrxUpdateService::OnParseUpdateManifestFailed( diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc index 2177718..ef58d2c 100644 --- a/chrome/browser/external_protocol/external_protocol_handler.cc +++ b/chrome/browser/external_protocol/external_protocol_handler.cc @@ -233,8 +233,7 @@ void ExternalProtocolHandler::SetBlockState(const std::string& scheme, if (state == UNKNOWN) { update_excluded_schemas->Remove(scheme, NULL); } else { - update_excluded_schemas->SetBoolean(scheme, - state == BLOCK ? true : false); + update_excluded_schemas->SetBoolean(scheme, (state == BLOCK)); } } } diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc index 21e1ef5..3852bfa 100644 --- a/chrome/browser/first_run/try_chrome_dialog_view.cc +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc @@ -200,7 +200,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( // Decide if the don't bug me is a button or a radio button. bool dont_bug_me_button = - experiment.flags & BrowserDistribution::kDontBugMeAsButton ? true : false; + ((experiment.flags & BrowserDistribution::kDontBugMeAsButton) != 0); // Optional third and fourth row views. if (!dont_bug_me_button) { diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 1642c5e..9a73eb0 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -400,15 +400,16 @@ views::Checkbox* CreateApplicationShortcutView::AddCheckbox( void CreateApplicationShortcutView::ButtonPressed(views::Button* sender, const ui::Event& event) { - if (sender == desktop_check_box_) + if (sender == desktop_check_box_) { profile_->GetPrefs()->SetBoolean(prefs::kWebAppCreateOnDesktop, - desktop_check_box_->checked() ? true : false); - else if (sender == menu_check_box_) + desktop_check_box_->checked()); + } else if (sender == menu_check_box_) { profile_->GetPrefs()->SetBoolean(prefs::kWebAppCreateInAppsMenu, - menu_check_box_->checked() ? true : false); - else if (sender == quick_launch_check_box_) + menu_check_box_->checked()); + } else if (sender == quick_launch_check_box_) { profile_->GetPrefs()->SetBoolean(prefs::kWebAppCreateInQuickLaunchBar, - quick_launch_check_box_->checked() ? true : false); + quick_launch_check_box_->checked()); + } // When no checkbox is checked we should not have the action button enabled. GetDialogClientView()->UpdateDialogButtons(); diff --git a/chrome/browser/ui/webui/quota_internals_types.cc b/chrome/browser/ui/webui/quota_internals_types.cc index 533f174..33a31d3 100644 --- a/chrome/browser/ui/webui/quota_internals_types.cc +++ b/chrome/browser/ui/webui/quota_internals_types.cc @@ -87,7 +87,7 @@ base::Value* PerOriginStorageInfo::NewValue() const { dict->SetString("type", StorageTypeToString(type_)); dict->SetString("host", host_); if (in_use_ >= 0) - dict->SetBoolean("inUse", in_use_ ? true : false); + dict->SetBoolean("inUse", (in_use_ > 0)); if (used_count_ >= 0) dict->SetInteger("usedCount", used_count_); if (!last_access_time_.is_null()) diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc index 98cb827..eca2e80 100644 --- a/chrome/renderer/chrome_render_view_observer.cc +++ b/chrome/renderer/chrome_render_view_observer.cc @@ -1012,8 +1012,7 @@ bool ChromeRenderViewObserver::CaptureFrameThumbnail(WebView* view, S16CPU new_width = static_cast<S16CPU>(src_bmp.height() * dest_aspect); S16CPU x_offset = (src_bmp_width - new_width) / 2; src_rect.set(x_offset, 0, new_width + x_offset, src_bmp.height()); - score->good_clipping = - (src_aspect >= ThumbnailScore::kTooWideAspectRatio) ? false : true; + score->good_clipping = (src_aspect < ThumbnailScore::kTooWideAspectRatio); } else { src_rect.set(0, 0, src_bmp_width, static_cast<S16CPU>(src_bmp_width / dest_aspect)); diff --git a/content/common/gpu/media/h264_parser.cc b/content/common/gpu/media/h264_parser.cc index d25a802..c4d09ed 100644 --- a/content/common/gpu/media/h264_parser.cc +++ b/content/common/gpu/media/h264_parser.cc @@ -120,7 +120,7 @@ void H264Parser::Reset() { void H264Parser::SetStream(const uint8* stream, off_t stream_size) { DCHECK(stream); - DCHECK(stream_size > 0); + DCHECK_GT(stream_size, 0); stream_ = stream; bytes_left_ = stream_size; @@ -281,9 +281,10 @@ H264Parser::Result H264Parser::AdvanceToNextNALU(H264NALU *nalu) { READ_BITS_OR_RETURN(2, &nalu->nal_ref_idc); READ_BITS_OR_RETURN(5, &nalu->nal_unit_type); - DVLOG(4) << "NALU type: " << (int)nalu->nal_unit_type - << " at: " << (void*)nalu->data << " size: " << nalu->size - << " ref: " << (int)nalu->nal_ref_idc; + DVLOG(4) << "NALU type: " << static_cast<int>(nalu->nal_unit_type) + << " at: " << reinterpret_cast<const void*>(nalu->data) + << " size: " << nalu->size + << " ref: " << static_cast<int>(nalu->nal_ref_idc); return kOk; } @@ -310,7 +311,7 @@ static const int kDefault8x8Inter[kH264ScalingList8x8Length] = { static inline void DefaultScalingList4x4( int i, int scaling_list4x4[][kH264ScalingList4x4Length]) { - DCHECK(i < 6); + DCHECK_LT(i, 6); if (i < 3) memcpy(scaling_list4x4[i], kDefault4x4Intra, sizeof(kDefault4x4Intra)); @@ -321,7 +322,7 @@ static inline void DefaultScalingList4x4( static inline void DefaultScalingList8x8( int i, int scaling_list8x8[][kH264ScalingList8x8Length]) { - DCHECK(i < 6); + DCHECK_LT(i, 6); if (i % 2 == 0) memcpy(scaling_list8x8[i], kDefault8x8Intra, sizeof(kDefault8x8Intra)); @@ -564,7 +565,6 @@ static void FillDefaultSeqScalingLists(H264SPS* sps) { for (int i = 0; i < 6; ++i) for (int j = 0; j < kH264ScalingList8x8Length; ++j) sps->scaling_list8x8[i][j] = 16; - } H264Parser::Result H264Parser::ParseSPS(int* sps_id) { @@ -951,7 +951,7 @@ H264Parser::Result H264Parser::ParseSliceHeader(const H264NALU& nalu, memset(shdr, 0, sizeof(*shdr)); - shdr->idr_pic_flag = ((nalu.nal_unit_type == 5) ? true : false); + shdr->idr_pic_flag = (nalu.nal_unit_type == 5); shdr->nal_ref_idc = nalu.nal_ref_idc; shdr->nalu_data = nalu.data; shdr->nalu_size = nalu.size; diff --git a/content/public/test/mock_render_thread.h b/content/public/test/mock_render_thread.h index c0b3b90..298f71f 100644 --- a/content/public/test/mock_render_thread.h +++ b/content/public/test/mock_render_thread.h @@ -90,7 +90,7 @@ class MockRenderThread : public RenderThread { } bool has_widget() const { - return widget_ ? true : false; + return (widget_ != NULL); } void set_new_window_routing_id(int32 id) { diff --git a/content/shell/shell_web_contents_view_delegate_win.cc b/content/shell/shell_web_contents_view_delegate_win.cc index 82eac7a..2165b455 100644 --- a/content/shell/shell_web_contents_view_delegate_win.cc +++ b/content/shell/shell_web_contents_view_delegate_win.cc @@ -117,8 +117,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu( } if (params_.is_editable) { - bool cut_enabled = - (params_.edit_flags & WebContextMenuData::CanCut) ? true : false; + bool cut_enabled = ((params_.edit_flags & WebContextMenuData::CanCut) != 0); MakeContextMenuItem(sub_menu, index++, L"Cut", @@ -126,7 +125,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu( cut_enabled); bool copy_enabled = - (params_.edit_flags & WebContextMenuData::CanCopy) ? true : false; + ((params_.edit_flags & WebContextMenuData::CanCopy) != 0); MakeContextMenuItem(sub_menu, index++, L"Copy", @@ -134,14 +133,14 @@ void ShellWebContentsViewDelegate::ShowContextMenu( copy_enabled); bool paste_enabled = - (params_.edit_flags & WebContextMenuData::CanPaste) ? true : false; + ((params_.edit_flags & WebContextMenuData::CanPaste) != 0); MakeContextMenuItem(sub_menu, index++, L"Paste", ShellContextMenuItemPasteId, paste_enabled); bool delete_enabled = - (params_.edit_flags & WebContextMenuData::CanDelete) ? true : false; + ((params_.edit_flags & WebContextMenuData::CanDelete) != 0); MakeContextMenuItem(sub_menu, index++, L"Delete", @@ -170,7 +169,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu( NOTIMPLEMENTED(); #else gfx::Point screen_point(params.x, params.y); - POINT point = screen_point.ToPOINT();; + POINT point = screen_point.ToPOINT(); ClientToScreen(web_contents_->GetView()->GetNativeView(), &point); int selection = @@ -187,7 +186,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu( } void ShellWebContentsViewDelegate::MenuItemSelected(int selection) { - switch(selection) { + switch (selection) { case ShellContextMenuItemCutId: web_contents_->GetRenderViewHost()->Cut(); break; diff --git a/gpu/demos/framework/pepper.cc b/gpu/demos/framework/pepper.cc index 462679e..9dbbb74 100644 --- a/gpu/demos/framework/pepper.cc +++ b/gpu/demos/framework/pepper.cc @@ -127,7 +127,7 @@ class PluginModule : public pp::Module { } virtual bool Init() { - return glInitializePPAPI(get_browser_interface()) == GL_TRUE ? true : false; + return (glInitializePPAPI(get_browser_interface()) == GL_TRUE); } virtual pp::Instance* CreateInstance(PP_Instance instance) { @@ -145,4 +145,3 @@ Module* CreateModule() { } } // namespace pp - diff --git a/media/audio/cross_process_notification_unittest.cc b/media/audio/cross_process_notification_unittest.cc index a0392c2..2726cf8 100644 --- a/media/audio/cross_process_notification_unittest.cc +++ b/media/audio/cross_process_notification_unittest.cc @@ -133,7 +133,7 @@ struct FlagArray { FlagArray() : flags_() {} bool is_set(size_t index) const { - return (flags_[index >> 5] & (1 << (index & 31))) ? true : false; + return (flags_[index >> 5] & (1 << (index & 31))); } void set(size_t index) { diff --git a/media/tools/player_wtl/mainfrm.h b/media/tools/player_wtl/mainfrm.h index 2705807..54a1ec3 100644 --- a/media/tools/player_wtl/mainfrm.h +++ b/media/tools/player_wtl/mainfrm.h @@ -63,7 +63,7 @@ class CMainFrame virtual BOOL OnIdle() { BOOL bEnable = !m_view.bmp_.IsNull(); - BOOL bMovieOpen = media::Movie::GetInstance()->IsOpen() ? true : false; + BOOL bMovieOpen = media::Movie::GetInstance()->IsOpen(); float current_position = media::Movie::GetInstance()->GetPosition(); float duration = media::Movie::GetInstance()->GetDuration(); diff --git a/media/video/capture/win/video_capture_device_win.cc b/media/video/capture/win/video_capture_device_win.cc index 05d5b43..5a587b5 100644 --- a/media/video/capture/win/video_capture_device_win.cc +++ b/media/video/capture/win/video_capture_device_win.cc @@ -87,7 +87,7 @@ bool PinMatchesCategory(IPin* pin, REFGUID category) { hr = ks_property->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, &pin_category, sizeof(pin_category), &return_value); if (SUCCEEDED(hr) && (return_value == sizeof(pin_category))) { - found = (pin_category == category) ? true : false; + found = (pin_category == category); } } return found; diff --git a/skia/ext/convolver_unittest.cc b/skia/ext/convolver_unittest.cc index 038cb04..f61b685 100644 --- a/skia/ext/convolver_unittest.cc +++ b/skia/ext/convolver_unittest.cc @@ -275,7 +275,7 @@ TEST(Convolver, SIMDVerification) { resize_start = base::TimeTicks::Now(); BGRAConvolve2D(static_cast<const uint8*>(source.getPixels()), static_cast<int>(source.rowBytes()), - alpha ? true : false, x_filter, y_filter, + (alpha != 0), x_filter, y_filter, static_cast<int>(result_c.rowBytes()), r1, false); delta_c = base::TimeTicks::Now() - resize_start; @@ -283,7 +283,7 @@ TEST(Convolver, SIMDVerification) { // Convolve using SSE2 code BGRAConvolve2D(static_cast<const uint8*>(source.getPixels()), static_cast<int>(source.rowBytes()), - alpha ? true : false, x_filter, y_filter, + (alpha != 0), x_filter, y_filter, static_cast<int>(result_sse.rowBytes()), r2, true); delta_sse = base::TimeTicks::Now() - resize_start; diff --git a/ui/base/win/ime_input.cc b/ui/base/win/ime_input.cc index dcb4ef3..1bfb80f 100644 --- a/ui/base/win/ime_input.cc +++ b/ui/base/win/ime_input.cc @@ -137,7 +137,7 @@ bool ImeInput::SetInputLanguage() { // while composing a text. HKL keyboard_layout = ::GetKeyboardLayout(0); input_language_id_ = reinterpret_cast<LANGID>(keyboard_layout); - ime_status_ = (::ImmIsIME(keyboard_layout) == TRUE) ? true : false; + ime_status_ = (::ImmIsIME(keyboard_layout) == TRUE); return ime_status_; } diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc index 7019a4a..6748c6a 100644 --- a/ui/gfx/canvas_skia.cc +++ b/ui/gfx/canvas_skia.cc @@ -323,7 +323,7 @@ void Canvas::DrawStringWithShadows(const string16& text, } } else { ui::Range range = StripAcceleratorChars(flags, &adjusted_text); - bool elide_text = (flags & NO_ELLIPSIS) ? false : true; + bool elide_text = ((flags & NO_ELLIPSIS) == 0); #if defined(OS_LINUX) // On Linux, eliding really means fading the end of the string. But only diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h index d883ca7..b471ecd 100644 --- a/ui/views/bubble/bubble_border.h +++ b/ui/views/bubble/bubble_border.h @@ -96,7 +96,7 @@ class VIEWS_EXPORT BubbleBorder : public Border { } static bool has_arrow(ArrowLocation loc) { - return loc >= NONE ? false : true; + return loc < NONE; } static bool is_arrow_on_left(ArrowLocation loc) { diff --git a/ui/views/focus/focus_search.cc b/ui/views/focus/focus_search.cc index c54aec7..2507b34 100644 --- a/ui/views/focus/focus_search.cc +++ b/ui/views/focus/focus_search.cc @@ -51,7 +51,7 @@ View* FocusSearch::FindNextFocusableView(View* starting_view, if (!reverse) { v = FindNextFocusableViewImpl(starting_view, check_starting_view, true, - (direction == DOWN) ? true : false, + (direction == DOWN), starting_view_group, focus_traversable, focus_traversable_view); diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 1677c82..a4d85a9 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc @@ -1104,7 +1104,7 @@ bool Widget::OnMouseEvent(const ui::MouseEvent& event) { native_widget_->ReleaseCapture(); } GetRootView()->OnMouseReleased(event); - return (event.flags() & ui::EF_IS_NON_CLIENT) ? false : true; + return ((event.flags() & ui::EF_IS_NON_CLIENT) == 0); case ui::ET_MOUSE_MOVED: case ui::ET_MOUSE_DRAGGED: if (native_widget_->HasCapture() && is_mouse_button_pressed_) { |