1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

lua: fix conversion of dates in the API functions

On modern 32-bit platforms with a 64-bit time_t, long is 32-bit but time_t is
64-bit.

Use "long long" for variables cast to time_t.
This commit is contained in:
Sébastien Helleu
2026-06-21 07:43:59 +02:00
parent 8f33a72c99
commit 1dd423cb23
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -2173,7 +2173,7 @@ API_FUNC(print)
API_FUNC(print_date_tags)
{
const char *buffer, *tags, *message;
long date;
long long date;
API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 4)
@@ -2197,7 +2197,7 @@ API_FUNC(print_date_tags)
API_FUNC(print_datetime_tags)
{
const char *buffer, *tags, *message;
long date;
long long date;
int date_usec;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
@@ -2247,7 +2247,7 @@ API_FUNC(print_y_date_tags)
{
const char *buffer, *tags, *message;
int y;
long date;
long long date;
API_INIT_FUNC(1, "print_y_date_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 5)
@@ -2274,7 +2274,7 @@ API_FUNC(print_y_datetime_tags)
{
const char *buffer, *tags, *message;
int y, date_usec;
long date;
long long date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 6)
@@ -5008,7 +5008,7 @@ API_FUNC(infolist_new_var_time)
{
const char *item, *name;
const char *result;
long value;
long long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (lua_gettop (L) < 3)