Summary: | check-webkit-style failed to complain about missing braces | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Evan Martin <evan> | ||||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, aivopaas, bburg, cjerdonek, commit-queue, eric, glenn, hamaji, levin, llango.u-szeged, rniwa | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Evan Martin
2010-01-26 16:07:00 PST
Er, make that: "... which lacks *braces*." @@ -1862,7 +1862,8 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi if (FrameView* view = m_frame->view()) { OptionalCursor optionalCursor = selectCursor(mev, scrollbar); if (optionalCursor.isCursorChange()) - view->setCursor(optionalCursor.cursor()); + m_currentMouseCursor = optionalCursor.cursor(); + view->setCursor(m_currentMouseCursor); } } Ran into this again in review of https://bugs.webkit.org/show_bug.cgi?id=129388 I have a draft patch for this. It works fine on the examples you mentioned previously, but it complains about this: if (missedCues[i].data()->startTime() < missedCues[i].data()->endTime()) eventTasks.append(std::make_pair(missedCues[i].data()->endTime(), missedCues[i].data())); I'm a bit confused. Is this false positive or not? Should we use braces in this case? Created attachment 225982 [details]
Patch
(In reply to comment #4) > I have a draft patch for this. It works fine on the examples you mentioned previously, but it complains about this: > > if (missedCues[i].data()->startTime() < missedCues[i].data()->endTime()) > eventTasks.append(std::make_pair(missedCues[i].data()->endTime(), > missedCues[i].data())); > > I'm a bit confused. Is this false positive or not? Should we use braces in this case? Meanwhile I found the answer here: http://www.webkit.org/coding/coding-style.html#braces-one-line Comment on attachment 225982 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=225982&action=review rs=me. > Tools/Scripts/webkitpy/style/checkers/cpp.py:2407 > + if (match(r'^\s*\b(if|for|foreach|while|else)\b\s', line) We don't want foreach here. Created attachment 226423 [details]
patch for landing
Comment on attachment 226423 [details] patch for landing Clearing flags on attachment: 226423 Committed r165451: <http://trac.webkit.org/changeset/165451> All reviewed patches have been landed. Closing bug. |