Skip to content

Commit 191ccbe

Browse files
committed
Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351
1 parent 2465b1e commit 191ccbe

File tree

370 files changed

+1277
-1115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+1277
-1115
lines changed

accessible/atk/AccessibleWrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static GType GetMaiAtkType(uint16_t interfacesBits) {
391391
type = g_type_register_static(MAI_TYPE_ATK_OBJECT, atkTypeName, &tinfo,
392392
GTypeFlags(0));
393393

394-
for (uint32_t index = 0; index < std::size(atk_if_infos); index++) {
394+
for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
395395
if (interfacesBits & (1 << index)) {
396396
g_type_add_interface_static(type,
397397
GetAtkTypeForMai((MaiInterfaceType)index),

accessible/atk/nsMaiInterfaceText.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void textInterfaceInitCB(AtkTextIface* aIface) {
550550
}
551551

552552
// Cache the string values of the atk text attribute names.
553-
for (uint32_t i = 0; i < std::size(sAtkTextAttrNames); i++) {
553+
for (uint32_t i = 0; i < ArrayLength(sAtkTextAttrNames); i++) {
554554
sAtkTextAttrNames[i] =
555555
atk_text_attribute_get_name(static_cast<AtkTextAttribute>(i));
556556
}

accessible/base/ARIAMap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ uint8_t aria::GetFirstValidRoleMapIndexExcluding(
15311531
return Compare(role, aEntry.ARIARoleString(),
15321532
nsCaseInsensitiveStringComparator);
15331533
};
1534-
if (BinarySearchIf(sWAIRoleMaps, 0, std::size(sWAIRoleMaps), comparator,
1534+
if (BinarySearchIf(sWAIRoleMaps, 0, ArrayLength(sWAIRoleMaps), comparator,
15351535
&idx)) {
15361536
return idx;
15371537
}
@@ -1581,7 +1581,7 @@ bool aria::IsRoleMapIndexValid(uint8_t aRoleMapIndex) {
15811581
case LANDMARK_ROLE_MAP_ENTRY_INDEX:
15821582
return true;
15831583
}
1584-
return aRoleMapIndex < std::size(sWAIRoleMaps);
1584+
return aRoleMapIndex < ArrayLength(sWAIRoleMaps);
15851585
}
15861586

15871587
uint64_t aria::UniversalStatesFor(mozilla::dom::Element* aElement) {
@@ -1593,7 +1593,7 @@ uint64_t aria::UniversalStatesFor(mozilla::dom::Element* aElement) {
15931593
}
15941594

15951595
uint8_t aria::AttrCharacteristicsFor(nsAtom* aAtom) {
1596-
for (uint32_t i = 0; i < std::size(gWAIUnivAttrMap); i++) {
1596+
for (uint32_t i = 0; i < ArrayLength(gWAIUnivAttrMap); i++) {
15971597
if (gWAIUnivAttrMap[i].attributeName == aAtom) {
15981598
return gWAIUnivAttrMap[i].characteristics;
15991599
}
@@ -1615,7 +1615,7 @@ const nsRoleMapEntry* aria::GetRoleMap(const nsStaticAtom* aAriaRole) {
16151615
return Compare(role, aEntry.ARIARoleString());
16161616
};
16171617
size_t idx;
1618-
if (BinarySearchIf(sWAIRoleMaps, 0, std::size(sWAIRoleMaps), comparator,
1618+
if (BinarySearchIf(sWAIRoleMaps, 0, ArrayLength(sWAIRoleMaps), comparator,
16191619
&idx)) {
16201620
return GetRoleMapFromIndex(idx);
16211621
}

accessible/base/Logging.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void EnableLogging(const char* aModulesStr) {
7474
const char* token = aModulesStr;
7575
while (*token != '\0') {
7676
size_t tokenLen = strcspn(token, ",");
77-
for (unsigned int idx = 0; idx < std::size(sModuleMap); idx++) {
77+
for (unsigned int idx = 0; idx < ArrayLength(sModuleMap); idx++) {
7878
if (strncmp(token, sModuleMap[idx].mStr, tokenLen) == 0) {
7979
#if !defined(MOZ_PROFILING) && (!defined(DEBUG) || defined(MOZ_OPTIMIZE))
8080
// Stack tracing on profiling enabled or debug not optimized builds.
@@ -977,7 +977,7 @@ bool logging::IsEnabledAll(uint32_t aModules) {
977977
}
978978

979979
bool logging::IsEnabled(const nsAString& aModuleStr) {
980-
for (unsigned int idx = 0; idx < std::size(sModuleMap); idx++) {
980+
for (unsigned int idx = 0; idx < ArrayLength(sModuleMap); idx++) {
981981
if (aModuleStr.EqualsASCII(sModuleMap[idx].mStr)) {
982982
return sModules & sModuleMap[idx].mModule;
983983
}

accessible/base/TextAttrs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ void TextAttrsMgr::GetAttributes(AccAttributes* aAttributes,
127127

128128
// Expose text attributes if applicable.
129129
if (aAttributes) {
130-
for (uint32_t idx = 0; idx < std::size(attrArray); idx++) {
130+
for (uint32_t idx = 0; idx < ArrayLength(attrArray); idx++) {
131131
attrArray[idx]->Expose(aAttributes, mIncludeDefAttrs);
132132
}
133133
}
134134

135135
// Expose text attributes range where they are applied if applicable.
136136
if (aStartOffset) {
137-
GetRange(attrArray, std::size(attrArray), aStartOffset, aEndOffset);
137+
GetRange(attrArray, ArrayLength(attrArray), aStartOffset, aEndOffset);
138138
}
139139
}
140140

accessible/base/TextLeafRange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ FindDOMTextOffsetAttributes(LocalAccessible* aAcc, int32_t aRenderedStart,
470470
{SelectionType::eSpellCheck, nsGkAtoms::spelling},
471471
{SelectionType::eTargetText, nsGkAtoms::mark},
472472
};
473-
result.SetCapacity(std::size(kSelectionTypesToAttributes));
473+
result.SetCapacity(ArrayLength(kSelectionTypesToAttributes));
474474
for (auto [selType, attr] : kSelectionTypesToAttributes) {
475475
dom::Selection* domSel = frameSel->GetSelection(selType);
476476
if (!domSel) {

accessible/base/nsAccessibilityService.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,9 @@ uint64_t nsAccessibilityService::gCacheDomains =
453453
nsAccessibilityService::kDefaultCacheDomains;
454454

455455
nsAccessibilityService::nsAccessibilityService()
456-
: mHTMLMarkupMap(std::size(sHTMLMarkupMapList)),
457-
mMathMLMarkupMap(std::size(sMathMLMarkupMapList)),
458-
mXULMarkupMap(std::size(sXULMarkupMapList)) {}
456+
: mHTMLMarkupMap(ArrayLength(sHTMLMarkupMapList)),
457+
mMathMLMarkupMap(ArrayLength(sMathMLMarkupMapList)),
458+
mXULMarkupMap(ArrayLength(sXULMarkupMapList)) {}
459459

460460
nsAccessibilityService::~nsAccessibilityService() {
461461
NS_ASSERTION(IsShutdown(), "Accessibility wasn't shutdown!");
@@ -1082,10 +1082,10 @@ already_AddRefed<DOMStringList> nsAccessibilityService::GetStringStates(
10821082
void nsAccessibilityService::GetStringEventType(uint32_t aEventType,
10831083
nsAString& aString) {
10841084
static_assert(
1085-
nsIAccessibleEvent::EVENT_LAST_ENTRY == std::size(kEventTypeNames),
1085+
nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
10861086
"nsIAccessibleEvent constants are out of sync to kEventTypeNames");
10871087

1088-
if (aEventType >= std::size(kEventTypeNames)) {
1088+
if (aEventType >= ArrayLength(kEventTypeNames)) {
10891089
aString.AssignLiteral("unknown");
10901090
return;
10911091
}
@@ -1095,10 +1095,11 @@ void nsAccessibilityService::GetStringEventType(uint32_t aEventType,
10951095

10961096
void nsAccessibilityService::GetStringEventType(uint32_t aEventType,
10971097
nsACString& aString) {
1098-
MOZ_ASSERT(nsIAccessibleEvent::EVENT_LAST_ENTRY == std::size(kEventTypeNames),
1099-
"nsIAccessibleEvent constants are out of sync to kEventTypeNames");
1098+
MOZ_ASSERT(
1099+
nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
1100+
"nsIAccessibleEvent constants are out of sync to kEventTypeNames");
11001101

1101-
if (aEventType >= std::size(kEventTypeNames)) {
1102+
if (aEventType >= ArrayLength(kEventTypeNames)) {
11021103
aString.AssignLiteral("unknown");
11031104
return;
11041105
}
@@ -1536,15 +1537,15 @@ bool nsAccessibilityService::Init(uint64_t aCacheDomains) {
15361537

15371538
eventListenerService->AddListenerChangeListener(this);
15381539

1539-
for (uint32_t i = 0; i < std::size(sHTMLMarkupMapList); i++) {
1540+
for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++) {
15401541
mHTMLMarkupMap.InsertOrUpdate(sHTMLMarkupMapList[i].tag,
15411542
&sHTMLMarkupMapList[i]);
15421543
}
15431544
for (const auto& info : sMathMLMarkupMapList) {
15441545
mMathMLMarkupMap.InsertOrUpdate(info.tag, &info);
15451546
}
15461547

1547-
for (uint32_t i = 0; i < std::size(sXULMarkupMapList); i++) {
1548+
for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++) {
15481549
mXULMarkupMap.InsertOrUpdate(sXULMarkupMapList[i].tag,
15491550
&sXULMarkupMapList[i]);
15501551
}
@@ -1755,7 +1756,7 @@ void nsAccessibilityService::MarkupAttributes(
17551756
if (!markupMap) return;
17561757

17571758
dom::Element* el = aAcc->IsLocal() ? aAcc->AsLocal()->Elm() : nullptr;
1758-
for (uint32_t i = 0; i < std::size(markupMap->attrs); i++) {
1759+
for (uint32_t i = 0; i < ArrayLength(markupMap->attrs); i++) {
17591760
const MarkupAttrInfo* info = markupMap->attrs + i;
17601761
if (!info->name) break;
17611762

accessible/base/nsAccessibilityService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class nsAccessibilityService final : public mozilla::a11y::DocManager,
311311
const mozilla::a11y::MarkupMapInfo* markupMap =
312312
GetMarkupMapInfoFor(aSource);
313313
if (markupMap) {
314-
for (size_t i = 0; i < std::size(markupMap->attrs); i++) {
314+
for (size_t i = 0; i < mozilla::ArrayLength(markupMap->attrs); i++) {
315315
const mozilla::a11y::MarkupAttrInfo* info = markupMap->attrs + i;
316316
if (info->name == aAtom) {
317317
return info->value;

accessible/generic/DocAccessible.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static nsStaticAtom* const kRelationAttrs[] = {
6565
nsGkAtoms::aria_errormessage, nsGkAtoms::_for,
6666
nsGkAtoms::control, nsGkAtoms::popovertarget};
6767

68-
static const uint32_t kRelationAttrsLen = std::size(kRelationAttrs);
68+
static const uint32_t kRelationAttrsLen = ArrayLength(kRelationAttrs);
6969

7070
static nsStaticAtom* const kSingleElementRelationIdlAttrs[] = {
7171
nsGkAtoms::popovertarget};

accessible/generic/RootAccessible.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ nsresult RootAccessible::AddEventListeners() {
153153

154154
if (nstarget) {
155155
for (const char *const *e = kEventTypes, *const *e_end =
156-
std::end(kEventTypes);
156+
ArrayEnd(kEventTypes);
157157
e < e_end; ++e) {
158158
nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e), this,
159159
true, true);
@@ -169,7 +169,7 @@ nsresult RootAccessible::RemoveEventListeners() {
169169
nsCOMPtr<EventTarget> target = window ? window->GetParentTarget() : nullptr;
170170
if (target) {
171171
for (const char *const *e = kEventTypes, *const *e_end =
172-
std::end(kEventTypes);
172+
ArrayEnd(kEventTypes);
173173
e < e_end; ++e) {
174174
target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, true);
175175
}

accessible/ipc/RemoteAccessible.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ nsTArray<bool> RemoteAccessible::PreProcessRelations(AccAttributes* aFields) {
12341234
if (!DomainsAreActive(CacheDomain::Relations)) {
12351235
return {};
12361236
}
1237-
nsTArray<bool> updateTracker(std::size(kRelationTypeAtoms));
1237+
nsTArray<bool> updateTracker(ArrayLength(kRelationTypeAtoms));
12381238
for (auto const& data : kRelationTypeAtoms) {
12391239
if (data.mValidTag) {
12401240
// The relation we're currently processing only applies to particular
@@ -1310,7 +1310,7 @@ void RemoteAccessible::PostProcessRelations(const nsTArray<bool>& aToUpdate) {
13101310
return;
13111311
}
13121312
size_t updateCount = aToUpdate.Length();
1313-
MOZ_ASSERT(updateCount == std::size(kRelationTypeAtoms),
1313+
MOZ_ASSERT(updateCount == ArrayLength(kRelationTypeAtoms),
13141314
"Did not note update status for every relation type!");
13151315
for (size_t i = 0; i < updateCount; i++) {
13161316
if (aToUpdate.ElementAt(i)) {

accessible/mac/mozAccessible.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ - (NSString*)moxRoleDescription {
468468

469469
if (subrole) {
470470
size_t idx = 0;
471-
if (BinarySearchIf(sRoleDescrMap, 0, std::size(sRoleDescrMap),
471+
if (BinarySearchIf(sRoleDescrMap, 0, ArrayLength(sRoleDescrMap),
472472
RoleDescrComparator(subrole), &idx)) {
473473
return utils::LocalizedString(sRoleDescrMap[idx].description);
474474
}

accessible/windows/ia2/ia2Accessible.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ia2Accessible::get_nRelations(long* aNRelations) {
7777
return CO_E_OBJNOTCONNECTED;
7878
}
7979

80-
for (uint32_t idx = 0; idx < std::size(sRelationTypePairs); idx++) {
80+
for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
8181
if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) continue;
8282

8383
Relation rel = acc->RelationByType(sRelationTypePairs[idx].first);
@@ -98,7 +98,7 @@ ia2Accessible::get_relation(long aRelationIndex,
9898
}
9999

100100
long relIdx = 0;
101-
for (uint32_t idx = 0; idx < std::size(sRelationTypePairs); idx++) {
101+
for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
102102
if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) continue;
103103

104104
RelationType relationType = sRelationTypePairs[idx].first;
@@ -131,7 +131,7 @@ ia2Accessible::get_relations(long aMaxRelations,
131131
}
132132

133133
for (uint32_t idx = 0;
134-
idx < std::size(sRelationTypePairs) && *aNRelations < aMaxRelations;
134+
idx < ArrayLength(sRelationTypePairs) && *aNRelations < aMaxRelations;
135135
idx++) {
136136
if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) continue;
137137

@@ -484,7 +484,7 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, long aMaxTargets,
484484
*aNTargets = 0;
485485

486486
Maybe<RelationType> relationType;
487-
for (uint32_t idx = 0; idx < std::size(sRelationTypePairs); idx++) {
487+
for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
488488
if (wcscmp(aType, sRelationTypePairs[idx].second) == 0) {
489489
relationType.emplace(sRelationTypePairs[idx].first);
490490
break;

accessible/windows/msaa/LazyInstantiator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ bool LazyInstantiator::IsBlockedInjection() {
210210
return false;
211211
}
212212

213-
for (size_t index = 0, len = std::size(gBlockedInprocDlls); index < len;
213+
for (size_t index = 0, len = ArrayLength(gBlockedInprocDlls); index < len;
214214
++index) {
215215
const DllBlockInfo& blockedDll = gBlockedInprocDlls[index];
216216
HMODULE module = ::GetModuleHandleW(blockedDll.mName);
@@ -247,7 +247,8 @@ bool LazyInstantiator::ShouldInstantiate(const DWORD aClientPid) {
247247
nsAutoString leafName;
248248
rv = clientExe->GetLeafName(leafName);
249249
if (NS_SUCCEEDED(rv)) {
250-
for (size_t i = 0, len = std::size(gBlockedRemoteClients); i < len; ++i) {
250+
for (size_t i = 0, len = ArrayLength(gBlockedRemoteClients); i < len;
251+
++i) {
251252
if (leafName.EqualsIgnoreCase(gBlockedRemoteClients[i])) {
252253
// If client exe is in our blocklist, do not instantiate.
253254
return false;

accessible/windows/msaa/MsaaAccessible.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ void MsaaAccessible::FireWinEvent(Accessible* aTarget, uint32_t aEventType) {
216216
nsIAccessibleEvent::EVENT_LAST_ENTRY,
217217
"MSAA event map skewed");
218218

219-
if (aEventType == 0 || aEventType >= std::size(gWinEventMap)) {
219+
if (aEventType == 0 || aEventType >= ArrayLength(gWinEventMap)) {
220220
MOZ_ASSERT_UNREACHABLE("invalid event type");
221221
return;
222222
}

accessible/windows/uia/uiaRawElmProvider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds) {
318318
*aRuntimeIds = SafeArrayCreateVector(VT_I4, 0, 2);
319319
if (!*aRuntimeIds) return E_OUTOFMEMORY;
320320

321-
for (LONG i = 0; i < (LONG)std::size(ids); i++)
321+
for (LONG i = 0; i < (LONG)ArrayLength(ids); i++)
322322
SafeArrayPutElement(*aRuntimeIds, &i, (void*)&(ids[i]));
323323

324324
return S_OK;

browser/app/nsBrowserApp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ __attribute__((constructor)) static void SSE2Check() {
9292
// Using write() in order to avoid jemalloc-based buffering. Ignoring return
9393
// values, since there isn't much we could do on failure and there is no
9494
// point in trying to recover from errors.
95-
MOZ_UNUSED(write(STDERR_FILENO, sSSE2Message, std::size(sSSE2Message) - 1));
95+
MOZ_UNUSED(
96+
write(STDERR_FILENO, sSSE2Message, MOZ_ARRAY_LENGTH(sSSE2Message) - 1));
9697
// _exit() instead of exit() to avoid running the usual "at exit" code.
9798
_exit(255);
9899
}

browser/app/winlauncher/ErrorHandler.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static bool AddWscInfo(mozilla::JSONWriter& aJson) {
305305
const CLSID clsid = __uuidof(WSCProductList);
306306
const IID iid = __uuidof(IWSCProductList);
307307

308-
for (uint32_t index = 0; index < std::size(gProvKeys); ++index) {
308+
for (uint32_t index = 0; index < mozilla::ArrayLength(gProvKeys); ++index) {
309309
// NB: A separate instance of IWSCProductList is needed for each distinct
310310
// security provider type; MSDN says that we cannot reuse the same object
311311
// and call Initialize() to pave over the previous data.
@@ -368,11 +368,11 @@ static bool AddModuleInfo(const nsAutoHandle& aSnapshot,
368368

369369
wchar_t leaf[_MAX_FNAME] = {};
370370
if (::_wsplitpath_s(module.szExePath, nullptr, 0, nullptr, 0, leaf,
371-
std::size(leaf), nullptr, 0)) {
371+
mozilla::ArrayLength(leaf), nullptr, 0)) {
372372
return false;
373373
}
374374

375-
if (_wcslwr_s(leaf, std::size(leaf))) {
375+
if (_wcslwr_s(leaf, mozilla::ArrayLength(leaf))) {
376376
return false;
377377
}
378378

@@ -487,7 +487,8 @@ static bool PrepPing(const PingThreadContext& aContext, const std::wstring& aId,
487487
tm gmTm;
488488
if (!gmtime_s(&gmTm, &now)) {
489489
char isoTimeBuf[32] = {};
490-
if (strftime(isoTimeBuf, std::size(isoTimeBuf), "%FT%T.000Z", &gmTm)) {
490+
if (strftime(isoTimeBuf, mozilla::ArrayLength(isoTimeBuf), "%FT%T.000Z",
491+
&gmTm)) {
491492
aJson.StringProperty("creationDate", isoTimeBuf);
492493
}
493494
}
@@ -532,7 +533,7 @@ static bool PrepPing(const PingThreadContext& aContext, const std::wstring& aId,
532533

533534
WCHAR localeName[LOCALE_NAME_MAX_LENGTH] = {};
534535
int localeNameLen =
535-
::GetUserDefaultLocaleName(localeName, std::size(localeName));
536+
::GetUserDefaultLocaleName(localeName, mozilla::ArrayLength(localeName));
536537
if (localeNameLen) {
537538
auto localeNameUtf8 = WideToUTF8(localeName, localeNameLen - 1);
538539
if (localeNameUtf8) {
@@ -646,19 +647,19 @@ static bool DoSendPing(const PingThreadContext& aContext) {
646647

647648
wchar_t drive[_MAX_DRIVE] = {};
648649
wchar_t dir[_MAX_DIR] = {};
649-
if (_wsplitpath_s(exePath.get(), drive, std::size(drive), dir, std::size(dir),
650-
nullptr, 0, nullptr, 0)) {
650+
if (_wsplitpath_s(exePath.get(), drive, mozilla::ArrayLength(drive), dir,
651+
mozilla::ArrayLength(dir), nullptr, 0, nullptr, 0)) {
651652
return false;
652653
}
653654

654655
wchar_t pingSenderPath[MAX_PATH + 1] = {};
655-
if (_wmakepath_s(pingSenderPath, std::size(pingSenderPath), drive, dir,
656-
L"pingsender", L"exe")) {
656+
if (_wmakepath_s(pingSenderPath, mozilla::ArrayLength(pingSenderPath), drive,
657+
dir, L"pingsender", L"exe")) {
657658
return false;
658659
}
659660

660661
// Construct the telemetry URL
661-
wchar_t urlBuf[std::size(kUrl) + kGuidCharLenNoBracesNoNul] = {};
662+
wchar_t urlBuf[mozilla::ArrayLength(kUrl) + kGuidCharLenNoBracesNoNul] = {};
662663
if (wcscpy_s(urlBuf, kUrl)) {
663664
return false;
664665
}
@@ -671,8 +672,8 @@ static bool DoSendPing(const PingThreadContext& aContext) {
671672
wchar_t* pingSenderArgv[] = {pingSenderPath, urlBuf,
672673
const_cast<wchar_t*>(fileName.c_str())};
673674

674-
mozilla::UniquePtr<wchar_t[]> pingSenderCmdLine(
675-
mozilla::MakeCommandLine(std::size(pingSenderArgv), pingSenderArgv));
675+
mozilla::UniquePtr<wchar_t[]> pingSenderCmdLine(mozilla::MakeCommandLine(
676+
mozilla::ArrayLength(pingSenderArgv), pingSenderArgv));
676677

677678
// Now start pingsender to handle the rest
678679
PROCESS_INFORMATION pi;

browser/app/winlauncher/LaunchUnelevated.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static mozilla::LauncherResult<bool> IsAdminByAppCompat(
109109
wchar_t* tokenContext = nullptr;
110110
const wchar_t* token = wcstok_s(valueData.get(), kDelimiters, &tokenContext);
111111
while (token) {
112-
if (!_wcsnicmp(token, kRunAsAdmin, std::size(kRunAsAdmin))) {
112+
if (!_wcsnicmp(token, kRunAsAdmin, mozilla::ArrayLength(kRunAsAdmin))) {
113113
return true;
114114
}
115115
token = wcstok_s(nullptr, kDelimiters, &tokenContext);

0 commit comments

Comments
 (0)