From 7f46e646754d0739c066a002a8ba95e63c40c7e4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 6 Aug 2022 07:39:06 +0300 Subject: [PATCH 43/43] luasql: Fix clang cast alignment change warnings See osdn #44815 Signed-off-by: Marko Lindqvist --- dependencies/luasql/src/ls_mysql.c | 2 +- dependencies/luasql/src/ls_postgres.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies/luasql/src/ls_mysql.c b/dependencies/luasql/src/ls_mysql.c index f6e2438568..f4d3908b12 100644 --- a/dependencies/luasql/src/ls_mysql.c +++ b/dependencies/luasql/src/ls_mysql.c @@ -339,7 +339,7 @@ static int cur_close (lua_State *L) { ** a reference to it on the cursor structure. */ static void _pushtable (lua_State *L, cur_data *cur, size_t off) { - int *ref = (int *)((char *)cur + off); + int *ref = (int *)cur + off / sizeof(int); /* If colnames or coltypes do not exist, create both. */ if (*ref == LUA_NOREF) diff --git a/dependencies/luasql/src/ls_postgres.c b/dependencies/luasql/src/ls_postgres.c index fb4f9e2a9e..f952bcd320 100644 --- a/dependencies/luasql/src/ls_postgres.c +++ b/dependencies/luasql/src/ls_postgres.c @@ -248,7 +248,7 @@ static void create_coltypes (lua_State *L, cur_data *cur) { ** a reference to it on the cursor structure. */ static void _pushtable (lua_State *L, cur_data *cur, size_t off, creator func) { - int *ref = (int *)((char *)cur + off); + int *ref = (int *)cur + off / sizeof(int); if (*ref != LUA_NOREF) lua_rawgeti (L, LUA_REGISTRYINDEX, *ref); else { -- 2.35.1