From 6d71aee7800f857852d7cb393b13a6b14de6dad7 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 31 Jul 2017 16:22:15 -0700 Subject: [PATCH] Update buildroot to account for stricter warning flags. (flutter/engine#3939) --- DEPS | 2 +- .../src/flutter/fml/message_loop_unittests.cc | 2 +- .../flutter/fml/platform/android/jni_util.cc | 2 +- .../src/flutter/shell/gpu/gpu_surface_gl.cc | 2 +- .../platform/android/android_surface_gl.h | 2 +- .../Source/flutter_standard_codec_unittest.mm | 43 ++++++++++--------- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/DEPS b/DEPS index 581d2f6c6b..fef53d42be 100644 --- a/DEPS +++ b/DEPS @@ -75,7 +75,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'b0b836db790abff26695a944224a4934480f2f48', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'abb5036600abb462690f9f0091ec73b2d65fc337', # Fuchsia compatibility # diff --git a/engine/src/flutter/fml/message_loop_unittests.cc b/engine/src/flutter/fml/message_loop_unittests.cc index 14d9ec179e..3277c76f70 100644 --- a/engine/src/flutter/fml/message_loop_unittests.cc +++ b/engine/src/flutter/fml/message_loop_unittests.cc @@ -244,7 +244,7 @@ class CustomTaskObserver : public fml::TaskObserver { ~CustomTaskObserver() override = default; - void DidProcessTask() { + void DidProcessTask() override { if (lambda_) { lambda_(); } diff --git a/engine/src/flutter/fml/platform/android/jni_util.cc b/engine/src/flutter/fml/platform/android/jni_util.cc index 7febfc06f9..a1dd2d3a29 100644 --- a/engine/src/flutter/fml/platform/android/jni_util.cc +++ b/engine/src/flutter/fml/platform/android/jni_util.cc @@ -85,7 +85,7 @@ std::vector StringArrayToVector(JNIEnv* env, jobjectArray array) { } out.resize(length); - for (size_t i = 0; i < length; ++i) { + for (jsize i = 0; i < length; ++i) { ScopedJavaLocalRef java_string( env, static_cast(env->GetObjectArrayElement(array, i))); out[i] = JavaStringToString(env, java_string.obj()); diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc index 0ae3248d56..35d40b3a88 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc @@ -83,7 +83,7 @@ static sk_sp WrapOnscreenSurface(GrContext* context, intptr_t fbo, bool supports_srgb) { const GrGLFramebufferInfo framebuffer_info = { - .fFBOID = fbo, + .fFBOID = static_cast(fbo), }; const GrPixelConfig pixel_config = diff --git a/engine/src/flutter/shell/platform/android/android_surface_gl.h b/engine/src/flutter/shell/platform/android/android_surface_gl.h index 332ec23c20..26c57b006e 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl.h +++ b/engine/src/flutter/shell/platform/android/android_surface_gl.h @@ -22,7 +22,7 @@ class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { ~AndroidSurfaceGL() override; - bool IsValid() const; + bool IsValid() const override; bool IsOffscreenContextValid() const; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm index 321bb1745d..9070ceb0a4 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm @@ -34,34 +34,34 @@ TEST(FlutterStandardCodec, CanEncodeAndDecodeNil) { } TEST(FlutterStandardCodec, CanEncodeAndDecodeNSNull) { - char bytes[1] = {0x00}; + uint8_t bytes[1] = {0x00}; checkEncodeDecode([NSNull null], [NSData dataWithBytes:bytes length:1]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeYes) { - char bytes[1] = {0x01}; + uint8_t bytes[1] = {0x01}; checkEncodeDecode(@YES, [NSData dataWithBytes:bytes length:1]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeNo) { - char bytes[1] = {0x02}; + uint8_t bytes[1] = {0x02}; checkEncodeDecode(@NO, [NSData dataWithBytes:bytes length:1]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeUInt8) { - char bytes[5] = {0x03, 0xfe, 0x00, 0x00, 0x00}; + uint8_t bytes[5] = {0x03, 0xfe, 0x00, 0x00, 0x00}; UInt8 value = 0xfe; checkEncodeDecode(@(value), [NSData dataWithBytes:bytes length:5]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeUInt16) { - char bytes[5] = {0x03, 0xdc, 0xfe, 0x00, 0x00}; + uint8_t bytes[5] = {0x03, 0xdc, 0xfe, 0x00, 0x00}; UInt16 value = 0xfedc; checkEncodeDecode(@(value), [NSData dataWithBytes:bytes length:5]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeUInt32) { - char bytes[9] = {0x04, 0x09, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00}; + uint8_t bytes[9] = {0x04, 0x09, 0xba, 0xdc, 0xfe, 0x00, 0x00, 0x00, 0x00}; UInt32 value = 0xfedcba09; checkEncodeDecode(@(value), [NSData dataWithBytes:bytes length:9]); } @@ -75,24 +75,24 @@ TEST(FlutterStandardCodec, CanEncodeAndDecodeUInt64AsHexString) { } TEST(FlutterStandardCodec, CanEncodeAndDecodeSInt8) { - char bytes[5] = {0x03, 0xfe, 0xff, 0xff, 0xff}; + uint8_t bytes[5] = {0x03, 0xfe, 0xff, 0xff, 0xff}; SInt8 value = 0xfe; checkEncodeDecode(@(value), [NSData dataWithBytes:bytes length:5]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeSInt16) { - char bytes[5] = {0x03, 0xdc, 0xfe, 0xff, 0xff}; + uint8_t bytes[5] = {0x03, 0xdc, 0xfe, 0xff, 0xff}; SInt16 value = 0xfedc; checkEncodeDecode(@(value), [NSData dataWithBytes:bytes length:5]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeSInt32) { - char bytes[5] = {0x03, 0x78, 0x56, 0x34, 0x12}; + uint8_t bytes[5] = {0x03, 0x78, 0x56, 0x34, 0x12}; checkEncodeDecode(@(0x12345678), [NSData dataWithBytes:bytes length:5]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeSInt64) { - char bytes[9] = {0x04, 0xef, 0xcd, 0xab, 0x90, 0x78, 0x56, 0x34, 0x12}; + uint8_t bytes[9] = {0x04, 0xef, 0xcd, 0xab, 0x90, 0x78, 0x56, 0x34, 0x12}; checkEncodeDecode(@(0x1234567890abcdef), [NSData dataWithBytes:bytes length:9]); } @@ -103,27 +103,30 @@ TEST(FlutterStandardCodec, CanEncodeAndDecodeBigInteger) { } TEST(FlutterStandardCodec, CanEncodeAndDecodeFloat32) { - char bytes[16] = {0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xfb, 0x21, 0x09, 0x40}; + uint8_t bytes[16] = {0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x60, 0xfb, 0x21, 0x09, 0x40}; checkEncodeDecode(@3.1415927f, [NSData dataWithBytes:bytes length:16]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeFloat64) { - char bytes[16] = {0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40}; + uint8_t bytes[16] = {0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40}; checkEncodeDecode(@3.14159265358979311599796346854, [NSData dataWithBytes:bytes length:16]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeString) { - char bytes[13] = {0x07, 0x0b, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64}; + uint8_t bytes[13] = {0x07, 0x0b, 0x68, 0x65, 0x6c, 0x6c, 0x6f, + 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64}; checkEncodeDecode(@"hello world", [NSData dataWithBytes:bytes length:13]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeStringWithNonAsciiCodePoint) { - char bytes[7] = {0x07, 0x05, 0x68, 0xe2, 0x98, 0xba, 0x77}; + uint8_t bytes[7] = {0x07, 0x05, 0x68, 0xe2, 0x98, 0xba, 0x77}; checkEncodeDecode(@"h\u263Aw", [NSData dataWithBytes:bytes length:7]); } TEST(FlutterStandardCodec, CanEncodeAndDecodeStringWithNonBMPCodePoint) { - char bytes[8] = {0x07, 0x06, 0x68, 0xf0, 0x9f, 0x98, 0x82, 0x77}; + uint8_t bytes[8] = {0x07, 0x06, 0x68, 0xf0, 0x9f, 0x98, 0x82, 0x77}; checkEncodeDecode(@"h\U0001F602w", [NSData dataWithBytes:bytes length:8]); } @@ -142,29 +145,29 @@ TEST(FlutterStandardCodec, CanEncodeAndDecodeDictionary) { } TEST(FlutterStandardCodec, CanEncodeAndDecodeByteArray) { - char bytes[4] = {0xBA, 0x5E, 0xBA, 0x11}; + uint8_t bytes[4] = {0xBA, 0x5E, 0xBA, 0x11}; NSData* data = [NSData dataWithBytes:bytes length:4]; FlutterStandardTypedData* value = [FlutterStandardTypedData typedDataWithBytes:data]; checkEncodeDecode(value); } TEST(FlutterStandardCodec, CanEncodeAndDecodeInt32Array) { - char bytes[8] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; + uint8_t bytes[8] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; NSData* data = [NSData dataWithBytes:bytes length:8]; FlutterStandardTypedData* value = [FlutterStandardTypedData typedDataWithInt32:data]; checkEncodeDecode(value); } TEST(FlutterStandardCodec, CanEncodeAndDecodeInt64Array) { - char bytes[8] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; + uint8_t bytes[8] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; NSData* data = [NSData dataWithBytes:bytes length:8]; FlutterStandardTypedData* value = [FlutterStandardTypedData typedDataWithInt64:data]; checkEncodeDecode(value); } TEST(FlutterStandardCodec, CanEncodeAndDecodeFloat64Array) { - char bytes[16] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff, - 0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; + uint8_t bytes[16] = {0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff, + 0xBA, 0x5E, 0xBA, 0x11, 0xff, 0xff, 0xff, 0xff}; NSData* data = [NSData dataWithBytes:bytes length:16]; FlutterStandardTypedData* value = [FlutterStandardTypedData typedDataWithFloat64:data]; checkEncodeDecode(value);