On 07/13/2011 04:57 AM, Abhinav Upadhyay wrote:
> Hi,
>
> Quoting the ranking function given in the appendix of the FTS3
> documentation page (http://www.sqlite.org/fts3.html#appendix_a)
>
> static void rankfunc(sqlite3_context *pCtx, int nVal, sqlite3_value **apVal){
>    int *aMatchinfo;                /* Return value of matchinfo() */
> ...
> ...
> aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0]);
> ...
> ...
>
> aMatchinfo is declared as int * and the value obtained from
> sqlite3_value_blob() is being case to unsigned int *. This is causing
> a compiler warning, so I am wondering what is the datatype of the
> matchinfo blob (int * or unsigned int *) ? Although common sense says
> it should be unsigned int *, but just wanted to confirm .

The docs say "...the blob consists of zero or more 32-bit unsigned
integers in machine byte-order...". So I guess all of the "int"
declarations in that function should probably be "unsigned int".
Or, just changing the cast to an (int *) will also work.

   http://www.sqlite.org/fts3.html#matchinfo
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to