[Vala] [Genie] possible bug in array code



this line breaks:
class soy.widgets.Canvas : Object implements soy.widgets.Widget
  verts : array of GLfloat =  { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
                                1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
                                1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
                                0.0f, 1.0f, 0.0f, 0.0f, 1.0f }

with this error:
default/src/widgets/Canvas.c: In function
‘soy_widgets_canvas_instance_init’:
default/src/widgets/Canvas.c:250: error: ‘soywidgetsCanvas’ has no member
named ‘verts_size’

This is the generated code which is causing problems.  Note that this class
has no "init" method:

static void soy_widgets_canvas_instance_init (soywidgetsCanvas * self) {
        GLfloat* _tmp0_ = NULL;
        GLushort* _tmp1_ = NULL;
        self->priv = SOY_WIDGETS_CANVAS_GET_PRIVATE (self);
        self->verts = (_tmp0_ = g_new0 (GLfloat, 20), _tmp0_[0] = (GLfloat)
0.0$
        self->verts_length1 = 20;
        self->verts_size = self->verts_length1;
        self->faces = (_tmp1_ = g_new0 (GLushort, 6), _tmp1_[0] = (GLushort)
0,$
        self->faces_length1 = 6;
        self->faces_size = self->faces_length1;
}

making it a static array of GLfloat makes it work:
class soy.widgets.Canvas : Object implements soy.widgets.Widget
  verts : static array of GLfloat =  { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
                                       1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
                                       1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
                                       0.0f, 1.0f, 0.0f, 0.0f, 1.0f }

static arrays work for us in this case, but it'd be nice to get this bug
fixed before the next release


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]