summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/formatter.h
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-06-24 00:42:10 (GMT)
committerEric Smith <eric@trueblade.com>2008-06-24 00:42:10 (GMT)
commit65fe47b9319e20cebf02d34f8abdbcda96d2fa22 (patch)
tree73451eac7ff36a4516fdb7130ef03ee8eafe97da /Objects/stringlib/formatter.h
parent57acc8f5ab751f0831a28a149c4fe44ca0beaf57 (diff)
downloadcpython-65fe47b9319e20cebf02d34f8abdbcda96d2fa22.zip
cpython-65fe47b9319e20cebf02d34f8abdbcda96d2fa22.tar.gz
cpython-65fe47b9319e20cebf02d34f8abdbcda96d2fa22.tar.bz2
Modified interface to _Py_[String|Unicode]InsertThousandsGrouping, in anticipation of fixing issue 3140.
Diffstat (limited to 'Objects/stringlib/formatter.h')
-rw-r--r--Objects/stringlib/formatter.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h
index 2bb2ed2..12e2931 100644
--- a/Objects/stringlib/formatter.h
+++ b/Objects/stringlib/formatter.h
@@ -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);