FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-132983: Remove pyzstd in identifiers by Rogdham · Pull Request #133535 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (2) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
13 changes: 0 additions & 13 deletions Modules/_zstd/_zstdmodule.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

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 *
decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
Py_ssize_t max_length,
Expand Down
16 changes: 8 additions & 8 deletions Modules/_zstd/compressor.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class _zstd.ZstdCompressor "ZstdCompressor *" "clinic_state()->ZstdCompressor_ty

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

int
_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
const char *arg_name, const char* arg_type)
static int
_zstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
const char *arg_name, const char* arg_type)
{
size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
Expand Down Expand Up @@ -197,8 +197,8 @@ _get_CDict(ZstdDict *self, int compressionLevel)
return cdict;
}

int
_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
static int
_zstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {

size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
Expand Down Expand Up @@ -385,20 +385,20 @@ _zstd_ZstdCompressor___init___impl(ZstdCompressor *self, PyObject *level,

/* Set compressLevel/options to compression context */
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;
}
}

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;
}
}

/* Load dictionary to compression context */
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;
}

Expand Down
12 changes: 6 additions & 6 deletions Modules/_zstd/decompressor.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ _get_DDict(ZstdDict *self)
}

/* Set decompression parameters to decompression context */
int
_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
static int
_zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
{
size_t zstd_ret;
PyObject *key, *value;
Expand Down Expand Up @@ -120,8 +120,8 @@ _PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
}

/* Load dictionary or prefix to decompression context */
int
_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
static int
_zstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
{
size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
Expand Down Expand Up @@ -709,7 +709,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,

/* Load dictionary to decompression context */
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;
}

Expand All @@ -720,7 +720,7 @@ _zstd_ZstdDecompressor___init___impl(ZstdDecompressor *self,

/* Set option to decompression context */
if (options != Py_None) {
if (_PyZstd_set_d_parameters(self, options) < 0) {
if (_zstd_set_d_parameters(self, options) < 0) {
return -1;
}
}
Expand Down

Back | FazBrowse Home | New Git URL