Bug 1519636 - Reformat recent changes to the Google coding style. r=firefox-build-system-reviewers,mhentges,sylvestre

Reformat with clang-format version 12.0.1 (taskcluster-FYV2l5wGTseBAhiqf8cxfQ)

Differential Revision: https://phabricator.services.mozilla.com/D131114
This commit is contained in:
Andi-Bogdan Postelnicu 2021-11-16 08:07:29 +00:00
parent 551a6b105b
commit 1faa3d40cf
19 changed files with 58 additions and 78 deletions

View file

@ -199,13 +199,15 @@ TEST(IntlString, ComposePairNFC)
ASSERT_EQ(String::ComposePairNFC(U'a', U'\u0308'), U'ä');
// Accented letter + a further accent
ASSERT_EQ(String::ComposePairNFC(U'ä', U'\u0304'), U'ǟ');
// Accented letter + a further accent, but doubly-accented form is not available
// Accented letter + a further accent, but doubly-accented form is not
// available
ASSERT_EQ(String::ComposePairNFC(U'ä', U'\u0301'), U'\0');
// These do not compose because although U+0344 has the decomposition <0308, 0301>
// (see below), it also has the Full_Composition_Exclusion property.
// These do not compose because although U+0344 has the decomposition <0308,
// 0301> (see below), it also has the Full_Composition_Exclusion property.
ASSERT_EQ(String::ComposePairNFC(U'\u0308', U'\u0301'), U'\0');
// Supplementary-plane letter + accent
ASSERT_EQ(String::ComposePairNFC(U'\U00011099', U'\U000110BA'), U'\U0001109A');
ASSERT_EQ(String::ComposePairNFC(U'\U00011099', U'\U000110BA'),
U'\U0001109A');
}
TEST(IntlString, DecomposeRawNFD)

View file

@ -221,10 +221,9 @@ class String final {
const unsigned MAX_DECOMP_LENGTH = 4;
UErrorCode error = U_ZERO_ERROR;
UChar decompUtf16[MAX_DECOMP_LENGTH];
int32_t len = unorm2_getRawDecomposition(normalizer,
static_cast<UChar32>(ab),
decompUtf16, MAX_DECOMP_LENGTH,
&error);
int32_t len =
unorm2_getRawDecomposition(normalizer, static_cast<UChar32>(ab),
decompUtf16, MAX_DECOMP_LENGTH, &error);
if (U_FAILURE(error) || len < 0) {
return 0;
}

View file

@ -20,8 +20,7 @@ void f(int x) {
}
void g(int x) {
if (x % 2)
f(x);
if (x % 2) f(x);
h(x);
}
@ -32,9 +31,7 @@ void h(int x) {
}
}
void leaf() {
asm("");
}
void leaf() { asm(""); }
void nonrecursive_root() {
leaf();
@ -43,8 +40,7 @@ void nonrecursive_root() {
}
void self_recursive(int x) {
if (x)
self_recursive(x - 1);
if (x) self_recursive(x - 1);
}
// Set up the graph
@ -66,44 +62,29 @@ extern void n7(int x);
extern void n8(int x);
extern void n9(int x);
void n1(int x) {
n2(x);
}
void n1(int x) { n2(x); }
void n2(int x) {
if (x)
n1(x - 1);
if (x) n1(x - 1);
n3(x);
}
void n4(int x) {
n5(x);
}
void n4(int x) { n5(x); }
void n5(int x) {
if (x)
n4(x - 1);
if (x) n4(x - 1);
n3(x);
}
void n3(int x) {
n6(x);
}
void n3(int x) { n6(x); }
void n6(int x) {
n7(x);
}
void n6(int x) { n7(x); }
void n7(int x) {
n8(x);
}
void n7(int x) { n8(x); }
void n8(int x) {
if (x)
n7(x - 1);
if (x) n7(x - 1);
n9(x);
}
void n9(int x) {
asm("");
}
void n9(int x) { asm(""); }

View file

@ -18,7 +18,7 @@ void GC() {
// js::RunScript.
namespace js {
void RunScript() { GC(); }
}
} // namespace js
struct Cell {
int f;

View file

@ -26,8 +26,11 @@ static js::gc::CellColor GetColor(const JS::ArrayBufferOrView& view) {
return view.asObjectUnbarriered()->color();
}
static MOZ_MAYBE_UNUSED bool IsInsideNursery(gc::Cell* cell) { return !cell->isTenured(); }
static MOZ_MAYBE_UNUSED bool IsInsideNursery(const JS::ArrayBufferOrView& view) {
static MOZ_MAYBE_UNUSED bool IsInsideNursery(gc::Cell* cell) {
return !cell->isTenured();
}
static MOZ_MAYBE_UNUSED bool IsInsideNursery(
const JS::ArrayBufferOrView& view) {
return IsInsideNursery(view.asObjectUnbarriered());
}

View file

@ -2027,7 +2027,8 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) {
return NS_OK;
}
void nsExternalAppHandler::RecordDownloadTelemetry(nsIChannel* aChannel, const char* aAction) {
void nsExternalAppHandler::RecordDownloadTelemetry(nsIChannel* aChannel,
const char* aAction) {
// Telemetry for helper app dialog
if (XRE_IsContentProcess()) {

View file

@ -273,7 +273,6 @@ class nsExternalAppHandler final : public nsIStreamListener,
void SetShouldCloseWindow() { mShouldCloseWindow = true; }
protected:
// Record telemetry about a download that was attempted.
void RecordDownloadTelemetry(nsIChannel* aChannel, const char* aAction);

View file

@ -219,9 +219,7 @@ static Maybe<nscolor> GetSystemColor(LookAndFeel::ColorID aId) {
class SelectionStyleProvider final {
public:
static SelectionStyleProvider* GetExistingInstance() {
return sInstance;
}
static SelectionStyleProvider* GetExistingInstance() { return sInstance; }
static SelectionStyleProvider* GetInstance() {
if (sHasShutDown) {

View file

@ -77,8 +77,8 @@ enum class CCReason : uint8_t {
// Low memory situation detected.
MEM_PRESSURE,
// IPC message to a content process to trigger a CC. The original reason is not
// tracked.
// IPC message to a content process to trigger a CC. The original reason is
// not tracked.
IPC_MESSAGE,
// Cycle collection on a worker. The triggering reason is not tracked.

View file

@ -59,8 +59,7 @@ TEST(NSURLEscaping, NSURLEscapingTests)
// Pairs of URLs of the form (un-encoded, expected encoded result) to verify.
nsTArray<std::pair<nsCString, nsCString>> pairs{
{
// '#' in ref
{// '#' in ref
"https://chat.mozilla.org/#/room/#macdev:mozilla.org"_ns,
"https://chat.mozilla.org/#/room/%23macdev:mozilla.org"_ns},
{

View file

@ -449,9 +449,7 @@ nsresult nsProcess::RunProcess(bool aBlocking, char** aMyArgv,
// can cause TSAN to complain about thread leaks. We handle this with a TSAN
// suppression, and route thread creation through this helper so that the
// suppression is as narrowly-scoped as possible.
PRThread*
nsProcess::CreateMonitorThread()
{
PRThread* nsProcess::CreateMonitorThread() {
return PR_CreateThread(PR_SYSTEM_THREAD, Monitor, this, PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
}