Re: [sqlite] sqlite3_column_double - problems when assigning values to variable

2006-12-09 Thread Marten Feldtmann

Marten Feldtmann schrieb:

[EMAIL PROTECTED] schrieb:

Make sure sqlite3_column_double() really is declared to
return a double and that dVal really is declared to be a
double.  If both of those things check out, then I would
assert that this is a compiler bug.
  
Yes, I think also that this is a very low level error - I've posted a 
message

in the OpenWatcom forum and hope for an answer.


Solution: When using OpenWatcom one should use __syscall calling convention
and not __cdecl - then it works without problems.

Marten

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite3_column_double - problems when assigning values to variable

2006-12-09 Thread Marten Feldtmann

[EMAIL PROTECTED] schrieb:

Make sure sqlite3_column_double() really is declared to
return a double and that dVal really is declared to be a
double.  If both of those things check out, then I would
assert that this is a compiler bug.
  
Yes, I think also that this is a very low level error - I've posted a 
message

in the OpenWatcom forum and hope for an answer.

Marten

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite3_column_double - problems when assigning values to variable

2006-12-09 Thread drh
Marten Feldtmann <[EMAIL PROTECTED]> wrote:
> John Stanton schrieb:
> > Maybe your statement does not reference a valid row.
> >
> No, actually I have in my test program several lines to retrieve
> the values in different ways:
> 
>sql = "select aColumn from TESTME2;";
> sqlite3_open("c:\\sunittest.db", );
> sqlite3_prepare(db, sql, strlen(sql), , NULL);
> rc = sqlite3_step(stmt);
> 
> /* --- */
> 
> /* this is ok and returns "5000.0" */
> txt = sqlite3_column_text( stmt, 0);
> 
> /* this works */
> sqlite3_column_double( stmt, 0);
> 
> /* this crashed ...
> dVal = sqlite3_column_double( stmt, 0);
> 
> /* --- */
> sqlite3_finalize(stmt);
> sqlite3_close(db);
> return( dVal);
> 

Make sure sqlite3_column_double() really is declared to
return a double and that dVal really is declared to be a
double.  If both of those things check out, then I would
assert that this is a compiler bug.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite3_column_double - problems when assigning values to variable

2006-12-09 Thread Marten Feldtmann

John Stanton schrieb:

Maybe your statement does not reference a valid row.


No, actually I have in my test program several lines to retrieve
the values in different ways:

  sql = "select aColumn from TESTME2;";
   sqlite3_open("c:\\sunittest.db", );
   sqlite3_prepare(db, sql, strlen(sql), , NULL);
   rc = sqlite3_step(stmt);

   /* --- */

   /* this is ok and returns "5000.0" */
   txt = sqlite3_column_text( stmt, 0);

   /* this works */
   sqlite3_column_double( stmt, 0);

   /* this crashed ...
   dVal = sqlite3_column_double( stmt, 0);

   /* --- */
   sqlite3_finalize(stmt);
   sqlite3_close(db);
   return( dVal);



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite3_column_double - problems when assigning values to variable

2006-12-08 Thread John Stanton

Maybe your statement does not reference a valid row.

Marten Feldtmann wrote:

I have written some interface code to the sqlite3 API using the
OpenWatcom 1.5 compiler and I wrapped several functions like
sqlite3_column_text, sqlite3_column_int and all went fine.

Then I tried to wrap sqlite3_column_double(..) and when I do something
like


...
sqlite3_column_double( stmt, 0);
...

the statement works without problems, but when I write:


double dVal;
...
dVal = sqlite3_column_double( stmt, 0);
...

I get a general protection fault.

I'm not that C guru - but what is the problem here ?


Marten

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






-
To unsubscribe, send email to [EMAIL PROTECTED]
-