From 912aeb9ab5cb088cbd8bfd6d586974e1d2684603 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 18 Jan 2021 16:50:16 +0000 Subject: [PATCH] Bug 1519636 - Reformat recent changes to the Google coding style r=andi Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA) # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D102084 --- dom/canvas/ClientWebGLContext.cpp | 4 ++-- dom/canvas/ImageBitmap.cpp | 4 ++-- dom/media/webrtc/CubebDeviceEnumerator.cpp | 7 +++---- gfx/gl/GLBlitHelper.cpp | 8 ++++---- js/src/gc/Marking.cpp | 6 +++--- js/src/gc/Nursery.cpp | 11 ++++++----- js/src/jit/arm/Lowering-arm.cpp | 1 - js/src/jit/mips-shared/Lowering-mips-shared.cpp | 1 - js/src/jit/shared/Lowering-shared.cpp | 2 +- js/src/jsapi-tests/testGCOutOfMemory.cpp | 2 +- js/src/vm/ArrayBufferViewObject.cpp | 5 ++--- layout/generic/ReflowInput.cpp | 3 ++- layout/generic/nsFlexContainerFrame.cpp | 7 +++---- widget/GfxInfoBase.cpp | 3 +-- 14 files changed, 30 insertions(+), 34 deletions(-) diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp index 2a36ff814ac3..6015d42679e0 100644 --- a/dom/canvas/ClientWebGLContext.cpp +++ b/dom/canvas/ClientWebGLContext.cpp @@ -4035,7 +4035,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, EnqueueError(LOCAL_GL_INVALID_OPERATION, "Non-DOM-Element uploads with alpha-premult" " or y-flip do not support subrect selection."); - scopedArr.Reset(); // (For the hazard analysis) Done with the data. + scopedArr.Reset(); // (For the hazard analysis) Done with the data. return; } } @@ -4090,7 +4090,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, Run(static_cast(level), respecFormat, CastUvec3(offset), pi, std::move(*desc)); - scopedArr.Reset(); // (For the hazard analysis) Done with the data. + scopedArr.Reset(); // (For the hazard analysis) Done with the data. } void ClientWebGLContext::CompressedTexImage(bool sub, uint8_t funcDims, diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index e84a1c1fe4e4..da8f3d12017c 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -895,8 +895,8 @@ already_AddRefed ImageBitmap::CreateInternal( array.Reset(); if (NS_IsMainThread()) { - data = CreateImageFromRawData(imageSize, imageStride, FORMAT, - fixedData, dataLength, aCropRect); + data = CreateImageFromRawData(imageSize, imageStride, FORMAT, fixedData, + dataLength, aCropRect); } else { RefPtr task = new CreateImageFromRawDataInMainThreadSyncTask( diff --git a/dom/media/webrtc/CubebDeviceEnumerator.cpp b/dom/media/webrtc/CubebDeviceEnumerator.cpp index 3ba94df30d6f..f7f8ec46d86d 100644 --- a/dom/media/webrtc/CubebDeviceEnumerator.cpp +++ b/dom/media/webrtc/CubebDeviceEnumerator.cpp @@ -265,10 +265,9 @@ void CubebDeviceEnumerator::EnumerateAudioDevices( // Bug 1660391: we can't use fluent here yet to get localized strings, so // those are hard-coded en_US strings for now. RefPtr info = new AudioDeviceInfo( - nullptr, name, u""_ns, u""_ns, - type, CUBEB_DEVICE_STATE_ENABLED, CUBEB_DEVICE_PREF_ALL, - CUBEB_DEVICE_FMT_ALL, CUBEB_DEVICE_FMT_S16NE, channels, 44100, 44100, - 44100, 441, 128); + nullptr, name, u""_ns, u""_ns, type, CUBEB_DEVICE_STATE_ENABLED, + CUBEB_DEVICE_PREF_ALL, CUBEB_DEVICE_FMT_ALL, CUBEB_DEVICE_FMT_S16NE, + channels, 44100, 44100, 44100, 441, 128); devices.AppendElement(info); } #else diff --git a/gfx/gl/GLBlitHelper.cpp b/gfx/gl/GLBlitHelper.cpp index fe7c5bf4a2e9..bc3e78b3f141 100644 --- a/gfx/gl/GLBlitHelper.cpp +++ b/gfx/gl/GLBlitHelper.cpp @@ -680,10 +680,10 @@ const DrawBlitProg* GLBlitHelper::CreateDrawBlitProg( // ----------------------------------------------------------------------------- #ifdef XP_MACOSX -static RefPtr LookupSurface(const layers::SurfaceDescriptorMacIOSurface& sd) { - return MacIOSurface::LookupSurface( - sd.surfaceId(), sd.scaleFactor(), - !sd.isOpaque(), sd.yUVColorSpace()); +static RefPtr LookupSurface( + const layers::SurfaceDescriptorMacIOSurface& sd) { + return MacIOSurface::LookupSurface(sd.surfaceId(), sd.scaleFactor(), + !sd.isOpaque(), sd.yUVColorSpace()); } #endif diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index b66149854e97..36be7be2b714 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -271,10 +271,10 @@ void js::CheckTracedThing(JSTracer* trc, const T& thing) { } namespace js { -#define IMPL_CHECK_TRACED_THING(_, type, _1, _2) \ - template void CheckTracedThing(JSTracer*, type*); +# define IMPL_CHECK_TRACED_THING(_, type, _1, _2) \ + template void CheckTracedThing(JSTracer*, type*); JS_FOR_EACH_TRACEKIND(IMPL_CHECK_TRACED_THING); -#undef IMPL_CHECK_TRACED_THING +# undef IMPL_CHECK_TRACED_THING } // namespace js #endif diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 9da5a92bd1a0..096d51de7346 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -876,9 +876,8 @@ void js::Nursery::printCollectionProfile(JS::GCReason reason, TimeDuration ts = collectionStartTime() - stats().creationTime(); fprintf(stderr, "MinorGC: %12p %10.6f %-20.20s %4.1f%% %5zu %5zu %6" PRIu32, - runtime(), - ts.ToSeconds(), JS::ExplainGCReason(reason), promotionRate * 100, - previousGC.nurseryCapacity / 1024, + runtime(), ts.ToSeconds(), JS::ExplainGCReason(reason), + promotionRate * 100, previousGC.nurseryCapacity / 1024, capacity() / 1024, stats().getStat(gcstats::STAT_STRINGS_DEDUPLICATED)); @@ -888,7 +887,8 @@ void js::Nursery::printCollectionProfile(JS::GCReason reason, // static void js::Nursery::printProfileHeader() { fprintf(stderr, - "MinorGC: Runtime Timestamp Reason PRate OldSz NewSz Dedup"); + "MinorGC: Runtime Timestamp Reason PRate OldSz " + "NewSz Dedup"); #define PRINT_HEADER(name, text) fprintf(stderr, " %6s", text); FOR_EACH_NURSERY_PROFILE_TIME(PRINT_HEADER) #undef PRINT_HEADER @@ -906,7 +906,8 @@ void js::Nursery::printProfileDurations(const ProfileDurations& times) { void js::Nursery::printTotalProfileTimes() { if (enableProfiling_) { fprintf(stderr, - "MinorGC TOTALS: %7" PRIu64 " collections: %16" PRIu64, + "MinorGC TOTALS: %7" PRIu64 + " collections: %16" PRIu64, gc->stringStats.deduplicatedStrings, gc->minorGCCount()); printProfileDurations(totalDurations_); } diff --git a/js/src/jit/arm/Lowering-arm.cpp b/js/src/jit/arm/Lowering-arm.cpp index ab8d9886e823..4d31b20eeac1 100644 --- a/js/src/jit/arm/Lowering-arm.cpp +++ b/js/src/jit/arm/Lowering-arm.cpp @@ -1078,7 +1078,6 @@ void LIRGenerator::visitSignExtendInt64(MSignExtendInt64* ins) { ins); } - void LIRGenerator::visitWasmBitselectSimd128(MWasmBitselectSimd128* ins) { MOZ_CRASH("bitselect NYI"); } diff --git a/js/src/jit/mips-shared/Lowering-mips-shared.cpp b/js/src/jit/mips-shared/Lowering-mips-shared.cpp index 07c66f72f2d5..3afc14a37945 100644 --- a/js/src/jit/mips-shared/Lowering-mips-shared.cpp +++ b/js/src/jit/mips-shared/Lowering-mips-shared.cpp @@ -832,7 +832,6 @@ void LIRGenerator::visitSignExtendInt64(MSignExtendInt64* ins) { ins); } - void LIRGenerator::visitWasmBitselectSimd128(MWasmBitselectSimd128* ins) { MOZ_CRASH("bitselect NYI"); } diff --git a/js/src/jit/shared/Lowering-shared.cpp b/js/src/jit/shared/Lowering-shared.cpp index 709ee779d1df..9d6faf4a8ae7 100644 --- a/js/src/jit/shared/Lowering-shared.cpp +++ b/js/src/jit/shared/Lowering-shared.cpp @@ -1031,4 +1031,4 @@ void LIRGeneratorShared::ReportShuffleSpecialization(const Shuffle& s) { } # endif // DEBUG -#endif // ENABLE_WASM_SIMD +#endif // ENABLE_WASM_SIMD diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp index 123db205c1a0..f71e80d348ad 100644 --- a/js/src/jsapi-tests/testGCOutOfMemory.cpp +++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp @@ -8,7 +8,7 @@ #include "mozilla/Utf8.h" // mozilla::Utf8Unit -#include "gc/GCEnum.h" // js::gc::ZealMode +#include "gc/GCEnum.h" // js::gc::ZealMode #include "js/CompilationAndEvaluation.h" // JS::Evaluate #include "js/SourceText.h" // JS::Source{Ownership,Text} #include "jsapi-tests/tests.h" diff --git a/js/src/vm/ArrayBufferViewObject.cpp b/js/src/vm/ArrayBufferViewObject.cpp index 7bd93aba7509..07ce5c207ac8 100644 --- a/js/src/vm/ArrayBufferViewObject.cpp +++ b/js/src/vm/ArrayBufferViewObject.cpp @@ -177,8 +177,7 @@ JS_FRIEND_API void* JS_GetArrayBufferViewData(JSObject* obj, JS_FRIEND_API uint8_t* JS_GetArrayBufferViewFixedData(JSObject* obj, uint8_t* buffer, - size_t bufSize) -{ + size_t bufSize) { ArrayBufferViewObject* view = obj->maybeUnwrapAs(); if (!view) { return nullptr; @@ -196,7 +195,7 @@ JS_FRIEND_API uint8_t* JS_GetArrayBufferViewFixedData(JSObject* obj, if (ta->hasInlineElements()) { size_t bytes = ta->byteLength().get(); if (bytes > bufSize) { - return nullptr; // Does not fit. + return nullptr; // Does not fit. } memcpy(buffer, view->dataPointerUnshared(), bytes); return buffer; diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 0167e45597c4..6e581723daaf 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -2279,7 +2279,8 @@ void ReflowInput::InitConstraints( const bool isBlockLevel = (mStyleDisplay->DisplayOutside() == StyleDisplayOutside::Block || - mStyleDisplay->DisplayOutside() == StyleDisplayOutside::TableCaption || + mStyleDisplay->DisplayOutside() == + StyleDisplayOutside::TableCaption || mFrame->IsTableFrame()) && // XXX abs.pos. continuations treated like blocks, see comment in // the else-if condition above. diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 53ef4fd8454d..7c69d80366a4 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -4467,11 +4467,10 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, // Check if we may need a next-in-flow. If so, we'll need to skip block-end // border and padding. const LogicalSize availableSizeForItems = - ComputeAvailableSizeForItems(aReflowInput, borderPadding); + ComputeAvailableSizeForItems(aReflowInput, borderPadding); mayNeedNextInFlow = effectiveContentBSize > availableSizeForItems.BSize(wm); - if (mayNeedNextInFlow && - aReflowInput.mStyleBorder->mBoxDecorationBreak == - StyleBoxDecorationBreak::Slice) { + if (mayNeedNextInFlow && aReflowInput.mStyleBorder->mBoxDecorationBreak == + StyleBoxDecorationBreak::Slice) { borderPadding.BEnd(wm) = 0; } } diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index a195ebf79905..a9b2b9290a00 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -1655,8 +1655,7 @@ void GfxInfoBase::DescribeFeatures(JSContext* aCx, JS::Handle aObj) { gfxConfig::GetFeature(gfx::Feature::OPENGL_COMPOSITING); InitFeatureObject(aCx, aObj, "openglCompositing", openglCompositing, &obj); - gfx::FeatureState& omtp = - gfxConfig::GetFeature(gfx::Feature::OMTP); + gfx::FeatureState& omtp = gfxConfig::GetFeature(gfx::Feature::OMTP); InitFeatureObject(aCx, aObj, "omtp", omtp, &obj); // Only include AL if the platform attempted to use it.