Merged revisions 64491 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r64491 | eric.smith | 2008-06-23 20:42:10 -0400 (Mon, 23 Jun 2008) | 1 line

  Modified interface to _Py_[String|Unicode]InsertThousandsGrouping, in anticipation of fixing issue 3140.
........
This commit is contained in:
Eric Smith 2008-06-24 01:06:47 +00:00
parent 7d84055e25
commit 6d7e7a730e
5 changed files with 33 additions and 26 deletions

View file

@ -563,8 +563,7 @@ format_int_or_long_internal(PyObject *value, const InternalFormatSpec *format,
if (format->type == 'n')
/* Compute how many additional chars we need to allocate
to hold the thousands grouping. */
STRINGLIB_GROUPING(pnumeric_chars, n_digits,
pnumeric_chars+n_digits,
STRINGLIB_GROUPING(NULL, n_digits, n_digits,
0, &n_grouping_chars, 0);
/* Allocate a new string to hold the result */
@ -592,8 +591,7 @@ format_int_or_long_internal(PyObject *value, const InternalFormatSpec *format,
/* We know this can't fail, since we've already
reserved enough space. */
STRINGLIB_CHAR *pstart = p + n_leading_chars;
int r = STRINGLIB_GROUPING(pstart, n_digits,
pstart + n_digits,
int r = STRINGLIB_GROUPING(pstart, n_digits, n_digits,
spec.n_total+n_grouping_chars-n_leading_chars,
NULL, 0);
assert(r);