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 thread)

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 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 '4

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 pr

[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’ fr