Visual C++ correctly catches this. The fragment
struct IcuScalar {
const char *zName; /* Function name */
int nArg; /* Number of arguments */
int enc; /* Optimal text encoding */
void *pContext; /* sqlite3_user_data() context */
void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
} scalars[] = {
{"regexp", 2, SQLITE_ANY|SQLITE_DETERMINISTIC, 0, icuRegexpFunc},
{"lower", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16},
{"lower", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16},
{"upper", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},
{"upper", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},
{"lower", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16},
{"lower", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16},
{"upper", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},
{"upper", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},
{"like", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc},
{"like", 3, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc},
{"icu_load_collation", 2, SQLITE_UTF8, (void*)db, icuLoadCollation},
};
int rc = SQLITE_OK;
int i;
should read
struct IcuScalar {
const char *zName; /* Function name */
int nArg; /* Number of arguments
*/
int enc; /* Optimal text
encoding */
void *pContext; /* sqlite3_user_data()
context */
void(*xFunc)(sqlite3_context*, int, sqlite3_value**);
} scalars[] = {
{ "regexp", 2, SQLITE_ANY | SQLITE_DETERMINISTIC, 0,
icuRegexpFunc },
{ "lower", 1, SQLITE_UTF16 | SQLITE_DETERMINISTIC, 0,
icuCaseFunc16 },
{ "lower", 2, SQLITE_UTF16 | SQLITE_DETERMINISTIC, 0,
icuCaseFunc16 },
{ "upper", 1, SQLITE_UTF16 | SQLITE_DETERMINISTIC, (void*)1,
icuCaseFunc16 },
{ "upper", 2, SQLITE_UTF16 | SQLITE_DETERMINISTIC, (void*)1,
icuCaseFunc16 },
{ "lower", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
icuCaseFunc16 },
{ "lower", 2, SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
icuCaseFunc16 },
{ "upper", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, (void*)1,
icuCaseFunc16 },
{ "upper", 2, SQLITE_UTF8 | SQLITE_DETERMINISTIC, (void*)1,
icuCaseFunc16 },
{ "like", 2, SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
icuLikeFunc },
{ "like", 3, SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
icuLikeFunc },
{ "icu_load_collation", 2, SQLITE_UTF8, 0, icuLoadCollation }
};
int rc = SQLITE_OK;
int i;
scalars[11].pContext = (void*)db;
Thank you,
--Zem
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users