LuaSQLite3

Check-in [a4478aa43c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix C99ism
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a4478aa43c32adc914481217610f227eb76aeabb
User & Date: e 2013-10-18 21:56:59
References
2013-10-18
21:59 Fixed ticket [77e34ea2fd]: Won't compile with VS2012 - sqlite 3.7.17 and lua 5.2.2 plus 5 other changes artifact: 5ca9244859 user: e
Context
2015-01-04
22:13
Updated for Lua 5.3. Use sqlite3_prepare_v2. check-in: d59e31d19c user: e tags: trunk
2013-10-18
21:56
Fix C99ism check-in: a4478aa43c user: e tags: trunk
2013-05-06
20:45
Update rockspec to indicate compatibility with Lua 5.1 and 5.2 but not Lua 5.3 check-in: 89c917f576 user: e tags: fsl_9t, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to lsqlite3.c.

  1258   1258   ** Params: userdata, {one of SQLITE_INSERT, SQLITE_DELETE, or SQLITE_UPDATE}, 
  1259   1259   **          database name, table name (containing the affected row), rowid of the row
  1260   1260   */
  1261   1261   static void db_update_hook_callback(void *user, int op, char const *dbname, char const *tblname, sqlite3_int64 rowid) {
  1262   1262       sdb *db = (sdb*)user;
  1263   1263       lua_State *L = db->L;
  1264   1264       int top = lua_gettop(L);
         1265  +    lua_Number n;
  1265   1266   
  1266   1267       /* setup lua callback call */
  1267   1268       lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_cb);    /* get callback */
  1268   1269       lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_udata); /* get callback user data */
  1269   1270       lua_pushnumber(L, (lua_Number )op);
  1270   1271       lua_pushstring(L, dbname); /* update_hook database name */
  1271   1272       lua_pushstring(L, tblname); /* update_hook database name */
  1272         -    lua_Number n = (lua_Number)rowid;
         1273  +    n = (lua_Number)rowid;
  1273   1274       if (n == rowid)
  1274   1275           lua_pushnumber(L, n);
  1275   1276       else
  1276   1277           lua_pushfstring(L, "%ll", rowid);
  1277   1278   
  1278   1279       /* call lua function */
  1279   1280       lua_pcall(L, 5, 0, 0);