Mercurial > cpython-lru_cache-weakref
diff Objects/stringlib/formatter.h @ 47815:752e1abaf15a legacy-trunk
Modified interface to _Py_[String|Unicode]InsertThousandsGrouping, in anticipation of fixing issue 3140.
| author | Eric Smith <eric@trueblade.com> |
|---|---|
| date | Tue, 24 Jun 2008 00:42:10 +0000 |
| parents | 47ef9a806ce9 |
| children | c83eef078fd9 |
line wrap: on
line diff
--- a/Objects/stringlib/formatter.h Mon Jun 23 19:51:41 2008 +0000 +++ b/Objects/stringlib/formatter.h Tue Jun 24 00:42:10 2008 +0000 @@ -563,8 +563,7 @@ 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 @@ /* 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);
