0
Files
src/ppapi
Arthur Sonzogni fe7eb63751 Style: Fix array initializations with size mismatches [8/8] #cleanup
Split 8/8 from:
https://chromium-review.googlesource.com/c/chromium/src/+/6055399

This patch addresses inconsistencies in array initialization where the
declared array size does not match the number of elements provided in
the initializer list. This can lead to confusion and potential errors,
as the remaining elements are implicitly initialized to zero. For
example, initializing with = {2} might mislead developers into thinking
the entire array is filled with 2s, when in fact only the first element
is assigned that value.
https://godbolt.org/z/4sbd9nreT

The changes ensure that:
- Array sizes accurately reflect the number of elements being explicitly
  initialized.
- Zero-initialization is explicitly expressed using {} when intended.

This improves code clarity and maintainability by making the
initialization intent clear and consistent.

This change also aims to allow the std::array rewriter to "crash" when
encountering a mismatching size where it would be difficult to rewrite.
Not having any occurrences of this pattern in the codebase will avoid the issue.

Bug: 356643982
Change-Id: Ie2df5a02a5a2e96a117b5ae4bc86df2b031da972
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6063246
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391754}
2024-12-04 18:03:47 +00:00
..