# HG changeset patch # User Franz Glasner # Date 1641504997 -3600 # Node ID 44e18fbf77415e052fa39738a23c3bebd7e45f4d # Parent 2c211934d4b0b39f96b39e96516f9f2eb3095d5c Refactor: signature of _convert_ucs4_to_utf8(): change order of args diff -r 2c211934d4b0 -r 44e18fbf7741 configmix/_speedups.c --- a/configmix/_speedups.c Thu Jan 06 20:37:29 2022 +0100 +++ b/configmix/_speedups.c Thu Jan 06 22:36:37 2022 +0100 @@ -145,10 +145,11 @@ Py_ssize_t _convert_ucs4_to_utf8( Py_UCS4 ch, + unsigned char *targetStart, unsigned char *targetEnd, + int strict, PyObject *ch_obj, /* for error messages: the string where ch comes from */ - Py_ssize_t ch_obj_end, /* effective length of ch_obj (error reporting) */ - unsigned char *targetStart, unsigned char *targetEnd, - int strict) + Py_ssize_t ch_obj_end /* effective length of ch_obj (error reporting) */ + ) { const Py_UCS4 byteMask = 0xBF; const Py_UCS4 byteMark = 0x80; @@ -222,7 +223,7 @@ return NULL; /* Replace the combination PyUniode_New/PyUnicode_WriteChar */ - bytes_written = _convert_ucs4_to_utf8(c, s, end+1, buf, &(buf[6]), 1); + bytes_written = _convert_ucs4_to_utf8(c, buf, &(buf[6]), 1, s, end+1); if (bytes_written < 0) { return NULL; }