diff options
author | Moonchild <moonchild@palemoon.org> | 2023-11-11 14:27:03 +0100 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-11-11 14:27:03 +0100 |
commit | 734f0957fb8bc06ae6e5105d878f1b7007ce8b5d (patch) | |
tree | df73c5d270de365b4035aff74ef703c9f922bd30 | |
parent | c789882a294d29b3e5450a972ad67c4839c75e23 (diff) | |
download | uxp-734f0957fb8bc06ae6e5105d878f1b7007ce8b5d.tar.gz |
Issue #2343 - replace MOZ_FALLTHROUGH with [[fallthrough]]
Basically a S&R. Removed the macro and adjusts IDL codegen accordingly.
138 files changed, 299 insertions, 343 deletions
diff --git a/dom/animation/TimingParams.cpp b/dom/animation/TimingParams.cpp index f387f460f8..8c64224a6e 100644 --- a/dom/animation/TimingParams.cpp +++ b/dom/animation/TimingParams.cpp @@ -135,7 +135,7 @@ TimingParams::ParseEasing(const nsAString& aEasing, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR) { return Nothing(); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSUnit_Cubic_Bezier: case eCSSUnit_Steps: { nsTimingFunction timingFunction; diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index c67e42bd70..89d37b5787 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -3199,7 +3199,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor) // Set the status bar similarly for mouseover and focus case eMouseOver: aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eFocus: { InternalFocusEvent* focusEvent = aVisitor.mEvent->AsFocusEvent(); if (!focusEvent || !focusEvent->mIsRefocus) { @@ -3214,7 +3214,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor) } case eMouseOut: aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eBlur: rv = LeaveLink(aVisitor.mPresContext); if (NS_SUCCEEDED(rv)) { diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 9b7a8c2721..4d34303028 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -5787,7 +5787,7 @@ nsIDocument::ImportNode(nsINode& aNode, bool aDeep, ErrorResult& rv) const if (ShadowRoot::FromNode(imported)) { break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDOMNode::ATTRIBUTE_NODE: case nsIDOMNode::ELEMENT_NODE: @@ -6893,7 +6893,7 @@ nsIDocument::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR); return nullptr; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDOMNode::ELEMENT_NODE: case nsIDOMNode::PROCESSING_INSTRUCTION_NODE: @@ -7184,7 +7184,7 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize) mValidMaxScale = !maxScaleStr.IsEmpty() && NS_SUCCEEDED(scaleMaxErrorCode); mViewportType = Specified; - MOZ_FALLTHROUGH; + [[fallthrough]]; } case Specified: default: diff --git a/dom/base/nsXMLContentSerializer.cpp b/dom/base/nsXMLContentSerializer.cpp index 1bf075875f..e5cf12f638 100644 --- a/dom/base/nsXMLContentSerializer.cpp +++ b/dom/base/nsXMLContentSerializer.cpp @@ -1442,7 +1442,7 @@ nsXMLContentSerializer::AppendFormatedWrapped_WhitespaceSequence( case ' ': case '\t': sawBlankOrTab = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '\n': ++aPos; // do not increase mColPos, diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index b7caaad7bb..d73d9fde63 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -7918,7 +7918,7 @@ class CGCase(CGList): self.append(CGGeneric("case " + expression + ": {\n")) bodyList = CGList([body]) if fallThrough: - bodyList.append(CGGeneric("MOZ_FALLTHROUGH;\n")) + bodyList.append(CGGeneric("[[fallthrough]];\n")) else: bodyList.append(CGGeneric("break;\n")) self.append(CGIndenter(bodyList)) diff --git a/dom/canvas/WebGL2ContextState.cpp b/dom/canvas/WebGL2ContextState.cpp index 5cdfb7277b..57f818c524 100644 --- a/dom/canvas/WebGL2ContextState.cpp +++ b/dom/canvas/WebGL2ContextState.cpp @@ -121,7 +121,7 @@ WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) return JS::NumberValue(UINT32_MAX); /*** fall through to fGetInteger64v ***/ - MOZ_FALLTHROUGH; + [[fallthrough]]; case LOCAL_GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: case LOCAL_GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index d01a0d44e3..9e7ac963ca 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -792,7 +792,7 @@ WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname) case LOCAL_GL_RENDERBUFFER_SAMPLES: if (!IsWebGL2()) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; case LOCAL_GL_RENDERBUFFER_WIDTH: case LOCAL_GL_RENDERBUFFER_HEIGHT: diff --git a/dom/canvas/WebGLQuery.cpp b/dom/canvas/WebGLQuery.cpp index ea71243c97..60a5d0bc76 100644 --- a/dom/canvas/WebGLQuery.cpp +++ b/dom/canvas/WebGLQuery.cpp @@ -178,7 +178,7 @@ WebGLQuery::GetQueryParameter(GLenum pname, JS::MutableHandleValue retval) const gl->fGetQueryObjectui64v(mGLName, pname, &val); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: gl->fGetQueryObjectuiv(mGLName, LOCAL_GL_QUERY_RESULT, (GLuint*)&val); diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 935281916b..c1418e5375 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -654,7 +654,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, StopTrackingDragGesture(); sNormalLMouseEventInProcess = false; // then fall through... - MOZ_FALLTHROUGH; + [[fallthrough]]; case WidgetMouseEvent::eRightButton: case WidgetMouseEvent::eMiddleButton: SetClickCount(mouseEvent, aStatus); @@ -708,7 +708,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, aEvent->mMessage = eVoidEvent; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eMouseMove: case ePointerDown: case ePointerMove: { @@ -774,7 +774,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, } } // then fall through... - MOZ_FALLTHROUGH; + [[fallthrough]]; case eBeforeKeyDown: case eKeyDown: case eAfterKeyDown: @@ -3153,7 +3153,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } // After firing the pointercancel event, a user agent must also fire a // pointerout event followed by a pointerleave event. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case ePointerUp: { WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent(); @@ -4272,7 +4272,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent) // Update the last known mRefPoint with the current mRefPoint. sLastRefPoint = aMouseEvent->mRefPoint; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case ePointerMove: case ePointerDown: case ePointerGotCapture: diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 3d0f643712..c01c3f7017 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4545,7 +4545,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) break; // If we are submitting, do not send click event } // else fall through and treat Space like click... - MOZ_FALLTHROUGH; + [[fallthrough]]; } case NS_FORM_INPUT_BUTTON: case NS_FORM_INPUT_RESET: @@ -4567,7 +4567,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) case NS_VK_UP: case NS_VK_LEFT: isMovingBack = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_VK_DOWN: case NS_VK_RIGHT: // Arrow key pressed, focus+select prev/next radio button diff --git a/dom/media/MediaInfo.cpp b/dom/media/MediaInfo.cpp index 568183e688..f40f1584d9 100644 --- a/dom/media/MediaInfo.cpp +++ b/dom/media/MediaInfo.cpp @@ -144,9 +144,9 @@ AudioConfig::SampleSize(AudioConfig::SampleFormat aFormat) switch (aFormat) { case FORMAT_U8: return 1; case FORMAT_S16: return 2; - case FORMAT_S24: MOZ_FALLTHROUGH; - case FORMAT_S24LSB: MOZ_FALLTHROUGH; - case FORMAT_S32: MOZ_FALLTHROUGH; + case FORMAT_S24: [[fallthrough]]; + case FORMAT_S24LSB: [[fallthrough]]; + case FORMAT_S32: [[fallthrough]]; case FORMAT_FLT: return 4; case FORMAT_NONE: default: return 0; @@ -159,11 +159,11 @@ AudioConfig::FormatToBits(AudioConfig::SampleFormat aFormat) switch (aFormat) { case FORMAT_U8: return 8; case FORMAT_S16: return 16; - case FORMAT_S24LSB: MOZ_FALLTHROUGH; + case FORMAT_S24LSB: [[fallthrough]]; case FORMAT_S24: return 24; - case FORMAT_S32: MOZ_FALLTHROUGH; + case FORMAT_S32: [[fallthrough]]; case FORMAT_FLT: return 32; - case FORMAT_NONE: MOZ_FALLTHROUGH; + case FORMAT_NONE: [[fallthrough]]; default: return 0; } } diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 7fd11f1715..b98e0cfb06 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2053,7 +2053,7 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow, nsPIDOMWindowOuter* outer = aWindow->GetOuterWindow(); vc.mBrowserWindow.Construct(outer->WindowID()); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case MediaSourceEnum::Screen: case MediaSourceEnum::Application: case MediaSourceEnum::Window: diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp index 5ac7fa518c..77eb783a28 100644 --- a/dom/media/fmp4/MP4Demuxer.cpp +++ b/dom/media/fmp4/MP4Demuxer.cpp @@ -263,7 +263,7 @@ MP4TrackDemuxer::GetNextSample() mp4_demuxer::H264::FrameType type = mp4_demuxer::H264::GetFrameType(sample); switch (type) { - case mp4_demuxer::H264::FrameType::I_FRAME: MOZ_FALLTHROUGH; + case mp4_demuxer::H264::FrameType::I_FRAME: [[fallthrough]]; case mp4_demuxer::H264::FrameType::OTHER: { bool keyframe = type == mp4_demuxer::H264::FrameType::I_FRAME; diff --git a/dom/media/webm/WebMBufferedParser.cpp b/dom/media/webm/WebMBufferedParser.cpp index 8d9bd7d811..7fc5bc2913 100644 --- a/dom/media/webm/WebMBufferedParser.cpp +++ b/dom/media/webm/WebMBufferedParser.cpp @@ -141,7 +141,7 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength, case EBML_ID: mLastInitStartOffset = mCurrentOffset + (p - aBuffer) - (mElement.mID.mLength + mElement.mSize.mLength); - MOZ_FALLTHROUGH; + [[fallthrough]]; default: mSkipBytes = mElement.mSize.mValue; mState = SKIP_DATA; diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 4b02440e20..aac2261196 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -2022,7 +2022,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result) // old XPCOM objects, no longer supported, but null out the out // param to avoid crashing plugins that still try to use this. *(nsISupports**)result = nullptr; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_getvalue unhandled get value: %d\n", variable)); diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 094d96d380..5a48c8cd47 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -561,7 +561,7 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar, case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: NS_NOTREACHED("NPNVariable should be handled in PluginModuleChild."); - MOZ_FALLTHROUGH; + [[fallthrough]]; #endif default: diff --git a/dom/smil/nsSMILParserUtils.cpp b/dom/smil/nsSMILParserUtils.cpp index 05b8fd7ba8..477c538c7e 100644 --- a/dom/smil/nsSMILParserUtils.cpp +++ b/dom/smil/nsSMILParserUtils.cpp @@ -186,7 +186,7 @@ ParseClockValue(RangedPtr<const char16_t>& aIter, !ParseColon(iter, aEnd)) { return false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case PARTIAL_CLOCK_VALUE: if (!ParseSecondsOrMinutes(iter, aEnd, minutes) || !ParseColon(iter, aEnd) || diff --git a/dom/storage/DOMStorageDBThread.cpp b/dom/storage/DOMStorageDBThread.cpp index 9c19c9f731..fb20f35350 100644 --- a/dom/storage/DOMStorageDBThread.cpp +++ b/dom/storage/DOMStorageDBThread.cpp @@ -284,7 +284,7 @@ DOMStorageDBThread::InsertDBOp(DOMStorageDBThread::DBOperation* aOperation) aOperation->Finalize(NS_OK); return NS_OK; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case DBOperation::opGetUsage: if (aOperation->Type() == DBOperation::opPreloadUrgent) { diff --git a/dom/storage/DOMStorageDBUpdater.cpp b/dom/storage/DOMStorageDBUpdater.cpp index f7aa0310f8..696d5da7e8 100644 --- a/dom/storage/DOMStorageDBUpdater.cpp +++ b/dom/storage/DOMStorageDBUpdater.cpp @@ -385,7 +385,7 @@ nsresult Update(mozIStorageConnection *aWorkerConnection) rv = aWorkerConnection->SetSchemaVersion(1); NS_ENSURE_SUCCESS(rv, rv); - MOZ_FALLTHROUGH; + [[fallthrough]]; } case CURRENT_SCHEMA_VERSION: // Ensure the tables and indexes are up. This is mostly a no-op diff --git a/dom/svg/SVGPathSegListSMILType.cpp b/dom/svg/SVGPathSegListSMILType.cpp index ba42f494e9..1f03fb8fd6 100644 --- a/dom/svg/SVGPathSegListSMILType.cpp +++ b/dom/svg/SVGPathSegListSMILType.cpp @@ -351,7 +351,7 @@ ConvertPathSegmentData(SVGPathDataAndInfo::const_iterator& aStart, aResult[5] = aStart[5]; aResult[6] = aStart[6]; AdjustSegmentForRelativeness(adjustmentType, aResult + 5, aState); - MOZ_FALLTHROUGH; + [[fallthrough]]; case PATHSEG_CURVETO_QUADRATIC_ABS: case PATHSEG_CURVETO_QUADRATIC_REL: case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: @@ -359,7 +359,7 @@ ConvertPathSegmentData(SVGPathDataAndInfo::const_iterator& aStart, aResult[3] = aStart[3]; aResult[4] = aStart[4]; AdjustSegmentForRelativeness(adjustmentType, aResult + 3, aState); - MOZ_FALLTHROUGH; + [[fallthrough]]; case PATHSEG_MOVETO_ABS: case PATHSEG_MOVETO_REL: case PATHSEG_LINETO_ABS: diff --git a/dom/svg/SVGTransformListParser.cpp b/dom/svg/SVGTransformListParser.cpp index 77f9fcbbbc..67eb6e513b 100644 --- a/dom/svg/SVGTransformListParser.cpp +++ b/dom/svg/SVGTransformListParser.cpp @@ -142,7 +142,7 @@ SVGTransformListParser::ParseTranslate() switch (count) { case 1: t[1] = 0.f; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: { nsSVGTransform* transform = mTransforms.AppendElement(fallible); @@ -170,7 +170,7 @@ SVGTransformListParser::ParseScale() switch (count) { case 1: s[1] = s[0]; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: { nsSVGTransform* transform = mTransforms.AppendElement(fallible); @@ -199,7 +199,7 @@ SVGTransformListParser::ParseRotate() switch (count) { case 1: r[1] = r[2] = 0.f; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: { nsSVGTransform* transform = mTransforms.AppendElement(fallible); diff --git a/dom/system/linux/GpsdLocationProvider.cpp b/dom/system/linux/GpsdLocationProvider.cpp index c117188692..38d5089a50 100644 --- a/dom/system/linux/GpsdLocationProvider.cpp +++ b/dom/system/linux/GpsdLocationProvider.cpp @@ -255,7 +255,7 @@ protected: if (!IsNaN(gpsData.fix.altitude)) { alt = gpsData.fix.altitude; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case MODE_2D: if (!IsNaN(gpsData.fix.latitude)) { lat = gpsData.fix.latitude; @@ -308,13 +308,13 @@ protected: { switch (aErrno) { case EACCES: - MOZ_FALLTHROUGH; + [[fallthrough]]; case EPERM: - MOZ_FALLTHROUGH; + [[fallthrough]]; case EROFS: return nsIDOMGeoPositionError::PERMISSION_DENIED; case ETIME: - MOZ_FALLTHROUGH; + [[fallthrough]]; case ETIMEDOUT: return nsIDOMGeoPositionError::TIMEOUT; default: diff --git a/dom/xslt/xpath/txLocationStep.cpp b/dom/xslt/xpath/txLocationStep.cpp index f945b750fe..0625d3944f 100644 --- a/dom/xslt/xpath/txLocationStep.cpp +++ b/dom/xslt/xpath/txLocationStep.cpp @@ -42,7 +42,7 @@ LocationStep::evaluate(txIEvalContext* aContext, txAExprResult** aResult) if (!walker.moveToParent()) { break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case ANCESTOR_OR_SELF_AXIS: { @@ -74,7 +74,7 @@ LocationStep::evaluate(txIEvalContext* aContext, txAExprResult** aResult) if (mNodeTest->matches(walker.getCurrentPosition(), aContext)) { nodes->append(walker.getCurrentPosition()); } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case DESCENDANT_AXIS: { diff --git a/dom/xslt/xslt/txOutputFormat.cpp b/dom/xslt/xslt/txOutputFormat.cpp index dcf28f5cb5..3609c5c994 100644 --- a/dom/xslt/xslt/txOutputFormat.cpp +++ b/dom/xslt/xslt/txOutputFormat.cpp @@ -81,7 +81,7 @@ void txOutputFormat::setFromDefaults() case eMethodNotSet: { mMethod = eXMLOutput; - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eXMLOutput: { diff --git a/extensions/cookie/nsCookiePermission.cpp b/extensions/cookie/nsCookiePermission.cpp index 21e5553766..840523a31a 100644 --- a/extensions/cookie/nsCookiePermission.cpp +++ b/extensions/cookie/nsCookiePermission.cpp @@ -190,7 +190,7 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI, switch (perm) { case nsICookiePermission::ACCESS_SESSION: *aIsSession = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsICookiePermission::ACCESS_ALLOW: *aResult = true; diff --git a/extensions/cookie/nsPermissionManager.cpp b/extensions/cookie/nsPermissionManager.cpp index afdaea63f1..9a3426f635 100644 --- a/extensions/cookie/nsPermissionManager.cpp +++ b/extensions/cookie/nsPermissionManager.cpp @@ -935,7 +935,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // TODO: we want to make default version as version 2 in order to fix bug 784875. case 0: @@ -955,7 +955,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // Version 3->4 is the creation of the modificationTime field. case 3: @@ -973,7 +973,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // In version 5, host appId, and isInBrowserElement were merged into a // single origin entry @@ -1059,7 +1059,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // At this point, the version 5 table has been migrated to a version 6 table // We are guaranteed to have at least one of moz_hosts and moz_perms. If @@ -1216,7 +1216,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // The version 7-8 migration is the re-migration of localhost and ip-address // entries due to errors in the previous version 7 migration which caused @@ -1318,7 +1318,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // The version 8-9 migration removes the unnecessary backup moz-hosts database contents. // as the data no longer needs to be migrated @@ -1346,7 +1346,7 @@ nsPermissionManager::InitDB(bool aRemoveFile) } // fall through to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // current version. case HOSTS_SCHEMA_VERSION: diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 4808daf49c..88a2a40362 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1089,7 +1089,7 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent case PAN_MOMENTUM: MOZ_ASSERT(GetCurrentTouchBlock()); GetCurrentTouchBlock()->GetOverscrollHandoffChain()->CancelAnimations(ExcludeOverscroll); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NOTHING: { mX.StartTouch(point.x, aEvent.mTime); mY.StartTouch(point.y, aEvent.mTime); @@ -1196,7 +1196,7 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent) case FLING: // Should never happen. NS_WARNING("Received impossible touch end in OnTouchEnd."); - MOZ_FALLTHROUGH; + [[fallthrough]]; case ANIMATING_ZOOM: case SMOOTH_SCROLL: case NOTHING: diff --git a/gfx/layers/apz/src/GestureEventListener.cpp b/gfx/layers/apz/src/GestureEventListener.cpp index 94ece07ee1..8495252571 100644 --- a/gfx/layers/apz/src/GestureEventListener.cpp +++ b/gfx/layers/apz/src/GestureEventListener.cpp @@ -438,7 +438,7 @@ void GestureEventListener::HandleInputTimeoutLongTap() // just in case MAX_TAP_TIME > ContextMenuDelay cancel MAX_TAP timer // and fall through CancelMaxTapTimeoutTask(); - MOZ_FALLTHROUGH; + [[fallthrough]]; case GESTURE_FIRST_SINGLE_TOUCH_MAX_TAP_DOWN: { SetState(GESTURE_LONG_TOUCH_DOWN); mAsyncPanZoomController->HandleGestureEvent( diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index 00a18d7b26..d61ca3fd0c 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -347,10 +347,10 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, mTouchEndCancelled = true; mEndTouchIsClick = false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eTouchCancel: mActiveElementManager->HandleTouchEndEvent(mEndTouchIsClick); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eTouchMove: { if (mPendingTouchPreventedResponse) { MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid); diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index f80196430f..903be6adfb 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -625,7 +625,7 @@ PrepareFontOptions(FcPattern* aPattern, // subpixel_order won't be used by the font as we won't use // CAIRO_ANTIALIAS_SUBPIXEL, but don't leave it at default for // caching reasons described above. Fall through: - MOZ_FALLTHROUGH; + [[fallthrough]]; case FC_RGBA_RGB: subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB; break; diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 3857c4cd38..9eea084fd9 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -479,7 +479,7 @@ gfxFontShaper::MergeFontFeatures( case NS_FONT_VARIANT_CAPS_ALLSMALL: mergedFeatures.Put(HB_TAG('c','2','s','c'), 1); // fall through to the small-caps case - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_FONT_VARIANT_CAPS_SMALLCAPS: mergedFeatures.Put(HB_TAG('s','m','c','p'), 1); @@ -489,7 +489,7 @@ gfxFontShaper::MergeFontFeatures( mergedFeatures.Put(aAddSmallCaps ? HB_TAG('c','2','s','c') : HB_TAG('c','2','p','c'), 1); // fall through to the petite-caps case - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_FONT_VARIANT_CAPS_PETITECAPS: mergedFeatures.Put(aAddSmallCaps ? HB_TAG('s','m','c','p') : @@ -615,7 +615,7 @@ gfxFontShaper::GetRoundOffsetsToPixels(DrawTarget* aDrawTarget, DWRITE_MEASURING_MODE_NATURAL) { return; } - MOZ_FALLTHROUGH; + [[fallthrough]]; #endif case CAIRO_FONT_TYPE_QUARTZ: // Quartz surfaces implement show_glyphs for Quartz fonts @@ -3119,7 +3119,7 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget, case kUppercaseReduce: // use reduced-size font, then fall through to uppercase the text f = smallCapsFont; - MOZ_FALLTHROUGH; + [[fallthrough]]; case kUppercase: // apply uppercase transform to the string diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 100af6da7b..896f2e1f8e 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -1758,7 +1758,7 @@ gfxFontGroup::FamilyFace::CheckState(bool& aSkipDrawing) case gfxUserFontEntry::STATUS_FAILED: SetInvalid(); // fall-thru to the default case - MOZ_FALLTHROUGH; + [[fallthrough]]; default: SetLoading(false); } diff --git a/image/decoders/nsJPEGDecoder.cpp b/image/decoders/nsJPEGDecoder.cpp index 1ac25fc6e2..2fd38fc10b 100644 --- a/image/decoders/nsJPEGDecoder.cpp +++ b/image/decoders/nsJPEGDecoder.cpp @@ -412,7 +412,7 @@ nsJPEGDecoder::ReadJPEGData(const char* aData, size_t aLength) mInfo.output_width, mInfo.output_height)); mState = JPEG_START_DECOMPRESS; - MOZ_FALLTHROUGH; // to start decompressing. + [[fallthrough]]; // to start decompressing. } case JPEG_START_DECOMPRESS: { @@ -439,7 +439,7 @@ nsJPEGDecoder::ReadJPEGData(const char* aData, size_t aLength) // If this is a progressive JPEG ... mState = mInfo.buffered_image ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL; - MOZ_FALLTHROUGH; // to decompress sequential JPEG. + [[fallthrough]]; // to decompress sequential JPEG. } case JPEG_DECOMPRESS_SEQUENTIAL: { @@ -461,7 +461,7 @@ nsJPEGDecoder::ReadJPEGData(const char* aData, size_t aLength) "We didn't process all of the data!"); mState = JPEG_DONE; } - MOZ_FALLTHROUGH; // to decompress progressive JPEG. + [[fallthrough]]; // to decompress progressive JPEG. } case JPEG_DECOMPRESS_PROGRESSIVE: { @@ -534,7 +534,7 @@ nsJPEGDecoder::ReadJPEGData(const char* aData, size_t aLength) mState = JPEG_DONE; } - MOZ_FALLTHROUGH; // to finish decompressing. + [[fallthrough]]; // to finish decompressing. } case JPEG_DONE: { diff --git a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp index 5bdfc47926..f33e60ede6 100644 --- a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp +++ b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp @@ -336,7 +336,7 @@ NS_IMETHODIMP nsEUCJPToUnicodeV2::Convert( break; } // else fall through to error handler - MOZ_FALLTHROUGH; + [[fallthrough]]; } case 5: // two bytes undefined { diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp index 7eb7c46b2d..e909528b5d 100644 --- a/js/src/builtin/ReflectParse.cpp +++ b/js/src/builtin/ReflectParse.cpp @@ -2537,7 +2537,7 @@ ASTSerializer::statement(ParseNode* pn, MutableHandleValue dst) pn = pn->as<LexicalScopeNode>().scopeBody(); if (!pn->isKind(PNK_STATEMENTLIST)) return statement(pn, dst); - MOZ_FALLTHROUGH; + [[fallthrough]]; case PNK_STATEMENTLIST: return blockStatement(&pn->as<ListNode>(), dst); diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index 3bc249e015..26e8c63cfe 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -4519,7 +4519,7 @@ CType::Finalize(JSFreeOp* fop, JSObject* obj) } } - MOZ_FALLTHROUGH; + [[fallthrough]]; case TYPE_array: { // Free the ffi_type info. diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 89b768344a..99204fe9f2 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1271,7 +1271,7 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) // Any subexpression of a comma expression could be effectful. case PNK_COMMA: MOZ_ASSERT(!pn->as<ListNode>().empty()); - MOZ_FALLTHROUGH; + [[fallthrough]]; // Subcomponents of a literal may be effectful. case PNK_ARRAY: case PNK_OBJECT: diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index 3fbdd3fc8a..351611e14f 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -174,7 +174,7 @@ class NameResolver * flagged as a contributor. */ pos--; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: /* Save any other nodes we encounter on the way up. */ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 96b83f7c48..037eb8dd07 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -1544,12 +1544,12 @@ Parser<ParseHandler>::noteDeclaredName(HandlePropertyName name, DeclarationKind return false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case DeclarationKind::Import: // Module code is always strict, so 'let' is always a keyword and never a name. MOZ_ASSERT(name != context->names().let); - MOZ_FALLTHROUGH; + [[fallthrough]]; case DeclarationKind::SimpleCatchParameter: case DeclarationKind::CatchParameter: { @@ -6921,7 +6921,7 @@ Parser<ParseHandler>::yieldExpression(InHandling inHandling) case TOK_MUL: kind = PNK_YIELD_STAR; tokenStream.consumeKnownToken(TOK_MUL, TokenStream::Operand); - MOZ_FALLTHROUGH; + [[fallthrough]]; default: exprNode = assignExpr(inHandling, YieldIsKeyword, TripledotProhibited); if (!exprNode) @@ -6972,7 +6972,7 @@ Parser<ParseHandler>::yieldExpression(InHandling inHandling) pc->functionBox()->setGeneratorKind(LegacyGenerator); - MOZ_FALLTHROUGH; + [[fallthrough]]; case LegacyGenerator: { @@ -9618,7 +9618,7 @@ Parser<ParseHandler>::unaryExpr(YieldHandling yieldHandling, TripledotHandling t } } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: { Node expr = optionalExpr(yieldHandling, tripledotHandling, tt, diff --git a/js/src/irregexp/RegExpEngine.cpp b/js/src/irregexp/RegExpEngine.cpp index 75c6f4547a..0fb783170e 100644 --- a/js/src/irregexp/RegExpEngine.cpp +++ b/js/src/irregexp/RegExpEngine.cpp @@ -3348,7 +3348,7 @@ EmitAtomLetter(RegExpCompiler* compiler, } case 4: macro_assembler->CheckCharacter(chars[3], &ok); - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: macro_assembler->CheckCharacter(chars[0], &ok); macro_assembler->CheckCharacter(chars[1], &ok); diff --git a/js/src/irregexp/RegExpParser.cpp b/js/src/irregexp/RegExpParser.cpp index 025efbb0ac..cd9277f818 100644 --- a/js/src/irregexp/RegExpParser.cpp +++ b/js/src/irregexp/RegExpParser.cpp @@ -987,7 +987,7 @@ RegExpParser<CharT>::ParseClassEscape(char16_t* char_class, widechar *value, } return true; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: if (!ParseClassCharacterEscape(value)) return false; @@ -1981,7 +1981,7 @@ RegExpParser<CharT>::ParseDisjunction() Advance(2); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case '0': { if (unicode_) { @@ -2094,7 +2094,7 @@ RegExpParser<CharT>::ParseDisjunction() int dummy; if (ParseIntervalQuantifier(&dummy, &dummy)) return ReportError(JSMSG_NOTHING_TO_REPEAT); - MOZ_FALLTHROUGH; + [[fallthrough]]; } default: if (unicode_) { diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 04078cb20c..af1a9789ac 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -2533,7 +2533,7 @@ BacktrackingAllocator::computeSpillWeight(LiveBundle* bundle) case LUse::FIXED: fixed = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case LUse::REGISTER: usesTotal += 2000; break; diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp index 7b1bdc8c3f..22045b675f 100644 --- a/js/src/jit/BaselineBailouts.cpp +++ b/js/src/jit/BaselineBailouts.cpp @@ -1975,7 +1975,7 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo* bailoutInfo) // Invalid assumption based on baseline code. case Bailout_OverflowInvalidate: outerScript->setHadOverflowBailout(); - MOZ_FALLTHROUGH; + [[fallthrough]]; case Bailout_NonStringInputInvalidate: case Bailout_DoubleOutput: case Bailout_ObjectIdentityOrTypeGuard: diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index a6adc122c7..5e42dbc69a 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -929,7 +929,7 @@ RemoveExistingGetElemNativeStubs(JSContext* cx, ICGetElem_Fallback* stub, Handle case ICStub::GetElem_NativeSlotSymbol: if (indirect) continue; - MOZ_FALLTHROUGH; + [[fallthrough]]; case ICStub::GetElem_NativePrototypeSlotName: case ICStub::GetElem_NativePrototypeSlotSymbol: case ICStub::GetElem_NativePrototypeCallNativeName: diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 7eb69ec00f..b04a0880a9 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -1596,7 +1596,7 @@ IonBuilder::traverseBytecode() MOZ_ASSERT(i == 0); if (current->peek(-1) == popped[0]) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: MOZ_ASSERT(popped[i]->isImplicitlyUsed() || @@ -2032,7 +2032,7 @@ IonBuilder::inspectOpcode(JSOp op) } } // Fall through to JSOP_BINDNAME - MOZ_FALLTHROUGH; + [[fallthrough]]; case JSOP_BINDNAME: return jsop_bindname(info().getName(pc)); diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index 7f29d537a7..65895ca43d 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -2022,7 +2022,7 @@ LIRGenerator::visitToDouble(MToDouble* convert) case MIRType::Boolean: MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly); - MOZ_FALLTHROUGH; + [[fallthrough]]; case MIRType::Int32: { @@ -2077,7 +2077,7 @@ LIRGenerator::visitToFloat32(MToFloat32* convert) case MIRType::Boolean: MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly); - MOZ_FALLTHROUGH; + [[fallthrough]]; case MIRType::Int32: { diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp index 0f78ef3f2f..f4a1c0c199 100644 --- a/js/src/jit/MCallOptimize.cpp +++ b/js/src/jit/MCallOptimize.cpp @@ -2432,7 +2432,7 @@ IonBuilder::inlineIsTypedArrayHelper(CallInfo& callInfo, WrappingBehavior wrappi } } - MOZ_FALLTHROUGH; + [[fallthrough]]; case TemporaryTypeSet::ForAllResult::EMPTY: result = false; diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index e7cb0e55f0..339ef9907b 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -2409,7 +2409,7 @@ CanProduceNegativeZero(MDefinition* def) case MDefinition::Op_Constant: if (def->type() == MIRType::Double && def->toConstant()->toDouble() == -0.0) return true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case MDefinition::Op_BitAnd: case MDefinition::Op_BitOr: case MDefinition::Op_BitXor: @@ -2491,7 +2491,7 @@ NeedNegativeZeroCheck(MDefinition* def) if (rhs->id() < lhs->id() && CanProduceNegativeZero(lhs)) return true; - MOZ_FALLTHROUGH; + [[fallthrough]]; } case MDefinition::Op_StoreElement: case MDefinition::Op_StoreElementHole: @@ -3379,7 +3379,7 @@ MTypeOf::foldsTo(TempAllocator& alloc) type = JSTYPE_OBJECT; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: return this; } diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp index 6721dd4419..3ff137631e 100644 --- a/js/src/jit/MacroAssembler.cpp +++ b/js/src/jit/MacroAssembler.cpp @@ -405,7 +405,7 @@ MacroAssembler::loadUnboxedProperty(T address, JSValueType type, TypedOrValueReg convertInt32ToDouble(address, output.typedReg().fpu()); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case JSVAL_TYPE_BOOLEAN: diff --git a/js/src/jit/RangeAnalysis.cpp b/js/src/jit/RangeAnalysis.cpp index bf1ea72d2a..09364e49f4 100644 --- a/js/src/jit/RangeAnalysis.cpp +++ b/js/src/jit/RangeAnalysis.cpp @@ -276,7 +276,7 @@ RangeAnalysis::addBetaNodes() if (!compare->isNumericComparison()) continue; // Otherwise fall through to handle JSOP_STRICTEQ the same as JSOP_EQ. - MOZ_FALLTHROUGH; + [[fallthrough]]; case JSOP_EQ: comp.setDouble(bound, bound); break; @@ -285,7 +285,7 @@ RangeAnalysis::addBetaNodes() if (!compare->isNumericComparison()) continue; // Otherwise fall through to handle JSOP_STRICTNE the same as JSOP_NE. - MOZ_FALLTHROUGH; + [[fallthrough]]; case JSOP_NE: // Negative zero is not not-equal to zero. if (bound == 0) { diff --git a/js/src/jit/arm/disasm/Disasm-arm.cpp b/js/src/jit/arm/disasm/Disasm-arm.cpp index 678c8de89d..80f13fc1d8 100644 --- a/js/src/jit/arm/disasm/Disasm-arm.cpp +++ b/js/src/jit/arm/disasm/Disasm-arm.cpp @@ -1903,7 +1903,7 @@ Decoder::DecodeSpecialCondition(Instruction* instr) } break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case 0xB: if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xf)) { int Rn = instr->Bits(19, 16); diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.cpp index e7ee040601..0414365e6a 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/jsdtoa.cpp @@ -146,7 +146,7 @@ js_dtostr(DtoaState* state, char* buffer, size_t bufferSize, JSDToStrMode mode, case DTOSTR_EXPONENTIAL: MOZ_ASSERT(precision > 0); minNDigits = precision; - MOZ_FALLTHROUGH; + [[fallthrough]]; case DTOSTR_STANDARD_EXPONENTIAL: exponentialNotation = true; break; diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index c849bacc8c..a488740ee3 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -5418,7 +5418,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea incrementalState = State::MarkRoots; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::MarkRoots: if (!beginMarkPhase(reason, lock)) { @@ -5428,7 +5428,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea incrementalState = State::Mark; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::Mark: AutoGCRooter::traceAllWrappers(&marker); @@ -5472,7 +5472,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea if (budget.isOverBudget()) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::Sweep: if (performSweepActions(budget, lock) == NotFinished) @@ -5482,7 +5482,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea incrementalState = State::Finalize; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::Finalize: { @@ -5516,7 +5516,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea if (isCompacting && isIncremental) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::Compact: if (isCompacting) { @@ -5532,7 +5532,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea startDecommit(); incrementalState = State::Decommit; - MOZ_FALLTHROUGH; + [[fallthrough]]; case State::Decommit: { diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 726a84985a..9fcf449adb 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -523,13 +523,13 @@ Compare(T* a, T* b, size_t c) { size_t n = (c + size_t(7)) / size_t(8); switch (c % 8) { - case 0: do { if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 7: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 6: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 5: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 4: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 3: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; - case 2: if (*a++ != *b++) return false; MOZ_FALLTHROUGH; + case 0: do { if (*a++ != *b++) return false; [[fallthrough]]; + case 7: if (*a++ != *b++) return false; [[fallthrough]]; + case 6: if (*a++ != *b++) return false; [[fallthrough]]; + case 5: if (*a++ != *b++) return false; [[fallthrough]]; + case 4: if (*a++ != *b++) return false; [[fallthrough]]; + case 3: if (*a++ != *b++) return false; [[fallthrough]]; + case 2: if (*a++ != *b++) return false; [[fallthrough]]; case 1: if (*a++ != *b++) return false; } while (--n > 0); } diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index c539141130..f56fae9dd3 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1613,13 +1613,13 @@ FirstCharMatcherUnrolled(const TextChar* text, uint32_t n, const PatChar pat) const TextChar* t = text; switch ((textend - t) & 7) { - case 0: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 7: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 6: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 5: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 4: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 3: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; - case 2: if (*t++ == pat) return t - 1; MOZ_FALLTHROUGH; + case 0: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 7: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 6: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 5: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 4: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 3: if (*t++ == pat) return t - 1; [[fallthrough]]; + case 2: if (*t++ == pat) return t - 1; [[fallthrough]]; case 1: if (*t++ == pat) return t - 1; } while (textend != t) { diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index b83fa6a3d5..a90a1a7198 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1548,7 +1548,7 @@ ConvertTranscodeResultToJSException(JSContext* cx, JS::TranscodeResult rv) return true; default: - MOZ_FALLTHROUGH; + [[fallthrough]]; case JS::TranscodeResult_Failure: MOZ_ASSERT(!cx->isExceptionPending()); JS_ReportErrorASCII(cx, "generic warning"); diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index 1d88754084..88a4ed72e2 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -1513,7 +1513,7 @@ ParseRegExpFlags(const CharT* chars, size_t length, RegExpFlag* flagsOut, char16 return false; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: return false; } diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index 38d8d5b99b..850994b3f0 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -3301,7 +3301,7 @@ class BaseCompiler case Scalar::Uint16: case Scalar::Uint32: { isSigned = false; - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Int8: case Scalar::Int16: case Scalar::Int32: @@ -3380,15 +3380,15 @@ class BaseCompiler switch (access.type()) { case Scalar::Uint8: - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Uint16: - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Int8: - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Int16: - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Int32: - MOZ_FALLTHROUGH; + [[fallthrough]]; case Scalar::Uint32: { Register rt = src.tag == AnyReg::I64 ? src.i64().reg.low : src.i32().reg; storeI32(access, ptr, rt); diff --git a/js/src/wasm/WasmTextToBinary.cpp b/js/src/wasm/WasmTextToBinary.cpp index c3a707b550..66b97d380a 100644 --- a/js/src/wasm/WasmTextToBinary.cpp +++ b/js/src/wasm/WasmTextToBinary.cpp @@ -824,7 +824,7 @@ WasmTokenStream::next() return nan(begin); if (!IsWasmDigit(*cur_)) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return literal(begin); diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 87876f36fb..74a7331e75 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -495,7 +495,7 @@ XPCConvert::JSData2Native(void* d, HandleValue s, (**((nsAString**)d)).SetIsVoid(true); return true; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsXPTType::T_DOMSTRING: { diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index ba56a4a0ee..7f748c8f53 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -935,7 +935,7 @@ ProcessArgsForCompartment(JSContext* cx, char** argv, int argc) break; case 'S': ContextOptionsRef(cx).toggleWerror(); - MOZ_FALLTHROUGH; // because -S implies -s + [[fallthrough]]; // because -S implies -s case 's': ContextOptionsRef(cx).toggleExtraWarnings(); break; diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp index 4439a3a7b0..0ca58b4360 100644 --- a/layout/base/TouchManager.cpp +++ b/layout/base/TouchManager.cpp @@ -213,7 +213,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent, case eTouchEnd: aIsHandlingUserInput = true; // Fall through to touchcancel code - MOZ_FALLTHROUGH; + [[fallthrough]]; case eTouchCancel: { // Remove the changed touches // need to make sure we only remove touches that are ending here diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 3084cf9085..74d0cabc6d 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -4404,7 +4404,7 @@ nsCSSRendering::DrawTableBorderSegment(DrawTarget& aDrawTarget, break; case NS_STYLE_BORDER_STYLE_GROOVE: ridgeGroove = NS_STYLE_BORDER_STYLE_GROOVE; // and fall through to ridge - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_BORDER_STYLE_RIDGE: if ((horizontal && (twipsPerPixel >= aBorder.height)) || (!horizontal && (twipsPerPixel >= aBorder.width))) { @@ -4571,7 +4571,7 @@ nsCSSRendering::DrawTableBorderSegment(DrawTarget& aDrawTarget, break; } // else fall through to solid - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_BORDER_STYLE_SOLID: DrawSolidBorderSegment(aDrawTarget, aBorder, aBorderColor, aAppUnitsPerDevPixel, twipsPerPixel, aStartBevelSide, diff --git a/layout/base/nsCSSRenderingBorders.cpp b/layout/base/nsCSSRenderingBorders.cpp index 9720bb2dbf..5ca72075c8 100644 --- a/layout/base/nsCSSRenderingBorders.cpp +++ b/layout/base/nsCSSRenderingBorders.cpp @@ -1235,7 +1235,7 @@ MakeBorderColor(nscolor aColor, nscolor aBackgroundColor, case BorderColorStyleLight: k = 1; - MOZ_FALLTHROUGH; + [[fallthrough]]; case BorderColorStyleDark: NS_GetSpecial3DColors(colors, aBackgroundColor, aColor); return Color::FromABGR(colors[k]); diff --git a/layout/generic/CSSAlignUtils.cpp b/layout/generic/CSSAlignUtils.cpp index 4cbaccd52c..ec993faf1a 100644 --- a/layout/generic/CSSAlignUtils.cpp +++ b/layout/generic/CSSAlignUtils.cpp @@ -133,7 +133,7 @@ CSSAlignUtils::AlignJustifySelf(uint8_t aAlignment, LogicalAxis aAxis, } break; case NS_STYLE_ALIGN_STRETCH: - MOZ_FALLTHROUGH; // ComputeSize() deals with it + [[fallthrough]]; // ComputeSize() deals with it case NS_STYLE_ALIGN_START: offset = marginStart; break; diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index d60308f424..2fc90e9da9 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -3012,7 +3012,7 @@ MainAxisPositionTracker:: case NS_STYLE_JUSTIFY_BASELINE: case NS_STYLE_JUSTIFY_LAST_BASELINE: NS_WARNING("NYI: justify-content:left/right/baseline/last baseline"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_JUSTIFY_FLEX_START: // All packing space should go at the end --> nothing to do here. break; @@ -3220,7 +3220,7 @@ CrossAxisPositionTracker:: case NS_STYLE_ALIGN_BASELINE: case NS_STYLE_ALIGN_LAST_BASELINE: NS_WARNING("NYI: align-items/align-self:left/right/self-start/self-end/baseline/last baseline"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_ALIGN_FLEX_START: // All packing space should go at the end --> nothing to do here. break; @@ -3522,7 +3522,7 @@ SingleLineCrossAxisPositionTracker:: case NS_STYLE_ALIGN_SELF_START: case NS_STYLE_ALIGN_SELF_END: NS_WARNING("NYI: align-items/align-self:left/right/self-start/self-end"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_ALIGN_FLEX_START: // No space to skip over -- we're done. break; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index a4d4427f69..0d00a35865 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -7735,7 +7735,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos) aPos->mWordMovementType = eEndWord; } // Intentionally fall through the eSelectWord case. - MOZ_FALLTHROUGH; + [[fallthrough]]; case eSelectWord: { // wordSelectEatSpace means "are we looking for a boundary between whitespace diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 1e1afac234..5cc8189e94 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -4938,7 +4938,7 @@ nsGridContainerFrame::Tracks::AlignJustifyContent( case NS_STYLE_ALIGN_BASELINE: case NS_STYLE_ALIGN_LAST_BASELINE: NS_WARNING("NYI: 'first/last baseline' (bug 1151204)"); // XXX - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_ALIGN_START: distribute = false; break; diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 579c4ae0b0..90ce6b089f 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -3009,7 +3009,7 @@ nsLineLayout::ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize, } // If there are no justification opportunities for space-between, // fall-through to center per spec. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case NS_STYLE_RUBY_ALIGN_CENTER: // Indent all children by half of the reserved inline size. @@ -3201,7 +3201,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine, } // Fall through to the default case if we could not justify to fill // the space. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case NS_STYLE_TEXT_ALIGN_START: diff --git a/layout/printing/nsPrintPreviewListener.cpp b/layout/printing/nsPrintPreviewListener.cpp index 5edc0fb903..f4344b3037 100644 --- a/layout/printing/nsPrintPreviewListener.cpp +++ b/layout/printing/nsPrintPreviewListener.cpp @@ -195,7 +195,7 @@ nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent) } } } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eEventAction_Suppress: aEvent->StopPropagation(); aEvent->PreventDefault(); diff --git a/layout/style/CSSLexer.cpp b/layout/style/CSSLexer.cpp index f465981e7b..a38784a192 100644 --- a/layout/style/CSSLexer.cpp +++ b/layout/style/CSSLexer.cpp @@ -125,7 +125,7 @@ CSSLexer::NextToken(Nullable<CSSToken>& aResult) case eCSSToken_Dimension: resultToken.mText.Construct(token.mIdent); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSToken_Number: case eCSSToken_Percentage: resultToken.mNumber.Construct(token.mNumber); diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index 6ef53f5db1..9a196ef27b 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -770,7 +770,7 @@ Declaration::GetPropertyValueInternal( } // tweak aProperty and fall through aProperty = eCSSProperty_border_top; - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eCSSProperty_border_top: case eCSSProperty_border_right: @@ -1321,7 +1321,7 @@ Declaration::GetPropertyValueInternal( return; } // Fall through to eCSSProperty_grid_template (syntax #1) - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eCSSProperty_grid_template: { const nsCSSValue& areasValue = @@ -1466,7 +1466,7 @@ Declaration::GetPropertyValueInternal( !justify || !IsSingleValue(*justify)) { return; // Not serializable, bail. } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eCSSProperty_gap: { const nsCSSPropertyID* subprops = diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 2332de6a6a..199bcf16d5 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -164,7 +164,7 @@ AppendFunction(nsCSSKeyword aTransformFunction) break; default: NS_ERROR("must be a transform function"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSKeyword_translatex: case eCSSKeyword_translatey: case eCSSKeyword_translatez: @@ -2005,7 +2005,7 @@ AddWeightedFilterFunctionImpl(double aCoeff1, const nsCSSValueList* aList1, case eCSSKeyword_invert: case eCSSKeyword_sepia: initialVal = 0.0f; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSKeyword_brightness: case eCSSKeyword_contrast: case eCSSKeyword_opacity: @@ -2255,7 +2255,7 @@ AddShapeFunction(nsCSSPropertyID aProperty, resultFuncArgs->Item(2))) { return nullptr; } - MOZ_FALLTHROUGH; // to handle rx and center point + [[fallthrough]]; // to handle rx and center point case eCSSKeyword_circle: { // Add circles' |r| (or ellipses' |rx|) values: if (!AddCSSValuePixelPercentCalc(aRestriction == Restrictions::Enable @@ -2471,7 +2471,7 @@ AddTransformLists(double aCoeff1, const nsCSSValueList* aList1, arr->Item(4)); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eCSSKeyword_matrix: case eCSSKeyword_matrix3d: @@ -2496,7 +2496,7 @@ AddTransformLists(double aCoeff1, const nsCSSValueList* aList1, } break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSKeyword_interpolatematrix: { // FIXME: If the matrix contains only numbers then we could decompose // here. diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index f66415ea9e..2469536ad5 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -4580,7 +4580,7 @@ CSSParserImpl::ParseKeyframeSelectorList(InfallibleTArray<float>& aSelectorList) value = 1.0f; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: UngetToken(); // The first time through the loop, this means we got an empty @@ -10759,7 +10759,7 @@ CSSParserImpl::IsLegacyGradientLine(const nsCSSTokenType& aType, haveGradientLine = true; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSToken_ID: case eCSSToken_Hash: // this is a color @@ -11442,10 +11442,10 @@ CSSParserImpl::ParseBoxProperties(const nsCSSPropertyID aPropIDs[]) switch (count) { case 1: // Make right == top result.mRight = result.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: // Make bottom == top result.mBottom = result.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: // Make left == right result.mLeft = result.mRight; } @@ -11488,10 +11488,10 @@ CSSParserImpl::ParseGroupedBoxProperty(int32_t aVariantMask, switch (count) { case 1: // Make right == top result.mRight = result.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: // Make bottom == top result.mBottom = result.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: // Make left == right result.mLeft = result.mRight; } @@ -11589,10 +11589,10 @@ CSSParserImpl::ParseBoxCornerRadiiInternals(nsCSSValue array[]) switch (countX) { case 1: // Make top-right same as top-left dimenX.mRight = dimenX.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: // Make bottom-right same as top-left dimenX.mBottom = dimenX.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: // Make bottom-left same as top-right dimenX.mLeft = dimenX.mRight; } @@ -11600,10 +11600,10 @@ CSSParserImpl::ParseBoxCornerRadiiInternals(nsCSSValue array[]) switch (countY) { case 1: // Make top-right same as top-left dimenY.mRight = dimenY.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: // Make bottom-right same as top-left dimenY.mBottom = dimenY.mTop; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: // Make bottom-left same as top-right dimenY.mLeft = dimenY.mRight; } diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 65f42805de..e3f931ea7e 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -4109,7 +4109,7 @@ nsComputedDOMStyle::DoGetTextSizeAdjust() switch (StyleText()->mTextSizeAdjust) { default: NS_NOTREACHED("unexpected value"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_STYLE_TEXT_SIZE_ADJUST_AUTO: val->SetIdent(eCSSKeyword_auto); break; diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 858d7feba3..3eea109db6 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -240,7 +240,7 @@ nsRuleNode::EnsureBlockDisplay(StyleDisplay& display, display = StyleDisplay::Block; break; } // else, fall through to share the 'break' for non-changing display vals - MOZ_FALLTHROUGH; + [[fallthrough]]; case StyleDisplay::None: case StyleDisplay::Contents: // never change display:none or display:contents *ever* diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index e83a6dcf95..f6304fd833 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1287,7 +1287,7 @@ nsStyleSVGPaint::Reset() case eStyleSVGPaintType_Server: mPaint.mPaintServer->Release(); mPaint.mPaintServer = nullptr; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eStyleSVGPaintType_ContextFill: case eStyleSVGPaintType_ContextStroke: mFallbackColor = NS_RGB(0, 0, 0); diff --git a/layout/style/nsStyleTransformMatrix.cpp b/layout/style/nsStyleTransformMatrix.cpp index 3cc1667074..3ac6b6b478 100644 --- a/layout/style/nsStyleTransformMatrix.cpp +++ b/layout/style/nsStyleTransformMatrix.cpp @@ -639,7 +639,7 @@ MatrixForTransformFunction(Matrix4x4& aMatrix, break; case eCSSKeyword_rotatez: *aContains3dTransform = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCSSKeyword_rotate: ProcessRotateZ(aMatrix, aData); break; diff --git a/layout/tables/SpanningCellSorter.cpp b/layout/tables/SpanningCellSorter.cpp index 9ca577cde2..13aa61f939 100644 --- a/layout/tables/SpanningCellSorter.cpp +++ b/layout/tables/SpanningCellSorter.cpp @@ -108,7 +108,7 @@ SpanningCellSorter::GetNext(int32_t *aColSpan) /* prepare to enumerate the array */ mState = ENUMERATING_ARRAY; mEnumerationIndex = 0; - MOZ_FALLTHROUGH; + [[fallthrough]]; case ENUMERATING_ARRAY: while (mEnumerationIndex < ARRAY_SIZE && !mArray[mEnumerationIndex]) ++mEnumerationIndex; @@ -138,7 +138,7 @@ SpanningCellSorter::GetNext(int32_t *aColSpan) SortArray, nullptr); mSortedHashTable = sh; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case ENUMERATING_HASH: if (mEnumerationIndex < mHashTable.EntryCount()) { Item *result = mSortedHashTable[mEnumerationIndex]->mItems; @@ -153,7 +153,7 @@ SpanningCellSorter::GetNext(int32_t *aColSpan) return result; } mState = DONE; - MOZ_FALLTHROUGH; + [[fallthrough]]; case DONE: ; } diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp index 4852a4bdde..e0deda7824 100644 --- a/layout/tables/nsCellMap.cpp +++ b/layout/tables/nsCellMap.cpp @@ -913,7 +913,7 @@ nsTableCellMap::ResetBStartStart(LogicalSide aSide, switch(aSide) { case eLogicalSideBEnd: aRowIndex++; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eLogicalSideBStart: cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex); if (cellData) { @@ -936,7 +936,7 @@ nsTableCellMap::ResetBStartStart(LogicalSide aSide, break; case eLogicalSideIEnd: aColIndex++; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eLogicalSideIStart: cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex); if (cellData) { @@ -981,7 +981,7 @@ nsTableCellMap::SetBCBorderEdge(LogicalSide aSide, case eLogicalSideBEnd: rgYPos++; yPos++; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eLogicalSideBStart: lastIndex = xPos + aLength - 1; for (xIndex = xPos; xIndex <= lastIndex; xIndex++) { @@ -1028,7 +1028,7 @@ nsTableCellMap::SetBCBorderEdge(LogicalSide aSide, break; case eLogicalSideIEnd: xPos++; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eLogicalSideIStart: // since bStart, bEnd borders were set, there should already be a cellData entry lastIndex = rgYPos + aLength - 1; diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index cf4231c01f..f6d2dd54b9 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -6893,7 +6893,7 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, if (!aIter.IsTableIEndMost() && (relColIndex > 0)) { col = aIter.mBlockDirInfo[relColIndex - 1].mCol; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eColGroupOwner: if (col) { owner = col->GetParent(); @@ -6904,13 +6904,13 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, if (!aIter.IsTableIEndMost() && (relColIndex > 0)) { col = aIter.mBlockDirInfo[relColIndex - 1].mCol; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eColOwner: owner = col; break; case eAjaRowGroupOwner: NS_ERROR("a neighboring rowgroup can never own a vertical border"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eRowGroupOwner: NS_ASSERTION(aIter.IsTableIStartMost() || aIter.IsTableIEndMost(), "row group can own border only at table edge"); @@ -6918,7 +6918,7 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, break; case eAjaRowOwner: NS_ERROR("program error"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eRowOwner: NS_ASSERTION(aIter.IsTableIStartMost() || aIter.IsTableIEndMost(), "row can own border only at table edge"); @@ -6927,7 +6927,7 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, case eAjaCellOwner: side = eLogicalSideIEnd; cell = mAjaCell; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCellOwner: owner = cell; break; @@ -7104,7 +7104,7 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) break; case eAjaColGroupOwner: NS_ERROR("neighboring colgroups can never own an inline-dir border"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eColGroupOwner: NS_ASSERTION(aIter.IsTableBStartMost() || aIter.IsTableBEndMost(), "col group can own border only at the table edge"); @@ -7114,7 +7114,7 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) break; case eAjaColOwner: NS_ERROR("neighboring column can never own an inline-dir border"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case eColOwner: NS_ASSERTION(aIter.IsTableBStartMost() || aIter.IsTableBEndMost(), "col can own border only at the table edge"); @@ -7123,14 +7123,14 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) case eAjaRowGroupOwner: side = eLogicalSideBEnd; rg = (aIter.IsTableBEndMost()) ? aIter.mRg : aIter.mPrevRg; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eRowGroupOwner: owner = rg; break; case eAjaRowOwner: side = eLogicalSideBEnd; row = (aIter.IsTableBEndMost()) ? aIter.mRow : aIter.mPrevRow; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eRowOwner: owner = row; break; @@ -7139,7 +7139,7 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) // if this is null due to the damage area origin-y > 0, then the border // won't show up anyway cell = mAjaCell; - MOZ_FALLTHROUGH; + [[fallthrough]]; case eCellOwner: owner = cell; break; diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index 374bb2562e..9bcced1048 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -653,7 +653,7 @@ nsTableRowFrame::CalculateCellActualBSize(nsTableCellFrame* aCellFrame, break; } // Fall through to the coord case - MOZ_FALLTHROUGH; + [[fallthrough]]; } case eStyleUnit_Coord: { // In quirks mode, table cell isize should be content-box, but bsize diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index 6e8cc3dda1..99cbd421dd 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -2336,7 +2336,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode( Rollup(0, false, nullptr, nullptr); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; #endif case nsIDOMKeyEvent::DOM_VK_LEFT: @@ -2380,7 +2380,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode( break; } // Intentional fall-through to RETURN case - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsIDOMKeyEvent::DOM_VK_RETURN: { // If there is a popup open, check if the current item needs to be opened. diff --git a/ldap/xpcom/src/nsLDAPConnection.cpp b/ldap/xpcom/src/nsLDAPConnection.cpp index 834e803b4c..6457af406a 100644 --- a/ldap/xpcom/src/nsLDAPConnection.cpp +++ b/ldap/xpcom/src/nsLDAPConnection.cpp @@ -645,7 +645,7 @@ NS_IMETHODIMP nsLDAPConnectionRunnable::Run() case LDAP_RES_SEARCH_REFERENCE: // XXX what should we do with LDAP_RES_SEARCH_EXTENDED operationFinished = false; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: { msg = new nsLDAPMessage; diff --git a/mailnews/base/search/src/nsMsgFilterService.cpp b/mailnews/base/search/src/nsMsgFilterService.cpp index c8f52de5aa..9fd0c23e55 100644 --- a/mailnews/base/search/src/nsMsgFilterService.cpp +++ b/mailnews/base/search/src/nsMsgFilterService.cpp @@ -609,7 +609,7 @@ nsresult nsMsgFilterAfterTheFact::ApplyFilter() // would not have run if move succeeded. m_nextAction = numActions; // Fall through to the copy case. - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgFilterAction::CopyToFolder: { nsCString uri; diff --git a/mailnews/base/search/src/nsMsgSearchAdapter.cpp b/mailnews/base/search/src/nsMsgSearchAdapter.cpp index a6f8778305..52a76a9dd1 100644 --- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp +++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp @@ -334,7 +334,7 @@ nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, bool really case nsMsgSearchAttrib::ToOrCC: orHeaderMnemonic = m_kImapCC; // fall through to case nsMsgSearchAttrib::To: - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgSearchAttrib::To: whichMnemonic = m_kImapTo; break; diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index 5b82390c00..281d715291 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -6450,7 +6450,7 @@ NS_IMETHODIMP nsMsgDBView::NoteChange(nsMsgViewIndex firstLineChanged, // RowCountChanged() will call our GetRowCount() mTree->RowCountChanged(firstLineChanged, numChanged); mRemovingRow = false; - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgViewNotificationCode::all: ClearHdrCache(); break; @@ -6730,7 +6730,7 @@ nsresult nsMsgDBView::NavigateFromPos(nsMsgNavigationTypeValue motion, nsMsgView break; case nsMsgNavigationType::firstUnreadMessage: startIndex = nsMsgViewIndex_None; // note fall thru - is this motion ever used? - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgNavigationType::nextUnreadMessage: for (curIndex = (startIndex == nsMsgViewIndex_None) ? 0 : startIndex; curIndex <= lastIndex && lastIndex != nsMsgViewIndex_None; curIndex++) { uint32_t flags = m_flags[curIndex]; diff --git a/mailnews/base/src/nsMsgGroupView.cpp b/mailnews/base/src/nsMsgGroupView.cpp index f3d9a27041..1f20a0378b 100644 --- a/mailnews/base/src/nsMsgGroupView.cpp +++ b/mailnews/base/src/nsMsgGroupView.cpp @@ -227,7 +227,7 @@ nsresult nsMsgGroupView::HashHdr(nsIMsgDBHdr *msgHdr, nsString& aHashKey) break; case nsMsgViewSortType::byReceived: rcvDate = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgViewSortType::byDate: { uint32_t ageBucket; @@ -799,7 +799,7 @@ NS_IMETHODIMP nsMsgGroupView::CellTextForColumn(int32_t aRow, { case nsMsgViewSortType::byReceived: rcvDate = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgViewSortType::byDate: { uint32_t ageBucket = 0; diff --git a/mailnews/compose/src/nsMsgSend.cpp b/mailnews/compose/src/nsMsgSend.cpp index 919d9bfc54..17a54286ea 100644 --- a/mailnews/compose/src/nsMsgSend.cpp +++ b/mailnews/compose/src/nsMsgSend.cpp @@ -174,7 +174,7 @@ static nsresult StripOutGroupNames(char * addresses) group = false; //end of the group, act like a recipient separator now... /* NO BREAK */ - MOZ_FALLTHROUGH; + [[fallthrough]]; case ',': if (!quoted) { diff --git a/mailnews/compose/src/nsSmtpProtocol.cpp b/mailnews/compose/src/nsSmtpProtocol.cpp index 89607224ed..a2c86a6eba 100644 --- a/mailnews/compose/src/nsSmtpProtocol.cpp +++ b/mailnews/compose/src/nsSmtpProtocol.cpp @@ -920,7 +920,7 @@ void nsSmtpProtocol::InitPrefAuthMethods(int32_t authMethodPrefValue) MOZ_LOG(SMTPLogModule, mozilla::LogLevel::Error, ("SMTP: bad pref authMethod = %d\n", authMethodPrefValue)); // fall to any - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgAuthMethod::anything: m_prefAuthMethods = SMTP_AUTH_LOGIN_ENABLED | SMTP_AUTH_PLAIN_ENABLED | diff --git a/mailnews/db/msgdb/src/nsMsgHdr.cpp b/mailnews/db/msgdb/src/nsMsgHdr.cpp index 7c5cf57097..2ff1cce192 100644 --- a/mailnews/db/msgdb/src/nsMsgHdr.cpp +++ b/mailnews/db/msgdb/src/nsMsgHdr.cpp @@ -769,7 +769,7 @@ const char *nsMsgHdr::GetNextReference(const char *startNextRef, // intentional fallthrough so whitespaceEndedAt will definitely have // a non-NULL value, just in case the message-id is not valid (no '>') // and the old-school support is desired. - MOZ_FALLTHROUGH; + [[fallthrough]]; default: if (!whitespaceEndedAt) whitespaceEndedAt = ptr; diff --git a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp index f879c7aa34..b3e732a443 100644 --- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp +++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp @@ -547,7 +547,7 @@ void Tokenizer::tokenizeHeaders(nsIUTF8StringEnumerator * aHeaderNames, nsIUTF8S if (Substring(headerName, 0, 9).Equals("x-mozilla")) break; // fall through - MOZ_FALLTHROUGH; + [[fallthrough]]; case 'u': addTokenForHeader(headerName.get(), headerValue); break; diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 1d08472bb9..5b38433923 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -3508,7 +3508,7 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo msgIsNew = false; } // note that delete falls through to move. - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgFilterAction::MoveToFolder: { // if moving to a different file, do it. diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index 97e61a40ef..3839fade69 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -2775,7 +2775,7 @@ void nsImapProtocol::ProcessSelectedStateURL() case nsIImapUrl::nsImapExpungeFolder: Expunge(); // note fall through to next cases. - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsIImapUrl::nsImapSelectFolder: case nsIImapUrl::nsImapSelectNoopFolder: if (!moreHeadersToDownload) @@ -5624,7 +5624,7 @@ void nsImapProtocol::InitPrefAuthMethods(int32_t authMethodPrefValue) MOZ_LOG(IMAP, LogLevel::Error, ("IMAP: bad pref authMethod = %d\n", authMethodPrefValue)); // fall to any - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgAuthMethod::anything: m_prefAuthMethods = kHasAuthOldLoginCapability | kHasAuthLoginCapability | kHasAuthPlainCapability | diff --git a/mailnews/local/src/nsParseMailbox.cpp b/mailnews/local/src/nsParseMailbox.cpp index da51c03227..3c5dfa02aa 100644 --- a/mailnews/local/src/nsParseMailbox.cpp +++ b/mailnews/local/src/nsParseMailbox.cpp @@ -2026,7 +2026,7 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWi } // FALLTHROUGH - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgFilterAction::MoveToFolder: // if moving to a different file, do it. if (actionTargetFolderUri.get() && !m_inboxUri.Equals(actionTargetFolderUri, diff --git a/mailnews/local/src/nsPop3Protocol.cpp b/mailnews/local/src/nsPop3Protocol.cpp index de129a494e..c89867a9d6 100644 --- a/mailnews/local/src/nsPop3Protocol.cpp +++ b/mailnews/local/src/nsPop3Protocol.cpp @@ -1639,7 +1639,7 @@ void nsPop3Protocol::InitPrefAuthMethods(int32_t authMethodPrefValue) MOZ_LOG(POP3LOGMODULE, LogLevel::Error, (POP3LOG("POP: bad pref authMethod = %d\n"), authMethodPrefValue)); // fall to any - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsMsgAuthMethod::anything: m_prefAuthMethods = POP3_HAS_AUTH_USER | POP3_HAS_AUTH_LOGIN | POP3_HAS_AUTH_PLAIN | @@ -1802,7 +1802,7 @@ int32_t nsPop3Protocol::ProcessAuth() break; case POP3_HAS_AUTH_CRAM_MD5: MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP CRAM"))); - MOZ_FALLTHROUGH; + [[fallthrough]]; case POP3_HAS_AUTH_PLAIN: case POP3_HAS_AUTH_USER: MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("POP username"))); diff --git a/mailnews/mime/src/mimemsig.cpp b/mailnews/mime/src/mimemsig.cpp index 5b4f8e556a..1ad78f3ed9 100644 --- a/mailnews/mime/src/mimemsig.cpp +++ b/mailnews/mime/src/mimemsig.cpp @@ -256,7 +256,7 @@ MimeMultipartSigned_parse_line (const char *line, int32_t length, MimeObject *ob mult->hdrs = 0; /* fall through. */ - MOZ_FALLTHROUGH; + [[fallthrough]]; case MimeMultipartSignedBodyFirstHeader: case MimeMultipartSignedBodyHeaders: case MimeMultipartSignedBodyLine: @@ -406,7 +406,7 @@ MimeMultipartSigned_parse_line (const char *line, int32_t length, MimeObject *ob } /* fall through. */ - MOZ_FALLTHROUGH; + [[fallthrough]]; case MimeMultipartSignedSignatureLine: if (hash_line_p) { @@ -497,7 +497,7 @@ MimeMultipartSigned_parse_child_line (MimeObject *obj, case MimeMultipartSignedBodyHeaders: // How'd we get here? Oh well, fall through. NS_ERROR("wrong state in parse child line"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case MimeMultipartSignedBodyFirstLine: PR_ASSERT(first_line_p); if (!sig->part_buffer) @@ -507,7 +507,7 @@ MimeMultipartSigned_parse_child_line (MimeObject *obj, return MIME_OUT_OF_MEMORY; } /* fall through */ - MOZ_FALLTHROUGH; + [[fallthrough]]; case MimeMultipartSignedBodyLine: { /* This is the first part; we are buffering it, and will emit it all @@ -551,7 +551,7 @@ MimeMultipartSigned_parse_child_line (MimeObject *obj, case MimeMultipartSignedSignatureHeaders: // How'd we get here? Oh well, fall through. NS_ERROR("should have already parse sig hdrs"); - MOZ_FALLTHROUGH; + [[fallthrough]]; case MimeMultipartSignedSignatureFirstLine: case MimeMultipartSignedSignatureLine: /* Nothing to do here -- hashing of the signature part is handled up diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index 035dff6e6f..c5a426947d 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -4549,12 +4549,12 @@ nsresult nsNNTPProtocol::ProcessProtocolState(nsIURI * url, nsIInputStream * inp FinishMemCacheEntry(false); // cleanup mem cache entry if (m_responseCode != MK_NNTP_RESPONSE_ARTICLE_NOTFOUND && m_responseCode != MK_NNTP_RESPONSE_ARTICLE_NONEXIST) return CloseConnection(); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NEWS_FREE: // Remember when we last used this connection m_lastActiveTimeStamp = PR_Now(); CleanupAfterRunningUrl(); - MOZ_FALLTHROUGH; + [[fallthrough]]; case NNTP_SUSPENDED: return NS_OK; break; diff --git a/media/mtransport/transportlayerdtls.cpp b/media/mtransport/transportlayerdtls.cpp index 8522919eef..a13b8c4334 100644 --- a/media/mtransport/transportlayerdtls.cpp +++ b/media/mtransport/transportlayerdtls.cpp @@ -895,7 +895,7 @@ void TransportLayerDtls::Handshake() { MOZ_MTLOG(ML_ERROR, LAYER_INFO << "Malformed DTLS message; ignoring"); // If this were TLS (and not DTLS), this would be fatal, but // here we're required to ignore bad messages, so fall through - MOZ_FALLTHROUGH; + [[fallthrough]]; case PR_WOULD_BLOCK_ERROR: MOZ_MTLOG(ML_NOTICE, LAYER_INFO << "Handshake would have blocked"); PRIntervalTime timeout; diff --git a/mfbt/Assertions.h b/mfbt/Assertions.h index 09a1b8eaa6..a965ae6f1d 100644 --- a/mfbt/Assertions.h +++ b/mfbt/Assertions.h @@ -554,7 +554,7 @@ struct AssertionConditionType * default: * // This case wants to assert in debug builds, fall through in release. * MOZ_ASSERT(false); // -Wimplicit-fallthrough warning in release builds! - * MOZ_FALLTHROUGH; // but -Wunreachable-code warning in debug builds! + * [[fallthrough]]; // but -Wunreachable-code warning in debug builds! * case 5: * return 5; * } @@ -571,7 +571,7 @@ struct AssertionConditionType #ifdef DEBUG # define MOZ_FALLTHROUGH_ASSERT(reason) MOZ_CRASH("MOZ_FALLTHROUGH_ASSERT: " reason) #else -# define MOZ_FALLTHROUGH_ASSERT(...) MOZ_FALLTHROUGH +# define MOZ_FALLTHROUGH_ASSERT(...) [[fallthrough]] #endif /* diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index fdd253d357..5da4ffe948 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -238,50 +238,6 @@ #ifdef __cplusplus -/** - * MOZ_FALLTHROUGH is an annotation to suppress compiler warnings about switch - * cases that fall through without a break or return statement. MOZ_FALLTHROUGH - * is only needed on cases that have code. - * - * MOZ_FALLTHROUGH_ASSERT is an annotation to suppress compiler warnings about - * switch cases that MOZ_ASSERT(false) (or its alias MOZ_ASSERT_UNREACHABLE) in - * debug builds, but intentionally fall through in release builds. See comment - * in Assertions.h for more details. - * - * switch (foo) { - * case 1: // These cases have no code. No fallthrough annotations are needed. - * case 2: - * case 3: // This case has code, so a fallthrough annotation is needed! - * foo++; - * MOZ_FALLTHROUGH; - * case 4: - * return foo; - * - * default: - * // This case asserts in debug builds, falls through in release. - * MOZ_FALLTHROUGH_ASSERT("Unexpected foo value?!"); - * case 5: - * return 5; - * } - */ -#ifndef __has_cpp_attribute -# define __has_cpp_attribute(x) 0 -#endif - -#if __has_cpp_attribute(clang::fallthrough) -# define MOZ_FALLTHROUGH [[clang::fallthrough]] -#elif __has_cpp_attribute(gnu::fallthrough) -# define MOZ_FALLTHROUGH [[gnu::fallthrough]] -#elif defined(_MSC_VER) - /* - * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis): - * https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx - */ -# include <sal.h> -# define MOZ_FALLTHROUGH __fallthrough -#else -# define MOZ_FALLTHROUGH /* FALLTHROUGH */ -#endif /* * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time * instrumentation shipped with Clang and GCC) to not instrument the annotated diff --git a/modules/libjar/nsJARInputStream.cpp b/modules/libjar/nsJARInputStream.cpp index a1f6c1d560..a26cd38ea8 100644 --- a/modules/libjar/nsJARInputStream.cpp +++ b/modules/libjar/nsJARInputStream.cpp @@ -118,7 +118,7 @@ nsJARInputStream::InitDirectory(nsJAR* aJar, case ')': case '\\': escDirName.Append('\\'); - MOZ_FALLTHROUGH; + [[fallthrough]]; default: escDirName.Append(*curr); } diff --git a/mozglue/linker/XZStream.cpp b/mozglue/linker/XZStream.cpp index bd71655f52..7ddbd875ac 100644 --- a/mozglue/linker/XZStream.cpp +++ b/mozglue/linker/XZStream.cpp @@ -94,11 +94,11 @@ XZStream::Decode(void* aOutBuf, size_t aOutSize) case XZ_STREAM_END: // Stream ended, the next loop iteration should terminate. MOZ_ASSERT(mBuffers.in_pos == mBuffers.in_size); - MOZ_FALLTHROUGH; + [[fallthrough]]; #ifdef XZ_DEC_ANY_CHECK case XZ_UNSUPPORTED_CHECK: // Ignore unsupported check. - MOZ_FALLTHROUGH; + [[fallthrough]]; #endif case XZ_OK: // Chunk decoded, proceed. @@ -121,7 +121,7 @@ XZStream::Decode(void* aOutBuf, size_t aOutSize) return 0; case XZ_DATA_ERROR: - MOZ_FALLTHROUGH; + [[fallthrough]]; case XZ_BUF_ERROR: ERROR("XZ decoding: corrupt input stream"); return 0; diff --git a/netwerk/base/nsURLHelper.cpp b/netwerk/base/nsURLHelper.cpp index 0ddbdb6a6a..1024b2ef53 100644 --- a/netwerk/base/nsURLHelper.cpp +++ b/netwerk/base/nsURLHelper.cpp @@ -427,7 +427,7 @@ net_ResolveRelativePath(const nsACString &relativePath, case '#': case '?': stop = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '/': // delimiter found if (name.EqualsLiteral("..")) { diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index 05bd6e06f2..c18ad012af 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -303,17 +303,17 @@ nsDiskCache::Hash(const char * key, PLDHashNumber initval) /*------------------------------------- handle the last 11 bytes */ c += length; switch(len) { /* all the case statements fall through */ - case 11: c += (uint32_t(k[10])<<24); MOZ_FALLTHROUGH; - case 10: c += (uint32_t(k[9])<<16); MOZ_FALLTHROUGH; - case 9 : c += (uint32_t(k[8])<<8); MOZ_FALLTHROUGH; + case 11: c += (uint32_t(k[10])<<24); [[fallthrough]]; + case 10: c += (uint32_t(k[9])<<16); [[fallthrough]]; + case 9 : c += (uint32_t(k[8])<<8); [[fallthrough]]; /* the low-order byte of c is reserved for the length */ - case 8 : b += (uint32_t(k[7])<<24); MOZ_FALLTHROUGH; - case 7 : b += (uint32_t(k[6])<<16); MOZ_FALLTHROUGH; - case 6 : b += (uint32_t(k[5])<<8); MOZ_FALLTHROUGH; - case 5 : b += k[4]; MOZ_FALLTHROUGH; - case 4 : a += (uint32_t(k[3])<<24); MOZ_FALLTHROUGH; - case 3 : a += (uint32_t(k[2])<<16); MOZ_FALLTHROUGH; - case 2 : a += (uint32_t(k[1])<<8); MOZ_FALLTHROUGH; + case 8 : b += (uint32_t(k[7])<<24); [[fallthrough]]; + case 7 : b += (uint32_t(k[6])<<16); [[fallthrough]]; + case 6 : b += (uint32_t(k[5])<<8); [[fallthrough]]; + case 5 : b += k[4]; [[fallthrough]]; + case 4 : a += (uint32_t(k[3])<<24); [[fallthrough]]; + case 3 : a += (uint32_t(k[2])<<16); [[fallthrough]]; + case 2 : a += (uint32_t(k[1])<<8); [[fallthrough]]; case 1 : a += k[0]; /* case 0: nothing left to add */ } diff --git a/netwerk/cache2/CacheHashUtils.cpp b/netwerk/cache2/CacheHashUtils.cpp index 6783f0b869..3dd169c420 100644 --- a/netwerk/cache2/CacheHashUtils.cpp +++ b/netwerk/cache2/CacheHashUtils.cpp @@ -58,17 +58,17 @@ CacheHash::Hash(const char *aData, uint32_t aSize, uint32_t aInitval) /*------------------------------------- handle the last 11 bytes */ c += aSize; switch(len) { /* all the case statements fall through */ - case 11: c += (uint32_t(k[10])<<24); MOZ_FALLTHROUGH; - case 10: c += (uint32_t(k[9])<<16); MOZ_FALLTHROUGH; - case 9 : c += (uint32_t(k[8])<<8); MOZ_FALLTHROUGH; + case 11: c += (uint32_t(k[10])<<24); [[fallthrough]]; + case 10: c += (uint32_t(k[9])<<16); [[fallthrough]]; + case 9 : c += (uint32_t(k[8])<<8); [[fallthrough]]; /* the low-order byte of c is reserved for the length */ - case 8 : b += (uint32_t(k[7])<<24); MOZ_FALLTHROUGH; - case 7 : b += (uint32_t(k[6])<<16); MOZ_FALLTHROUGH; - case 6 : b += (uint32_t(k[5])<<8); MOZ_FALLTHROUGH; - case 5 : b += k[4]; MOZ_FALLTHROUGH; - case 4 : a += (uint32_t(k[3])<<24); MOZ_FALLTHROUGH; - case 3 : a += (uint32_t(k[2])<<16); MOZ_FALLTHROUGH; - case 2 : a += (uint32_t(k[1])<<8); MOZ_FALLTHROUGH; + case 8 : b += (uint32_t(k[7])<<24); [[fallthrough]]; + case 7 : b += (uint32_t(k[6])<<16); [[fallthrough]]; + case 6 : b += (uint32_t(k[5])<<8); [[fallthrough]]; + case 5 : b += k[4]; [[fallthrough]]; + case 4 : a += (uint32_t(k[3])<<24); [[fallthrough]]; + case 3 : a += (uint32_t(k[2])<<16); [[fallthrough]]; + case 2 : a += (uint32_t(k[1])<<8); [[fallthrough]]; case 1 : a += k[0]; /* case 0: nothing left to add */ } @@ -158,8 +158,8 @@ CacheHash::Update(const char *aData, uint32_t aLen) } switch (aLen) { - case 3: mBuf += data[2] << 16; MOZ_FALLTHROUGH; - case 2: mBuf += data[1] << 8; MOZ_FALLTHROUGH; + case 3: mBuf += data[2] << 16; [[fallthrough]]; + case 2: mBuf += data[1] << 8; [[fallthrough]]; case 1: mBuf += data[0]; } diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 0c46647c63..1fae397278 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -152,7 +152,7 @@ private: if (!mDoNotSearchInUpdates) { entry = mIndex->mPendingUpdates.GetEntry(*mHash); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case CacheIndex::BUILDING: case CacheIndex::UPDATING: case CacheIndex::READY: @@ -459,7 +459,7 @@ CacheIndex::Shutdown() switch (oldState) { case WRITING: index->FinishWrite(false, lock); - MOZ_FALLTHROUGH; + [[fallthrough]]; case READY: if (index->mIndexOnDiskIsValid && !index->mDontMarkIndexClean) { if (!sanitize && NS_FAILED(index->WriteLogToDisk())) { @@ -1153,7 +1153,7 @@ CacheIndex::HasEntry(const SHA1Sum::Hash &hash, EntryStatus *_retval, bool *_pin case READING: case WRITING: entry = index->mPendingUpdates.GetEntry(hash); - MOZ_FALLTHROUGH; + [[fallthrough]]; case BUILDING: case UPDATING: case READY: diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 0ed854e916..9890ce4806 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -450,7 +450,7 @@ private: } mPass = ITERATE_METADATA; - MOZ_FALLTHROUGH; + [[fallthrough]]; case ITERATE_METADATA: // Now grab the context iterator. diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 2549ffaccb..d08f7fc3c5 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -992,7 +992,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) NS_ENSURE_SUCCESS(rv, RESULT_RETRY); } // Fall through to the next upgrade. - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: { @@ -1051,7 +1051,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) NS_ENSURE_SUCCESS(rv, RESULT_RETRY); } // Fall through to the next upgrade. - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: { @@ -1148,7 +1148,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) NS_ENSURE_SUCCESS(rv, RESULT_RETRY); } // Fall through to the next upgrade. - MOZ_FALLTHROUGH; + [[fallthrough]]; case 4: { @@ -1196,7 +1196,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) ("Upgraded database to schema version 5")); } // Fall through to the next upgrade. - MOZ_FALLTHROUGH; + [[fallthrough]]; case 5: { @@ -1262,7 +1262,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) COOKIE_LOGSTRING(LogLevel::Debug, ("Upgraded database to schema version 6")); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case 6: { @@ -1322,7 +1322,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) // No more upgrades. Update the schema version. rv = mDefaultDBState->dbConn->SetSchemaVersion(COOKIES_SCHEMA_VERSION); NS_ENSURE_SUCCESS(rv, RESULT_RETRY); - MOZ_FALLTHROUGH; + [[fallthrough]]; case COOKIES_SCHEMA_VERSION: break; @@ -1340,7 +1340,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) NS_ENSURE_SUCCESS(rv, RESULT_RETRY); } // fall through to downgrade check - MOZ_FALLTHROUGH; + [[fallthrough]]; // downgrading. // if columns have been added to the table, we can still use the ones we diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 9b8f13c2d2..bcb7f73362 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -1357,7 +1357,7 @@ Http2Stream::OnReadSegment(const char *buf, mRequestBodyLenRemaining -= dataLength; GenerateDataFrameHeader(dataLength, !mRequestBodyLenRemaining); ChangeState(SENDING_BODY); - MOZ_FALLTHROUGH; + [[fallthrough]]; case SENDING_BODY: MOZ_ASSERT(mTxInlineFrameUsed, "OnReadSegment Send Data Header 0b"); diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 0b4929bbc8..fe8bbc5efa 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1577,7 +1577,7 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer, // No URL, so fall through to truncating the path and any query/ref off // as well. } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: // (Pref limited to [0,2] enforced by clamp, MOZ_CRASH overkill.) case 2: // scheme+host+port+/ spec.AppendLiteral("/"); diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 6c6865c239..6532adf24a 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -1668,7 +1668,7 @@ nsHttpTransaction::HandleContentStart() switch (mResponseHead->Status()) { case 101: mPreserveStream = true; - MOZ_FALLTHROUGH; // to other no content cases: + [[fallthrough]]; // to other no content cases: case 204: case 205: case 304: diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 9fca09a087..d645a96afd 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -2153,7 +2153,7 @@ WebSocketChannel::PrimeNewOutgoingMessage() msgType = kMsgTypeBinaryString; // no break: fall down into binary string case - MOZ_FALLTHROUGH; + [[fallthrough]]; case kMsgTypeBinaryString: mOutHeader[0] = kFinalFragBit | nsIWebSocketFrame::OPCODE_BINARY; diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index 02dca930c5..db0e2f7f75 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -544,7 +544,7 @@ public: case ON_DISCONNECTED: // If we've disconnected, make sure we close all the streams - from mainthread! mConnection->CloseAll(); - MOZ_FALLTHROUGH; + [[fallthrough]]; case ON_CHANNEL_CREATED: case ON_CONNECTION: // WeakPtr - only used/modified/nulled from MainThread so we can use a WeakPtr here diff --git a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp index db23cca35f..c5be10b216 100644 --- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp +++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp @@ -53,7 +53,7 @@ mozTXTToHTMLConv::EscapeChar(const char16_t ch, nsString& aStringToAppendTo, break; } // else fall through - MOZ_FALLTHROUGH; + [[fallthrough]]; default: aStringToAppendTo += ch; } @@ -101,7 +101,7 @@ mozTXTToHTMLConv::EscapeStr(nsString& aInString, bool inAttribute) break; } // else fall through - MOZ_FALLTHROUGH; + [[fallthrough]]; default: i++; } @@ -512,7 +512,7 @@ mozTXTToHTMLConv::FindURL(const char16_t * aInString, int32_t aInLength, const u { case '@': state[RFC2396E] = unchecked; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '.': state[abbreviated] = unchecked; break; diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp index b540240322..6030e1c8d6 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp @@ -291,7 +291,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest* request, return NS_OK; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case HTTP_COMPRESS_DEFLATE: diff --git a/parser/html/nsHtml5Highlighter.cpp b/parser/html/nsHtml5Highlighter.cpp index b08179fbd2..7f393a5490 100644 --- a/parser/html/nsHtml5Highlighter.cpp +++ b/parser/html/nsHtml5Highlighter.cpp @@ -577,7 +577,7 @@ nsHtml5Highlighter::FlushChars() // the input data, because there are no reparses in the View Source // case, so we won't need the original data in the buffer anymore. buf[i] = '\n'; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '\n': { ++i; if (mCStart < i) { diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index 05527cf9b0..7aad79a127 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -172,7 +172,7 @@ bool EnsureNSSInitialized(EnsureNSSOperator op) case nssInitFailed: NS_ASSERTION(loading, "Bad call to EnsureNSSInitialized(nssInitFailed)"); loading = false; - MOZ_FALLTHROUGH; + [[fallthrough]]; case nssShutdown: PR_AtomicSet(&haveLoaded, 0); diff --git a/storage/mozStoragePrivateHelpers.cpp b/storage/mozStoragePrivateHelpers.cpp index 0c4a890504..5aa72b2b65 100644 --- a/storage/mozStoragePrivateHelpers.cpp +++ b/storage/mozStoragePrivateHelpers.cpp @@ -229,7 +229,7 @@ convertVariantToStorageVariant(nsIVariant* aVariant) // Take ownership of the data avoiding a further copy. return new AdoptedBlobVariant(v); } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDataType::VTYPE_EMPTY: case nsIDataType::VTYPE_EMPTY_ARRAY: diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 587c1ac8ab..d2eccc7b64 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -491,7 +491,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 2: // Add referrer column to the database { @@ -506,7 +506,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 3: // This version adds a column to the database (entityID) { @@ -521,7 +521,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 4: // This version adds a column to the database (tempPath) { @@ -536,7 +536,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 5: // This version adds two columns for tracking transfer progress { @@ -556,7 +556,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 6: // This version adds three columns to DB (MIME type related info) { @@ -581,7 +581,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; case 7: // This version adds a column to remember to auto-resume downloads { @@ -596,7 +596,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to the next upgrade - MOZ_FALLTHROUGH; + [[fallthrough]]; // Warning: schema versions >=8 must take into account that they can // be operating on schemas from unknown, future versions that have @@ -631,7 +631,7 @@ nsDownloadManager::InitFileDB() // Extra sanity checking for developers #ifndef DEBUG - MOZ_FALLTHROUGH; + [[fallthrough]]; case DM_SCHEMA_VERSION: #endif break; @@ -648,7 +648,7 @@ nsDownloadManager::InitFileDB() NS_ENSURE_SUCCESS(rv, rv); } // Fallthrough to downgrade check - MOZ_FALLTHROUGH; + [[fallthrough]]; // Downgrading // If columns have been added to the table, we can still use the ones we diff --git a/toolkit/components/places/nsAnnotationService.cpp b/toolkit/components/places/nsAnnotationService.cpp index 9d62bd34a8..9e42836144 100644 --- a/toolkit/components/places/nsAnnotationService.cpp +++ b/toolkit/components/places/nsAnnotationService.cpp @@ -211,7 +211,7 @@ nsAnnotationService::SetPageAnnotation(nsIURI* aURI, return NS_OK; } // Fall through int64_t case otherwise. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDataType::VTYPE_INT64: case nsIDataType::VTYPE_UINT64: { @@ -224,7 +224,7 @@ nsAnnotationService::SetPageAnnotation(nsIURI* aURI, return NS_OK; } // Fall through double case otherwise. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDataType::VTYPE_FLOAT: case nsIDataType::VTYPE_DOUBLE: { @@ -296,7 +296,7 @@ nsAnnotationService::SetItemAnnotation(int64_t aItemId, return NS_OK; } // Fall through int64_t case otherwise. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDataType::VTYPE_INT64: case nsIDataType::VTYPE_UINT64: { @@ -309,7 +309,7 @@ nsAnnotationService::SetItemAnnotation(int64_t aItemId, return NS_OK; } // Fall through double case otherwise. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case nsIDataType::VTYPE_FLOAT: case nsIDataType::VTYPE_DOUBLE: { diff --git a/toolkit/components/places/nsNavHistoryResult.cpp b/toolkit/components/places/nsNavHistoryResult.cpp index 64d06308fd..f07487dfcd 100644 --- a/toolkit/components/places/nsNavHistoryResult.cpp +++ b/toolkit/components/places/nsNavHistoryResult.cpp @@ -2452,7 +2452,7 @@ nsNavHistoryQueryResultNode::OnVisit(nsIURI* aURI, int64_t aVisitId, // Fall through to check the time, if the time is not present it will // still match. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case QUERYUPDATE_TIME: { @@ -2479,7 +2479,7 @@ nsNavHistoryQueryResultNode::OnVisit(nsIURI* aURI, int64_t aVisitId, } // Now we know that our visit satisfies the time range, fall through to // the QUERYUPDATE_SIMPLE case below. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case QUERYUPDATE_SIMPLE: { @@ -2917,7 +2917,7 @@ nsNavHistoryQueryResultNode::OnItemChanged(int64_t aItemId, // folders titles. if (mOptions->ResultType() != nsINavHistoryQueryOptions::RESULTS_AS_TAG_QUERY) return NS_OK; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: (void)Refresh(); } diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp index aac1870490..69354930e0 100644 --- a/toolkit/components/satchel/nsFormFillController.cpp +++ b/toolkit/components/satchel/nsFormFillController.cpp @@ -1062,7 +1062,7 @@ nsFormFillController::KeyPress(nsIDOMEvent* aEvent) if (isCtrl || isAlt || isMeta) break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsIDOMKeyEvent::DOM_VK_UP: case nsIDOMKeyEvent::DOM_VK_DOWN: case nsIDOMKeyEvent::DOM_VK_LEFT: diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index f5f71935dc..073c0452fb 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -3764,7 +3764,7 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) LOG(("add_dir_entries: found a non-standard file: " LOG_S, ftsdirEntry->fts_path)); // Fall through and try to remove as a file - MOZ_FALLTHROUGH; + [[fallthrough]]; // Files case FTS_F: @@ -3813,7 +3813,7 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) rv = OK; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case FTS_ERR: rv = UNEXPECTED_FILE_OPERATION_ERROR; diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index 577d74e6f5..69b6333b83 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -961,7 +961,7 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir, break; } // Intentional fallthrough to ePendingUpdate. - MOZ_FALLTHROUGH; + [[fallthrough]]; } case ePendingUpdate: { ApplyUpdate(greDir, updatesDir, statusFile, appDir, argc, argv, restart, diff --git a/tools/power/rapl.cpp b/tools/power/rapl.cpp index 54c00f79f8..33cc2d781e 100644 --- a/tools/power/rapl.cpp +++ b/tools/power/rapl.cpp @@ -345,7 +345,7 @@ public: case 63: // 0x3f: Haswell-Server mHasRamUnitsQuirk = true; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 45: // 0x2d: Sandy Bridge-EP case 62: // 0x3e: Ivy Bridge-E // Supports package, cores, RAM. diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 698090718f..9112b67329 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1794,7 +1794,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ msgId.AssignLiteral("helperAppNotFound"); break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; default: // Generic read/write/launch error message. diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index 9eefa6f372..a9658bbc06 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -984,7 +984,7 @@ GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo) } else { RemovePrefForDriverVersion(); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsIGfxInfo::FEATURE_BLOCKED_MISMATCHED_VERSION: case nsIGfxInfo::FEATURE_BLOCKED_DEVICE: diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 59c80672b1..f529ec7b1a 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -382,7 +382,7 @@ WidgetEvent::IsAllowedToDispatchDOMEvent() const if (mMessage == eMouseTouchDrag) { return false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case ePointerEventClass: // We want synthesized mouse moves to cause mouseover and mouseout // DOM events (EventStateManager::PreHandleEvent), but not mousemove diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index cb4e7debf2..cfb9ef7eda 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -1306,7 +1306,7 @@ nsNativeThemeGTK::GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame, // will need to fall through and use the default case as before. if (IsRegularMenuItem(aFrame)) break; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: { WidgetNodeType gtkWidgetType; @@ -1847,7 +1847,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, if (aFrame && aFrame->GetWritingMode().IsVertical()) { return false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_THEME_BUTTON: case NS_THEME_BUTTON_FOCUS: diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index b4801fa19c..c7bb60a675 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -1890,7 +1890,7 @@ NativeKey::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, if (mCharMessageHasGone) { aKeyEvent.PreventDefaultBeforeDispatch(); } - MOZ_FALLTHROUGH; + [[fallthrough]]; case eKeyDownOnPlugin: aKeyEvent.mKeyCode = mDOMKeyCode; // Unique id for this keydown event and its associated keypress. diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 295518ea26..c636d38700 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3525,7 +3525,7 @@ void* nsWindow::GetNativeData(uint32_t aDataType) if (pseudoIMEContext) { return pseudoIMEContext; } - MOZ_FALLTHROUGH; + [[fallthrough]]; } case NS_NATIVE_TSF_THREAD_MGR: case NS_NATIVE_TSF_CATEGORY_MGR: @@ -7660,7 +7660,7 @@ nsWindow::DealWithPopups(HWND aWnd, UINT aMessage, // compatibility mouse events will do it instead. return false; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index c4d4437a9b..48b7e8e018 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -402,7 +402,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, case NS_ASSERT_STACK_AND_ABORT: nsTraceRefcnt::WalkTheStack(stderr); // Fall through to abort - MOZ_FALLTHROUGH; + [[fallthrough]]; case NS_ASSERT_ABORT: Abort(buf.buffer); diff --git a/xpcom/ds/nsCheapSets.h b/xpcom/ds/nsCheapSets.h index c2375b85f2..1d5aa21a8f 100644 --- a/xpcom/ds/nsCheapSets.h +++ b/xpcom/ds/nsCheapSets.h @@ -134,7 +134,7 @@ nsCheapSet<EntryType>::Put(const KeyType aVal) mUnion.table = table; mState = MANY; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case MANY: mUnion.table->PutEntry(aVal); diff --git a/xpcom/ds/nsPersistentProperties.cpp b/xpcom/ds/nsPersistentProperties.cpp index 4bbaac905d..50295984ac 100644 --- a/xpcom/ds/nsPersistentProperties.cpp +++ b/xpcom/ds/nsPersistentProperties.cpp @@ -226,7 +226,7 @@ nsPropertiesParser::ParseValueCharacter(char16_t aChar, const char16_t* aCur, aTokenStart = aCur + 1; break; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case '\r': // we're done! We have a key and value diff --git a/xpcom/ds/nsVariant.cpp b/xpcom/ds/nsVariant.cpp index 7e797117ad..ffec2575f0 100644 --- a/xpcom/ds/nsVariant.cpp +++ b/xpcom/ds/nsVariant.cpp @@ -355,7 +355,7 @@ CloneArray(uint16_t aInType, const nsIID* aInIID, if (aOutIID) { *aOutIID = *aInIID; } - MOZ_FALLTHROUGH; + [[fallthrough]]; case nsIDataType::VTYPE_INTERFACE: { memcpy(*aOutValue, aInValue, allocSize); @@ -759,7 +759,7 @@ nsDiscriminatedUnion::ToString(nsACString& aOutString) const case nsIDataType::VTYPE_WSTRING_SIZE_IS: case nsIDataType::VTYPE_WCHAR: NS_ERROR("ToString being called for a string type - screwy logic!"); - MOZ_FALLTHROUGH; + [[fallthrough]]; // XXX We might want stringified versions of these... ??? diff --git a/xpcom/glue/nsTextFormatter.cpp b/xpcom/glue/nsTextFormatter.cpp index 96cd85712d..1c3f60fb90 100644 --- a/xpcom/glue/nsTextFormatter.cpp +++ b/xpcom/glue/nsTextFormatter.cpp @@ -352,14 +352,14 @@ cvt_f(SprintfState* aState, double aDouble, int aWidth, int aPrec, break; case 'E': exp = 'E'; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 'e': numdigits = aPrec + 1; mode = 2; break; case 'G': exp = 'E'; - MOZ_FALLTHROUGH; + [[fallthrough]]; case 'g': if (aPrec == 0) { aPrec = 1; diff --git a/xpcom/io/nsWildCard.cpp b/xpcom/io/nsWildCard.cpp index 1250a41618..18c58810fd 100644 --- a/xpcom/io/nsWildCard.cpp +++ b/xpcom/io/nsWildCard.cpp @@ -80,7 +80,7 @@ _valid_subexp(const T* aExpr, T aStop1, T aStop2) return INVALID_SXP; } ++tld; - MOZ_FALLTHROUGH; + [[fallthrough]]; case '*': case '?': case '$': @@ -396,7 +396,7 @@ _shexp_match(const T* aStr, const T* aExpr, bool aCaseInsensitive, return ABORTED; case '\\': ++y; - MOZ_FALLTHROUGH; + [[fallthrough]]; default: if (aCaseInsensitive) { if (::upper(aStr[x]) != ::upper(aExpr[y])) { |