From b37633172bb87009b2a607f25beeba79f4122e74 Mon Sep 17 00:00:00 2001 From: Chris Gallant Date: Sun, 20 Oct 2024 01:34:27 +0000 Subject: [PATCH] Fixes for GCC-14. handle_python_function defined with only one argument, struct Value has two in command.h. Gave default of 0 to second argument in call from expr.c. Change from int to long int in pyvar_to_tfvar. --- src/expr.c | 2 +- src/tfpython.c | 4 ++-- src/tfpython.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/expr.c b/src/expr.c index 27c7f361..dfc2bdea 100644 --- a/src/expr.c +++ b/src/expr.c @@ -974,7 +974,7 @@ static Value *function_switch(const ExprFunc *func, int n, const char *parent) #ifdef TFPYTHON case FN_python: { - struct Value *rv = handle_python_function( opdstr(n-0) ); + struct Value *rv = handle_python_function( opdstr(n-0), 0 ); if( !rv ) { return shareval(val_zero); } else { diff --git a/src/tfpython.c b/src/tfpython.c index a1fbfe2e..5f7d4987 100644 --- a/src/tfpython.c +++ b/src/tfpython.c @@ -201,7 +201,7 @@ static struct Value* pyvar_to_tfvar( PyObject *pRc ) { struct Value *rc; char *cstr; - int len; // Py_ssize_t len; + long int len; // Py_ssize_t len; // can be null if exception was thrown if( !pRc ) { @@ -466,7 +466,7 @@ struct Value *handle_python_command( String *args, int offset ) return pyvar_to_tfvar( pRc ); } -struct Value *handle_python_function( conString *args ) +struct Value *handle_python_function( conString *args, int offset ) { PyObject *pRc; diff --git a/src/tfpython.h b/src/tfpython.h index 25497243..95937320 100644 --- a/src/tfpython.h +++ b/src/tfpython.h @@ -23,7 +23,7 @@ #include "signals.h" /* suspend(), shell() */ #include "variable.h" -struct Value *handle_python_function( conString *args ); +struct Value *handle_python_function( conString *args, int offset ); struct Value *handle_python_command( String *args, int offset ); struct Value *handle_python_kill_command( String *args, int offset ); struct Value *handle_python_call_command( String *args, int offset );