mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.14] gh-132983: Remove pyzstd in identifiers (GH-133535) (#133629)
This commit is contained in:
parent
e8c279f394
commit
c6a56e3d91
3 changed files with 14 additions and 27 deletions
|
@ -172,19 +172,6 @@ set_parameter_error(const _zstd_state* const state, int is_compress,
|
||||||
|
|
||||||
static const char init_twice_msg[] = "__init__ method is called twice.";
|
static const char init_twice_msg[] = "__init__ method is called twice.";
|
||||||
|
|
||||||
extern int
|
|
||||||
_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict);
|
|
||||||
|
|
||||||
extern int
|
|
||||||
_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict);
|
|
||||||
|
|
||||||
extern int
|
|
||||||
_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
|
|
||||||
const char *arg_name, const char *arg_type);
|
|
||||||
|
|
||||||
extern int
|
|
||||||
_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options);
|
|
||||||
|
|
||||||
extern PyObject *
|
extern PyObject *
|
||||||
decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
|
decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
|
||||||
Py_ssize_t max_length,
|
Py_ssize_t max_length,
|
||||||
|
|
|
@ -25,8 +25,8 @@ class _zstd.ZstdCompressor "ZstdCompressor *" "clinic_state()->ZstdCompressor_ty
|
||||||
|
|
||||||
#define ZstdCompressor_CAST(op) ((ZstdCompressor *)op)
|
#define ZstdCompressor_CAST(op) ((ZstdCompressor *)op)
|
||||||
|
|
||||||
int
|
static int
|
||||||
_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
|
_zstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
|
||||||
const char *arg_name, const char* arg_type)
|
const char *arg_name, const char* arg_type)
|
||||||
{
|
{
|
||||||
size_t zstd_ret;
|
size_t zstd_ret;
|
||||||
|
@ -197,8 +197,8 @@ success:
|
||||||
return cdict;
|
return cdict;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
|
_zstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
|
||||||
|
|
||||||
size_t zstd_ret;
|
size_t zstd_ret;
|
||||||
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
|
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
|
||||||
|
@ -385,20 +385,20 @@ _zstd_ZstdCompressor___init___impl(ZstdCompressor *self, PyObject *level,
|
||||||
|
|
||||||
/* Set compressLevel/options to compression context */
|
/* Set compressLevel/options to compression context */
|
||||||
if (level != Py_None) {
|
if (level != Py_None) {
|
||||||
if (_PyZstd_set_c_parameters(self, level, "level", "int") < 0) {
|
if (_zstd_set_c_parameters(self, level, "level", "int") < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options != Py_None) {
|
if (options != Py_None) {
|
||||||
if (_PyZstd_set_c_parameters(self, options, "options", "dict") < 0) {
|
if (_zstd_set_c_parameters(self, options, "options", "dict") < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load dictionary to compression context */
|
/* Load dictionary to compression context */
|
||||||
if (zstd_dict != Py_None) {
|
if (zstd_dict != Py_None) {
|
||||||
if (_PyZstd_load_c_dict(self, zstd_dict) < 0) {
|
if (_zstd_load_c_dict(self, zstd_dict) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ _get_DDict(ZstdDict *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set decompression parameters to decompression context */
|
/* Set decompression parameters to decompression context */
|
||||||
int
|
static int
|
||||||
_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
|
_zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
|
||||||
{
|
{
|
||||||
size_t zstd_ret;
|
size_t zstd_ret;
|
||||||
PyObject *key, *value;
|
PyObject *key, *value;
|
||||||
|
@ -120,8 +120,8 @@ _PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load dictionary or prefix to decompression context */
|
/* Load dictionary or prefix to decompression context */
|
||||||
int
|
static int
|
||||||
_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
|
_zstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
|
||||||
{
|
{
|
||||||
size_t zstd_ret;
|
size_t zstd_ret;
|
||||||
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
|
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
|
||||||
|
@ -709,7 +709,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,
|
||||||
|
|
||||||
/* Load dictionary to decompression context */
|
/* Load dictionary to decompression context */
|
||||||
if (zstd_dict != Py_None) {
|
if (zstd_dict != Py_None) {
|
||||||
if (_PyZstd_load_d_dict(self, zstd_dict) < 0) {
|
if (_zstd_load_d_dict(self, zstd_dict) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,
|
||||||
|
|
||||||
/* Set option to decompression context */
|
/* Set option to decompression context */
|
||||||
if (options != Py_None) {
|
if (options != Py_None) {
|
||||||
if (_PyZstd_set_d_parameters(self, options) < 0) {
|
if (_zstd_set_d_parameters(self, options) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue