Avoid non-const sizes in VLAs. (flutter/engine#48693)

I was shocked this was even legal earlier. But a new Clang roll makes this an a warning which gets converted into an error.

I attempted to roll to the Clang roll the roller did and fixed the issues I found. Hopefully, the next roll is unblocked.

Original failure: https://github.com/flutter/engine/pull/48563
This commit is contained in:
Chinmay Garde
2023-12-05 13:11:23 -08:00
committed by GitHub
parent 8aeac570ad
commit 4a1f8fa2f3
2 changed files with 3 additions and 3 deletions

View File

@@ -8,8 +8,8 @@
#include "flutter/fml/platform/darwin/cf_utils.h"
#import "flutter/shell/platform/darwin/ios/ios_surface.h"
static int kMaxPointsInVerb = 4;
static const NSUInteger kFlutterClippingMaskViewPoolCapacity = 5;
static constexpr int kMaxPointsInVerb = 4;
static constexpr NSUInteger kFlutterClippingMaskViewPoolCapacity = 5;
namespace flutter {

View File

@@ -54,7 +54,7 @@ TEST(AXPlatformUniqueIdTest, UnassignedIdsAreReused) {
}
TEST(AXPlatformUniqueIdTest, DoesCreateCorrectId) {
int kLargerThanMaxId = kMaxId * 2;
constexpr int kLargerThanMaxId = kMaxId * 2;
std::unique_ptr<AXUniqueId> ids[kLargerThanMaxId];
// Creates and releases to fill up the internal static counter.
for (int i = 0; i < kLargerThanMaxId; i++) {