Skip to content

Commit 0f78bff

Browse files
committed
Issue #5748: bytesobject.c should not have its own private defines for stringlib macros. Also removed unused defines and include for localutil.h.
1 parent 7d0bddd commit 0f78bff

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

Objects/bytesobject.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,29 +563,15 @@ PyBytes_AsStringAndSize(register PyObject *obj,
563563
/* Methods */
564564

565565
#include "stringlib/stringdefs.h"
566-
#define STRINGLIB_CHAR char
567-
568-
#define STRINGLIB_CMP memcmp
569-
#define STRINGLIB_LEN PyBytes_GET_SIZE
570-
#define STRINGLIB_NEW PyBytes_FromStringAndSize
571-
#define STRINGLIB_STR PyBytes_AS_STRING
572-
/* #define STRINGLIB_WANT_CONTAINS_OBJ 1 */
573-
574-
#define STRINGLIB_EMPTY nullstring
575-
#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
576-
#define STRINGLIB_MUTABLE 0
577566

578567
#include "stringlib/fastsearch.h"
579-
580568
#include "stringlib/count.h"
581569
#include "stringlib/find.h"
582570
#include "stringlib/partition.h"
583571
#include "stringlib/ctype.h"
584-
#include "stringlib/transmogrify.h"
585572

586-
#define _Py_InsertThousandsGrouping _PyBytes_InsertThousandsGrouping
587-
#define _Py_InsertThousandsGroupingLocale _PyBytes_InsertThousandsGroupingLocale
588-
#include "stringlib/localeutil.h"
573+
#define STRINGLIB_MUTABLE 0
574+
#include "stringlib/transmogrify.h"
589575

590576
PyObject *
591577
PyBytes_Repr(PyObject *obj, int smartquotes)

Objects/stringlib/stringdefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define STRINGLIB_NEW PyBytes_FromStringAndSize
2222
#define STRINGLIB_RESIZE _PyBytes_Resize
2323
#define STRINGLIB_CHECK PyBytes_Check
24+
#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
2425
#define STRINGLIB_CMP memcmp
2526
#define STRINGLIB_TOSTR PyObject_Str
2627
#define STRINGLIB_GROUPING _PyBytes_InsertThousandsGrouping

Objects/stringlib/unicodedefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define STRINGLIB_NEW PyUnicode_FromUnicode
2222
#define STRINGLIB_RESIZE PyUnicode_Resize
2323
#define STRINGLIB_CHECK PyUnicode_Check
24+
#define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
2425
#define STRINGLIB_GROUPING _PyUnicode_InsertThousandsGrouping
2526
#define STRINGLIB_GROUPING_LOCALE _PyUnicode_InsertThousandsGroupingLocale
2627

0 commit comments

Comments
 (0)