From: Rico Tzschichholz Date: Sun, 4 Nov 2018 09:00:01 +0000 (+0100) Subject: gdbus: Don't pass null to get_ccode_array_length_type() to fix criticals X-Git-Tag: 0.43.1~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974f5713150b13a657f47e1b6f54135d8328ab01;p=thirdparty%2Fvala.git gdbus: Don't pass null to get_ccode_array_length_type() to fix criticals --- diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala index a0f15b42b..57051b2c4 100644 --- a/codegen/valagdbusclientmodule.vala +++ b/codegen/valagdbusclientmodule.vala @@ -800,9 +800,8 @@ public class Vala.GDBusClientModule : GDBusModule { ccode.add_declaration (get_ccode_name (param.variable_type), new CCodeVariableDeclarator.zero ("_vala_%s".printf (param.name), default_value_for_type (param.variable_type, true))); var array_type = param.variable_type as ArrayType; - var length_ctype = get_ccode_array_length_type (array_type); - if (array_type != null) { + var length_ctype = get_ccode_array_length_type (array_type); for (int dim = 1; dim <= array_type.rank; dim++) { ccode.add_declaration (length_ctype, new CCodeVariableDeclarator ("_vala_%s_length%d".printf (param.name, dim), new CCodeConstant ("0"))); } @@ -841,9 +840,8 @@ public class Vala.GDBusClientModule : GDBusModule { ccode.add_declaration (get_ccode_name (m.return_type), new CCodeVariableDeclarator.zero ("_result", default_value_for_type (m.return_type, true))); var array_type = m.return_type as ArrayType; - var length_ctype = get_ccode_array_length_type (array_type); - if (array_type != null) { + var length_ctype = get_ccode_array_length_type (array_type); for (int dim = 1; dim <= array_type.rank; dim++) { ccode.add_declaration (length_ctype, new CCodeVariableDeclarator ("_result_length%d".printf (dim), new CCodeConstant ("0"))); } diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala index c446ffd0e..904e04502 100644 --- a/codegen/valagdbusservermodule.vala +++ b/codegen/valagdbusservermodule.vala @@ -149,8 +149,8 @@ public class Vala.GDBusServerModule : GDBusClientModule { } var array_type = param.variable_type as ArrayType; - var length_ctype = get_ccode_array_length_type (array_type); if (array_type != null) { + var length_ctype = get_ccode_array_length_type (array_type); for (int dim = 1; dim <= array_type.rank; dim++) { string length_cname = get_parameter_array_length_cname (param, dim);