~ubuntu-branches/ubuntu/maverick/vala/maverick

« back to all changes in this revision

Viewing changes to codegen/valadbusservermodule.vala

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-02-13 17:59:22 UTC
  • mfrom: (7.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100213175922-n8bq2xv2q1hihhqb
Tags: 0.7.10-1ubuntu1
* Sync with Debian unstable.
* Remaining changes :
 - debian/rules: Don't make unit test failures fatal to fix FTBFS. It was
   needed if vala need to enter main but it's not the case for now. 
   (See #374151)

Show diffs side-by-side

added added

removed removed

Lines of Context:
228
228
 
229
229
                                        cdecl = new CCodeDeclaration ("int");
230
230
                                        cdecl.add_declarator (new CCodeVariableDeclarator (length_cname, new CCodeConstant ("0")));
231
 
                                        if (param.direction != ParameterDirection.IN) {
232
 
                                                out_prefragment.append (cdecl);
233
 
                                                ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
 
231
                                        if (!m.coroutine || param.direction == ParameterDirection.IN) {
 
232
                                                if (param.direction != ParameterDirection.IN) {
 
233
                                                        out_prefragment.append (cdecl);
 
234
                                                        ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
 
235
                                                } else {
 
236
                                                        in_prefragment.append (cdecl);
 
237
                                                        ccall.add_argument (new CCodeIdentifier (length_cname));
 
238
                                                }
234
239
                                        } else {
235
 
                                                in_prefragment.append (cdecl);
236
 
                                                ccall.add_argument (new CCodeIdentifier (length_cname));
 
240
                                                out_prefragment.append (cdecl);
 
241
                                                finish_ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
237
242
                                        }
238
243
                                }
239
244
                        }
267
272
                if (!(m.return_type is VoidType)) {
268
273
                        if (get_type_signature (m.return_type) == null) {
269
274
                                Report.error (m.return_type.source_reference, "D-Bus serialization of type `%s' is not supported".printf (m.return_type.to_string ()));
270
 
                        } else if (m.return_type.is_real_struct_type ()) {
 
275
                        } else if (m.return_type.is_real_non_null_struct_type ()) {
271
276
                                cdecl = new CCodeDeclaration (m.return_type.get_cname ());
272
277
                                cdecl.add_declarator (new CCodeVariableDeclarator.zero ("result", default_value_for_type (m.return_type, true)));
273
278
                                out_prefragment.append (cdecl);
786
791
                        cdecl.add_declarator (new CCodeVariableDeclarator ("result"));
787
792
                        postfragment.append (cdecl);
788
793
 
789
 
                        if (prop.property_type.is_real_struct_type ()) {
 
794
                        if (prop.property_type.is_real_non_null_struct_type ()) {
790
795
                                // structs are returned via out parameter
791
796
                                ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("result")));
792
797
 
1002
1007
                        cdecl.add_declarator (new CCodeVariableDeclarator ("result"));
1003
1008
                        postfragment.append (cdecl);
1004
1009
 
1005
 
                        if (prop.property_type.is_real_struct_type ()) {
 
1010
                        if (prop.property_type.is_real_non_null_struct_type ()) {
1006
1011
                                // structs are returned via out parameter
1007
1012
                                ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("result")));
1008
1013
 
1185
1190
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier (prop.set_accessor.get_cname ()));
1186
1191
                        ccall.add_argument (new CCodeIdentifier ("self"));
1187
1192
 
1188
 
                        if (prop.property_type.is_real_struct_type ()) {
 
1193
                        if (prop.property_type.is_real_non_null_struct_type ()) {
1189
1194
                                // structs are passed by reference
1190
1195
                                ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("value")));
1191
1196
                        } else {