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

« back to all changes in this revision

Viewing changes to vala/valacastexpression.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-04-02 10:10:55 UTC
  • mfrom: (1.4.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100402101055-qbx3okzv0tnp3wpp
Tags: 0.8.0-0ubuntu1
* New upstream release:
  - Infer type arguments when calling generic methods.
  - Support `in' operator for arrays.
  - Add experimental support for regular expression literals.
  - Add experimental support for chained relational expressions.
  - Add va_list support.
  - Add clutter-gtk-0.10 bindings (Gordon Allott).
  - Add gdl-1.0 bindings (Nicolas Joseph).
  - Add gstreamer-app-0.10 bindings (Sebastian Dröge).
  - Add gstreamer-cdda-0.10 bindings (Sebastian Dröge).
  - Add gudev-1.0 bindings (Jim Nelson).
  - Add libgda-report-4.0 bindings (Shawn Ferris).
  - Add libgvc (graphviz) bindings (Martin Olsson).
  - Add purple bindings (Adrien Bustany).
  - Many bug fixes and binding updates.
* debian/patches/99_ltmain_as-needed.patch: refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
/* valacastexpression.vala
5
5
 *
6
 
 * Copyright (C) 2006-2009  Jürg Billeter
 
6
 * Copyright (C) 2006-2010  Jürg Billeter
7
7
 *
8
8
 * This library is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU Lesser General Public
190
190
void vala_code_node_unref (gpointer instance);
191
191
GParamSpec* vala_param_spec_code_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
192
192
void vala_value_set_code_node (GValue* value, gpointer v_object);
 
193
void vala_value_take_code_node (GValue* value, gpointer v_object);
193
194
gpointer vala_value_get_code_node (const GValue* value);
194
195
GType vala_code_node_get_type (void);
195
196
gpointer vala_code_visitor_ref (gpointer instance);
196
197
void vala_code_visitor_unref (gpointer instance);
197
198
GParamSpec* vala_param_spec_code_visitor (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
198
199
void vala_value_set_code_visitor (GValue* value, gpointer v_object);
 
200
void vala_value_take_code_visitor (GValue* value, gpointer v_object);
199
201
gpointer vala_value_get_code_visitor (const GValue* value);
200
202
GType vala_code_visitor_get_type (void);
201
203
GType vala_semantic_analyzer_get_type (void);
215
217
void vala_source_reference_unref (gpointer instance);
216
218
GParamSpec* vala_param_spec_source_reference (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
217
219
void vala_value_set_source_reference (GValue* value, gpointer v_object);
 
220
void vala_value_take_source_reference (GValue* value, gpointer v_object);
218
221
gpointer vala_value_get_source_reference (const GValue* value);
219
222
GType vala_source_reference_get_type (void);
220
223
void vala_code_node_set_source_reference (ValaCodeNode* self, ValaSourceReference* value);
245
248
void vala_report_error (ValaSourceReference* source, const char* message);
246
249
ValaSourceReference* vala_code_node_get_source_reference (ValaCodeNode* self);
247
250
ValaDataType* vala_data_type_copy (ValaDataType* self);
 
251
void vala_data_type_set_nullable (ValaDataType* self, gboolean value);
248
252
void vala_expression_set_value_type (ValaExpression* self, ValaDataType* value);
249
 
void vala_data_type_set_nullable (ValaDataType* self, gboolean value);
250
 
void vala_expression_set_target_type (ValaExpression* self, ValaDataType* value);
251
253
gboolean vala_data_type_get_value_owned (ValaDataType* self);
252
254
void vala_data_type_set_value_owned (ValaDataType* self, gboolean value);
 
255
gboolean vala_cast_expression_get_is_silent_cast (ValaCastExpression* self);
 
256
void vala_expression_set_target_type (ValaExpression* self, ValaDataType* value);
253
257
static gboolean vala_cast_expression_real_check (ValaCodeNode* base, ValaSemanticAnalyzer* analyzer);
254
258
void vala_code_node_get_defined_variables (ValaCodeNode* self, ValaCollection* collection);
255
259
static void vala_cast_expression_real_get_defined_variables (ValaCodeNode* base, ValaCollection* collection);
256
260
void vala_code_node_get_used_variables (ValaCodeNode* self, ValaCollection* collection);
257
261
static void vala_cast_expression_real_get_used_variables (ValaCodeNode* base, ValaCollection* collection);
258
262
void vala_code_node_set_parent_node (ValaCodeNode* self, ValaCodeNode* value);
259
 
gboolean vala_cast_expression_get_is_silent_cast (ValaCastExpression* self);
260
263
static void vala_cast_expression_finalize (ValaCodeNode* obj);
261
264
 
262
265
 
323
326
 
324
327
static gboolean vala_cast_expression_real_is_pure (ValaExpression* base) {
325
328
        ValaCastExpression * self;
326
 
        gboolean result;
 
329
        gboolean result = FALSE;
327
330
        self = (ValaCastExpression*) base;
328
331
        result = vala_expression_is_pure (vala_cast_expression_get_inner (self));
329
332
        return result;
343
346
 
344
347
static gboolean vala_cast_expression_real_check (ValaCodeNode* base, ValaSemanticAnalyzer* analyzer) {
345
348
        ValaCastExpression * self;
346
 
        gboolean result;
347
 
        ValaDataType* _tmp2_;
 
349
        gboolean result = FALSE;
 
350
        ValaDataType* _tmp1_;
348
351
        self = (ValaCastExpression*) base;
349
352
        g_return_val_if_fail (analyzer != NULL, FALSE);
350
353
        if (vala_code_node_get_checked ((ValaCodeNode*) self)) {
365
368
        }
366
369
        if (self->priv->_is_non_null_cast) {
367
370
                ValaDataType* _tmp0_;
368
 
                ValaDataType* _tmp1_;
369
 
                vala_expression_set_value_type ((ValaExpression*) self, _tmp0_ = vala_data_type_copy (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
 
371
                vala_cast_expression_set_type_reference (self, _tmp0_ = vala_data_type_copy (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
370
372
                _vala_code_node_unref0 (_tmp0_);
371
 
                vala_data_type_set_nullable (vala_expression_get_value_type ((ValaExpression*) self), FALSE);
372
 
                vala_expression_set_target_type (vala_cast_expression_get_inner (self), _tmp1_ = vala_data_type_copy (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
373
 
                _vala_code_node_unref0 (_tmp1_);
374
 
                result = !vala_code_node_get_error ((ValaCodeNode*) self);
375
 
                return result;
 
373
                vala_data_type_set_nullable (vala_cast_expression_get_type_reference (self), FALSE);
376
374
        }
377
375
        vala_code_node_check ((ValaCodeNode*) vala_cast_expression_get_type_reference (self), analyzer);
378
376
        vala_expression_set_value_type ((ValaExpression*) self, vala_cast_expression_get_type_reference (self));
379
377
        vala_data_type_set_value_owned (vala_expression_get_value_type ((ValaExpression*) self), vala_data_type_get_value_owned (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
380
 
        vala_expression_set_target_type (vala_cast_expression_get_inner (self), _tmp2_ = vala_data_type_copy (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
381
 
        _vala_code_node_unref0 (_tmp2_);
 
378
        if (self->priv->_is_silent_cast) {
 
379
                vala_data_type_set_nullable (vala_expression_get_value_type ((ValaExpression*) self), TRUE);
 
380
        }
 
381
        vala_expression_set_target_type (vala_cast_expression_get_inner (self), _tmp1_ = vala_data_type_copy (vala_expression_get_value_type (vala_cast_expression_get_inner (self))));
 
382
        _vala_code_node_unref0 (_tmp1_);
382
383
        result = !vala_code_node_get_error ((ValaCodeNode*) self);
383
384
        return result;
384
385
}
494
495
 
495
496
 
496
497
GType vala_cast_expression_get_type (void) {
497
 
        static GType vala_cast_expression_type_id = 0;
498
 
        if (vala_cast_expression_type_id == 0) {
 
498
        static volatile gsize vala_cast_expression_type_id__volatile = 0;
 
499
        if (g_once_init_enter (&vala_cast_expression_type_id__volatile)) {
499
500
                static const GTypeInfo g_define_type_info = { sizeof (ValaCastExpressionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_cast_expression_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCastExpression), 0, (GInstanceInitFunc) vala_cast_expression_instance_init, NULL };
 
501
                GType vala_cast_expression_type_id;
500
502
                vala_cast_expression_type_id = g_type_register_static (VALA_TYPE_EXPRESSION, "ValaCastExpression", &g_define_type_info, 0);
 
503
                g_once_init_leave (&vala_cast_expression_type_id__volatile, vala_cast_expression_type_id);
501
504
        }
502
 
        return vala_cast_expression_type_id;
 
505
        return vala_cast_expression_type_id__volatile;
503
506
}
504
507
 
505
508