Hi all,
I began a wxWindows applications, so far so good. I have to add
database functionality, and I chose sqlite (www.sqlite.org). As
wxWindows is C++ only, and sqlite is simple C, I do not know how to
enforce it in the same project. When I used only C, I could compile
sqlite, but now I get from the C++ compiler:
72 sqlite\attach.c invalid conversion from `void*' to `Db*'
Which stands for:
aNew = sqliteMalloc( sizeof(db->aDb[0])*3 );
Where:
Db *aNew;
void *sqliteMalloc(int);
And:
struct Db {
char *zName; /* Name of this database */
Btree *pBt; /* The B*Tree structure for this database file */
int schema_cookie; /* Database schema version number for this file */
Hash tblHash; /* All tables indexed by name */
Hash idxHash; /* All (named) indices indexed by name */
Hash trigHash; /* All triggers indexed by name */
Hash aFKey; /* Foreign keys indexed by to-table */
u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */
u16 flags; /* Flags associated with this database */
};
My question is, is it correct that I have added typecasts to (Db*) as:
aNew = (Db*)sqliteMalloc( sizeof(db->aDb[0])*3 );
Thanks,
GCS
|