From: Victor Stinner Date: Sat, 2 Sep 2023 21:15:54 +0000 (+0200) Subject: gh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830) X-Git-Tag: v3.13.0a1~636 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a52213bf830226fd969dc2a2ef8006c89edecc35;p=thirdparty%2FPython%2Fcpython.git gh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830) --- diff --git a/Python/pystrhex.c b/Python/pystrhex.c index ce456b79f165..38484f5a7d42 100644 --- a/Python/pystrhex.c +++ b/Python/pystrhex.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_strhex.h" // _Py_strhex_with_sep() #include "pycore_unicodeobject.h" // _PyUnicode_CheckConsistency() -#include // abs() static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, PyObject* sep, int bytes_per_sep_group, @@ -44,7 +43,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, bytes_per_sep_group = 0; } - unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group); + unsigned int abs_bytes_per_sep = Py_ABS(bytes_per_sep_group); Py_ssize_t resultlen = 0; if (bytes_per_sep_group && arglen > 0) { /* How many sep characters we'll be inserting. */