Stephan Beal wrote:
2012/2/3 Jorge Eliécer Osorio Caro <jorgeliecer.osorio at gmail.com>

>            *ppVTab = (sqlite3_vtab*) nr;
>             ((sqlite3_vtab*) nr)->zErrMsg = NULL;
>

Please try changing those to the variants from my previous post. i'm not
100% convinced that that cast is strictly legal in C++.

It will work with all the C/C++ implementations I've seen. However, it would be better, and more informative, and ultimately more robust, to change this code:
    typedef struct NiuRoutingStruct {
        sqlite3_vtab vtab;
    } NiuRouting;
to this:
    struct NiuRouting : public sqlite3_vtab vtab {
         ... // your implementation, eventually
    };

This way, the casting is unnecessary and any pointer offsetting will be done correctly.

The use of C-style casts in C++ is bad practice. Use static_cast where you can. The problem with C-style casting is that it can become a reinterpret_cast when that is going to produce problems.

--
Larry Brasfield
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to