Skip to content

Commit 2cc6de7

Browse files
authored
gh-132983: Remove pyzstd in identifiers (#133535)
1 parent 9fcebb3 commit 2cc6de7

File tree

3 files changed

+14
-27
lines changed

3 files changed

+14
-27
lines changed

Modules/_zstd/_zstdmodule.h

-13
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,6 @@ set_parameter_error(const _zstd_state* const state, int is_compress,
172172

173173
static const char init_twice_msg[] = "__init__ method is called twice.";
174174

175-
extern int
176-
_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict);
177-
178-
extern int
179-
_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict);
180-
181-
extern int
182-
_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
183-
const char *arg_name, const char *arg_type);
184-
185-
extern int
186-
_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options);
187-
188175
extern PyObject *
189176
decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
190177
Py_ssize_t max_length,

Modules/_zstd/compressor.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class _zstd.ZstdCompressor "ZstdCompressor *" "clinic_state()->ZstdCompressor_ty
2525

2626
#define ZstdCompressor_CAST(op) ((ZstdCompressor *)op)
2727

28-
int
29-
_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
30-
const char *arg_name, const char* arg_type)
28+
static int
29+
_zstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
30+
const char *arg_name, const char* arg_type)
3131
{
3232
size_t zstd_ret;
3333
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
@@ -197,8 +197,8 @@ _get_CDict(ZstdDict *self, int compressionLevel)
197197
return cdict;
198198
}
199199

200-
int
201-
_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
200+
static int
201+
_zstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
202202

203203
size_t zstd_ret;
204204
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
@@ -385,20 +385,20 @@ _zstd_ZstdCompressor___init___impl(ZstdCompressor *self, PyObject *level,
385385

386386
/* Set compressLevel/options to compression context */
387387
if (level != Py_None) {
388-
if (_PyZstd_set_c_parameters(self, level, "level", "int") < 0) {
388+
if (_zstd_set_c_parameters(self, level, "level", "int") < 0) {
389389
return -1;
390390
}
391391
}
392392

393393
if (options != Py_None) {
394-
if (_PyZstd_set_c_parameters(self, options, "options", "dict") < 0) {
394+
if (_zstd_set_c_parameters(self, options, "options", "dict") < 0) {
395395
return -1;
396396
}
397397
}
398398

399399
/* Load dictionary to compression context */
400400
if (zstd_dict != Py_None) {
401-
if (_PyZstd_load_c_dict(self, zstd_dict) < 0) {
401+
if (_zstd_load_c_dict(self, zstd_dict) < 0) {
402402
return -1;
403403
}
404404

Modules/_zstd/decompressor.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ _get_DDict(ZstdDict *self)
6161
}
6262

6363
/* Set decompression parameters to decompression context */
64-
int
65-
_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
64+
static int
65+
_zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
6666
{
6767
size_t zstd_ret;
6868
PyObject *key, *value;
@@ -120,8 +120,8 @@ _PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
120120
}
121121

122122
/* Load dictionary or prefix to decompression context */
123-
int
124-
_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
123+
static int
124+
_zstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
125125
{
126126
size_t zstd_ret;
127127
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
@@ -709,7 +709,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,
709709

710710
/* Load dictionary to decompression context */
711711
if (zstd_dict != Py_None) {
712-
if (_PyZstd_load_d_dict(self, zstd_dict) < 0) {
712+
if (_zstd_load_d_dict(self, zstd_dict) < 0) {
713713
return -1;
714714
}
715715

@@ -720,7 +720,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,
720720

721721
/* Set option to decompression context */
722722
if (options != Py_None) {
723-
if (_PyZstd_set_d_parameters(self, options) < 0) {
723+
if (_zstd_set_d_parameters(self, options) < 0) {
724724
return -1;
725725
}
726726
}

0 commit comments

Comments
 (0)