Fix braces style (flutter/engine#18837)
This commit is contained in:
@@ -189,8 +189,9 @@ G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel(
|
||||
g_hash_table_replace(
|
||||
self->platform_message_handlers, g_strdup(channel),
|
||||
platform_message_handler_new(handler, user_data, destroy_notify));
|
||||
} else
|
||||
} else {
|
||||
g_hash_table_remove(self->platform_message_handlers, channel);
|
||||
}
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT gboolean fl_binary_messenger_send_response(
|
||||
|
||||
@@ -19,9 +19,9 @@ G_DEFINE_TYPE(FlDartProject, fl_dart_project, G_TYPE_OBJECT)
|
||||
static void fl_dart_project_set_path(FlDartProject* self, const gchar* path) {
|
||||
g_free(self->path);
|
||||
|
||||
if (g_path_is_absolute(path))
|
||||
if (g_path_is_absolute(path)) {
|
||||
self->path = g_strdup(path);
|
||||
else {
|
||||
} else {
|
||||
g_autoptr(GError) error = nullptr;
|
||||
g_autofree gchar* exe_path = g_file_read_link("/proc/self/exe", &error);
|
||||
if (exe_path == nullptr) {
|
||||
|
||||
@@ -149,11 +149,11 @@ struct FlValueHandler {
|
||||
bool add(FlValue* value) {
|
||||
g_autoptr(FlValue) owned_value = value;
|
||||
FlValue* head = get_head();
|
||||
if (head == nullptr)
|
||||
if (head == nullptr) {
|
||||
push(owned_value);
|
||||
else if (fl_value_get_type(head) == FL_VALUE_TYPE_LIST)
|
||||
} else if (fl_value_get_type(head) == FL_VALUE_TYPE_LIST) {
|
||||
fl_value_append(head, owned_value);
|
||||
else if (fl_value_get_type(head) == FL_VALUE_TYPE_MAP) {
|
||||
} else if (fl_value_get_type(head) == FL_VALUE_TYPE_MAP) {
|
||||
fl_value_set_take(head, key, fl_value_ref(owned_value));
|
||||
key = nullptr;
|
||||
} else {
|
||||
|
||||
@@ -229,10 +229,11 @@ gboolean fl_method_channel_respond(
|
||||
self->codec, fl_method_error_response_get_code(r),
|
||||
fl_method_error_response_get_message(r),
|
||||
fl_method_error_response_get_details(r), error);
|
||||
} else if (FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE(response))
|
||||
} else if (FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE(response)) {
|
||||
message = nullptr;
|
||||
else
|
||||
} else {
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
return fl_binary_messenger_send_response(self->messenger, response_handle,
|
||||
message, error);
|
||||
|
||||
@@ -44,9 +44,9 @@ static GBytes* fl_test_codec_encode_method_call(FlMethodCodec* codec,
|
||||
EXPECT_TRUE(FL_IS_TEST_METHOD_CODEC(codec));
|
||||
|
||||
g_autofree gchar* text = nullptr;
|
||||
if (args == nullptr || fl_value_get_type(args) == FL_VALUE_TYPE_NULL)
|
||||
if (args == nullptr || fl_value_get_type(args) == FL_VALUE_TYPE_NULL) {
|
||||
text = g_strdup_printf("%s()", name);
|
||||
else if (fl_value_get_type(args) == FL_VALUE_TYPE_INT) {
|
||||
} else if (fl_value_get_type(args) == FL_VALUE_TYPE_INT) {
|
||||
text = g_strdup_printf("%s(%" G_GINT64_FORMAT ")", name,
|
||||
fl_value_get_int(args));
|
||||
} else {
|
||||
@@ -86,11 +86,11 @@ static GBytes* fl_test_codec_encode_success_envelope(FlMethodCodec* codec,
|
||||
EXPECT_TRUE(FL_IS_TEST_METHOD_CODEC(codec));
|
||||
|
||||
g_autofree gchar* text = nullptr;
|
||||
if (result == nullptr || fl_value_get_type(result) == FL_VALUE_TYPE_NULL)
|
||||
if (result == nullptr || fl_value_get_type(result) == FL_VALUE_TYPE_NULL) {
|
||||
text = g_strdup("(null)");
|
||||
else if (fl_value_get_type(result) == FL_VALUE_TYPE_INT)
|
||||
} else if (fl_value_get_type(result) == FL_VALUE_TYPE_INT) {
|
||||
text = g_strdup_printf("%" G_GINT64_FORMAT, fl_value_get_int(result));
|
||||
else {
|
||||
} else {
|
||||
g_set_error(error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED,
|
||||
"ERROR");
|
||||
return nullptr;
|
||||
@@ -115,16 +115,18 @@ static GBytes* fl_test_codec_encode_error_envelope(FlMethodCodec* codec,
|
||||
|
||||
g_autofree gchar* text = nullptr;
|
||||
if (message == nullptr) {
|
||||
if (details == nullptr || fl_value_get_type(details) == FL_VALUE_TYPE_NULL)
|
||||
if (details == nullptr ||
|
||||
fl_value_get_type(details) == FL_VALUE_TYPE_NULL) {
|
||||
text = g_strdup_printf("Error_%s()", code);
|
||||
else {
|
||||
} else {
|
||||
text = g_strdup_printf("Error_%s(%" G_GINT64_FORMAT ")", code,
|
||||
fl_value_get_int(details));
|
||||
}
|
||||
} else {
|
||||
if (details == nullptr || fl_value_get_type(details) == FL_VALUE_TYPE_NULL)
|
||||
if (details == nullptr ||
|
||||
fl_value_get_type(details) == FL_VALUE_TYPE_NULL) {
|
||||
text = g_strdup_printf("Error_%s(%s)", code, message);
|
||||
else {
|
||||
} else {
|
||||
text = g_strdup_printf("Error_%s(%s,%" G_GINT64_FORMAT ")", code, message,
|
||||
fl_value_get_int(details));
|
||||
}
|
||||
|
||||
@@ -402,9 +402,9 @@ G_MODULE_EXPORT FlStandardMessageCodec* fl_standard_message_codec_new() {
|
||||
void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
|
||||
GByteArray* buffer,
|
||||
uint32_t size) {
|
||||
if (size < 254)
|
||||
if (size < 254) {
|
||||
write_uint8(buffer, size);
|
||||
else if (size <= 0xffff) {
|
||||
} else if (size <= 0xffff) {
|
||||
write_uint8(buffer, 254);
|
||||
write_uint16(buffer, size);
|
||||
} else {
|
||||
@@ -430,8 +430,9 @@ gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
|
||||
if (!read_uint16(buffer, offset, &value16, error))
|
||||
return FALSE;
|
||||
*value = value16;
|
||||
} else
|
||||
} else {
|
||||
*value = value8;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -560,33 +561,33 @@ FlValue* fl_standard_message_codec_read_value(FlStandardMessageCodec* self,
|
||||
return nullptr;
|
||||
|
||||
g_autoptr(FlValue) value = nullptr;
|
||||
if (type == kValueNull)
|
||||
if (type == kValueNull) {
|
||||
return fl_value_new_null();
|
||||
else if (type == kValueTrue)
|
||||
} else if (type == kValueTrue) {
|
||||
return fl_value_new_bool(TRUE);
|
||||
else if (type == kValueFalse)
|
||||
} else if (type == kValueFalse) {
|
||||
return fl_value_new_bool(FALSE);
|
||||
else if (type == kValueInt32)
|
||||
} else if (type == kValueInt32) {
|
||||
value = read_int32_value(buffer, offset, error);
|
||||
else if (type == kValueInt64)
|
||||
} else if (type == kValueInt64) {
|
||||
value = read_int64_value(buffer, offset, error);
|
||||
else if (type == kValueFloat64)
|
||||
} else if (type == kValueFloat64) {
|
||||
value = read_float64_value(buffer, offset, error);
|
||||
else if (type == kValueString)
|
||||
} else if (type == kValueString) {
|
||||
value = read_string_value(self, buffer, offset, error);
|
||||
else if (type == kValueUint8List)
|
||||
} else if (type == kValueUint8List) {
|
||||
value = read_uint8_list_value(self, buffer, offset, error);
|
||||
else if (type == kValueInt32List)
|
||||
} else if (type == kValueInt32List) {
|
||||
value = read_int32_list_value(self, buffer, offset, error);
|
||||
else if (type == kValueInt64List)
|
||||
} else if (type == kValueInt64List) {
|
||||
value = read_int64_list_value(self, buffer, offset, error);
|
||||
else if (type == kValueFloat64List)
|
||||
} else if (type == kValueFloat64List) {
|
||||
value = read_float64_list_value(self, buffer, offset, error);
|
||||
else if (type == kValueList)
|
||||
} else if (type == kValueList) {
|
||||
value = read_list_value(self, buffer, offset, error);
|
||||
else if (type == kValueMap)
|
||||
} else if (type == kValueMap) {
|
||||
value = read_map_value(self, buffer, offset, error);
|
||||
else {
|
||||
} else {
|
||||
g_set_error(error, FL_MESSAGE_CODEC_ERROR,
|
||||
FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE,
|
||||
"Unexpected standard codec type %02x", type);
|
||||
|
||||
@@ -191,8 +191,9 @@ static void method_call_cb(FlMethodChannel* channel,
|
||||
} else if (strcmp(method, kHideMethod) == 0) {
|
||||
gtk_im_context_focus_out(self->im_context);
|
||||
fl_method_call_respond_success(method_call, nullptr, nullptr);
|
||||
} else
|
||||
} else {
|
||||
fl_method_call_respond_not_implemented(method_call, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void fl_text_input_plugin_dispose(GObject* object) {
|
||||
|
||||
Reference in New Issue
Block a user