]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
sqlite3: Cast errmsg to char** in C.
authorJulian Andres Klode <jak@jak-linux.org>
Fri, 14 May 2010 03:42:01 +0000 (20:42 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Fri, 14 May 2010 03:42:01 +0000 (20:42 -0700)
Vala's string out arguments are const char**, but sqlite3_exec() and
sqlite3_get_table() expect 'char**'. Add [CCode (type = "char**")] to
cast them to the wanted type, thus avoiding a warning from the C
compiler.

Fixes bug 618457.

vapi/sqlite3.vapi

index edff3734f2d24ff62cb98d7db8c753da5b2bdd9e..801154c233f142c21f4cababf88b4aed11fa470b 100644 (file)
@@ -29,7 +29,7 @@ namespace Sqlite {
                public int busy_timeout (int ms);
                public int changes ();
                [CCode (cname = "sqlite3_exec")]
-               public int _exec (string sql, Callback? sqlite3_callback = null, out unowned string errmsg = null);
+               public int _exec (string sql, Callback? sqlite3_callback = null, [CCode (type = "char**")] out unowned string errmsg = null);
                [CCode (cname = "_sqlite3_exec")]
                public int exec (string sql, Callback? sqlite3_callback = null, out string errmsg = null) {
                        unowned string sqlite_errmsg;
@@ -48,7 +48,7 @@ namespace Sqlite {
                public int total_changes ();
                public int complete (string sql);
                [CCode (cname = "sqlite3_get_table")]
-               public int _get_table (string sql, [CCode (array_length = false)] out unowned string[] resultp, out int nrow, out int ncolumn, out unowned string? errmsg = null);
+               public int _get_table (string sql, [CCode (array_length = false)] out unowned string[] resultp, out int nrow, out int ncolumn, [CCode (type = "char**")] out unowned string? errmsg = null);
                private static void free_table ([CCode (array_length = false)] string[] result);
                [CCode (cname = "_sqlite3_get_table")]
                public int get_table (string sql, out string[] resultp, out int nrow, out int ncolumn, out string? errmsg = null) {