Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Midmay
Enrique Ramirez wrote: > I noticed what you mean (to reply to my own post). I just noticed the > original subject and this thread's subject are different: > > (original) [sqlite] GCC give a warning while passing a struct as the > user data to the callback function of sqlite3_exec() > (this

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Midmay
Enrique Ramirez wrote: > Looking at your address I can see you also use gmail. Threading for > this message is working fine for me. Are you using the web client or > an external mail program? > In fact, I'm using thunderbird, but it may doesn't matters. When i subscribed, I turn digest mode on,

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Enrique Ramirez
I noticed what you mean (to reply to my own post). I just noticed the original subject and this thread's subject are different: (original) [sqlite] GCC give a warning while passing a struct as the user data to the callback function of sqlite3_exec() (this thread) [sqlite] GCC give a warning while

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Enrique Ramirez
Looking at your address I can see you also use gmail. Threading for this message is working fine for me. Are you using the web client or an external mail program? On Tue, Aug 19, 2008 at 8:58 AM, Midmay <[EMAIL PROTECTED]> wrote: > Greetings, > >> As Michael Knigge has suggested, you may just

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Midmay
Greetings, > As Michael Knigge has suggested, you may just rename the parameter to > something else and then have something like > >MyStruct* data = (MyStruct*)foo; > > as the first line in your callback() function. Got it. Sorry but I make a mistake before, the '3rd argument' ought to be

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Markus Thiele
Greetings, > It works. Just ((MyStruct *) data)->x looks strange. As Michael Knigge has suggested, you may just rename the parameter to something else and then have something like MyStruct* data = (MyStruct*)foo; as the first line in your callback() function. In fact I believe in C

Re: [sqlite] GCC give a warning while passing a struct as the, user data to the callback function of sqlite3_exec()

2008-08-19 Thread Midmay
Thank you, Markus! > Simply change the type of the first argument to your callback function > to void* and the problem should go away. Of course you'll then have to > cast back to MyStruct* inside callback() to actually use the value. It works. Just ((MyStruct *) data)->x looks strange. > The

Re: [sqlite] GCC give a warning while passing a struct as the user data to the callback function of sqlite3_exec()

2008-08-19 Thread Michael Knigge
> however, the program runs well. What may causing the warning? what > should i do to get rid of this warning. The warning is produced because your callback() isn't int callback(void *, int, char **, char **); try this: int callback(void *foo, int argc, char **argv, char **azColName) {

Re: [sqlite] GCC give a warning while passing a struct as the user data to the callback function of sqlite3_exec()

2008-08-19 Thread Markus Thiele
Greetings, > I declare a struct and pass it as the 4th argument of sqlite3_exec(), > and define the 1st argument of callback function a pointer to this kind > of struct. while compiling, GCC give a warning like this: > ae.c: In function ‘main’: > ae.c:56: warning: passing argument 3

[sqlite] GCC give a warning while passing a struct as the user data to the callback function of sqlite3_exec()

2008-08-19 Thread Midmay
I declare a struct and pass it as the 4th argument of sqlite3_exec(), and define the 1st argument of callback function a pointer to this kind of struct. while compiling, GCC give a warning like this: ae.c: In function ‘main’: ae.c:56: warning: passing argument 3 of ‘sqlite3_exec’