Skip to content

Commit 9fa57c5

Browse files
committed
gh-139353: Rename formatter_unicode.c to unicode_formatter.c
* Move Python/formatter_unicode.c to Objects/unicode_formatter.c. * Move Objects/stringlib/localeutil.h content into unicode_formatter.c. Remove localeutil.h. * Move _PyUnicode_InsertThousandsGrouping() to unicode_formatter.c and mark the function as static. * Rename unicode_fill() to _PyUnicode_Fill() and export it in pycore_unicodeobject.h.
1 parent 25edfa7 commit 9fa57c5

File tree

9 files changed

+263
-267
lines changed

9 files changed

+263
-267
lines changed

Include/internal/pycore_unicodeobject.h

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ extern "C" {
1111
#include "pycore_fileutils.h" // _Py_error_handler
1212
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
1313

14+
15+
extern void _PyUnicode_Fill(
16+
int kind,
17+
void *data,
18+
Py_UCS4 value,
19+
Py_ssize_t start,
20+
Py_ssize_t length);
21+
1422
/* --- Characters Type APIs ----------------------------------------------- */
1523

1624
extern int _PyUnicode_IsXidStart(Py_UCS4 ch);
@@ -240,21 +248,6 @@ extern PyObject* _PyUnicode_XStrip(
240248
);
241249

242250

243-
/* Using explicit passed-in values, insert the thousands grouping
244-
into the string pointed to by buffer. For the argument descriptions,
245-
see Objects/stringlib/localeutil.h */
246-
extern Py_ssize_t _PyUnicode_InsertThousandsGrouping(
247-
_PyUnicodeWriter *writer,
248-
Py_ssize_t n_buffer,
249-
PyObject *digits,
250-
Py_ssize_t d_pos,
251-
Py_ssize_t n_digits,
252-
Py_ssize_t min_width,
253-
const char *grouping,
254-
PyObject *thousands_sep,
255-
Py_UCS4 *maxchar,
256-
int forward);
257-
258251
/* Dedent a string.
259252
Behaviour is expected to be an exact match of `textwrap.dedent`.
260253
Return a new reference on success, NULL with exception set on error.

Makefile.pre.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ PYTHON_OBJS= \
501501
Python/pystrtod.o \
502502
Python/pystrhex.o \
503503
Python/dtoa.o \
504-
Python/formatter_unicode.o \
505504
Python/fileutils.o \
506505
Python/suggestions.o \
507506
Python/perf_trampoline.o \
@@ -558,6 +557,7 @@ OBJECT_OBJS= \
558557
Objects/tupleobject.o \
559558
Objects/typeobject.o \
560559
Objects/typevarobject.o \
560+
Objects/unicode_formatter.o \
561561
Objects/unicodeobject.o \
562562
Objects/unicodectype.o \
563563
Objects/unionobject.o \
@@ -2090,7 +2090,6 @@ UNICODE_DEPS = \
20902090
$(srcdir)/Objects/stringlib/fastsearch.h \
20912091
$(srcdir)/Objects/stringlib/find.h \
20922092
$(srcdir)/Objects/stringlib/find_max_char.h \
2093-
$(srcdir)/Objects/stringlib/localeutil.h \
20942093
$(srcdir)/Objects/stringlib/partition.h \
20952094
$(srcdir)/Objects/stringlib/replace.h \
20962095
$(srcdir)/Objects/stringlib/repr.h \

Objects/stringlib/localeutil.h

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)