[Vala] Gda.DataModel.get_value_at C generated code is incorrect



Vala autogenerated bindings of GDA (master) shows that:

[CCode (vfunc_name = "i_get_value_at")]
public abstract GLib.Value get_value_at (int col, int row) throws GLib.Error;
/* i_get_value_at is a virtual function in GdaDataModel Interface */


And GDA bindings in Vala 0.14 shows:

public unowned GLib.Value? get_value_at (int col, int row) throws GLib.Error;


Why the following code doesn't compile under libgda-5.0 (master)
bindings, but only using libgda-4.0 (Vala):

namespace Bug {
        public static int main (string[] args) {
                var c = Gda.Connection.open_from_string("Sqlite",
"SQLite://DB_DIR=.;DB_NAME=test", null,
Gda.ConnectionOptions.READ_ONLY);
                if (c.is_opened()) {
                        var m = c.execute_select_command("SELECT MAX(n) FROM val");
                        stdout.printf("Rows and columns: %i, %i\n", m.get_n_rows(),
m.get_n_columns());
                        Value v = m.get_value_at(0,0);
                        stdout.printf("Value is type: %s\n", v.type_name());
                }
                return 0;
        }
}

The error messages are:

bug-DataModel-get-value-at.vala:3.11-3.124: warning: unhandled error
`GLib.Error'
                var c = Gda.Connection.open_from_string("Sqlite",
"SQLite://DB_DIR=.;DB_NAME=test", null,
Gda.ConnectionOptions.READ_ONLY);
                        
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bug-DataModel-get-value-at.vala:5.12-5.61: warning: unhandled error `GLib.Error'
                        var m = c.execute_select_command("SELECT MAX(n) FROM val");
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bug-DataModel-get-value-at.vala:7.14-7.32: warning: unhandled error `GLib.Error'
                        Value v = m.get_value_at(0,0);
                                  ^^^^^^^^^^^^^^^^^^^
/home/esodan/Proyectos/bug-DataModel-get-value-at.vala.c: In function
'bug_main':
/home/esodan/Proyectos/bug-DataModel-get-value-at.vala.c:65:3:
warning: passing argument 4 of 'gda_data_model_get_value_at' from
incompatible pointer type [enabled by default]
/usr/include/libgda-5.0/libgda/gda-data-model.h:184:21: note: expected
'struct GError **' but argument is of type 'struct GValue *'
/home/esodan/Proyectos/bug-DataModel-get-value-at.vala.c:65:3: error:
too many arguments to function 'gda_data_model_get_value_at'
/usr/include/libgda-5.0/libgda/gda-data-model.h:184:21: note: declared here
error: cc exited with status 256
Compilation failed: 1 error(s), 3 warning(s)



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