Skip to content

Commit 2032014

Browse files
Fix warnings
1 parent ddb734d commit 2032014

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
# Minor revision
2424
PKG_VERSION += ("2",)
2525
PKG_VERSION_STR = ".".join([str(x) for x in PKG_VERSION])
26-
26+
f = open("./version","r" )
27+
PKG_VERSION_STR = f.read()
28+
f.close()
2729

2830
def which(bin_exe):
2931
"""
@@ -60,7 +62,7 @@ def which(bin_exe):
6062
SUP_WARNINGS="ZSTD_WARNINGS" in os.environ
6163
if SUP_WARNINGS:
6264
if os.environ["ZSTD_WARNINGS"]=='0':
63-
SUP_WARNINS=False
65+
SUP_WARNINGS=False
6466
else:
6567
SUP_WARNINGS=True
6668
if "--all-warnings" in sys.argv:
@@ -119,6 +121,7 @@ def which(bin_exe):
119121
# Support tracing for debug
120122
SUP_TRACE=True
121123
sys.argv.remove("--debug-trace")
124+
122125
BUILD_SPEED0="ZSTD_SPEED0" in os.environ
123126
if "--speed0" in sys.argv:
124127
# speed or size choose only one
@@ -455,9 +458,7 @@ def which(bin_exe):
455458
if comp == 'msvc':
456459
COPT[comp].extend(['/Wall',])
457460
else:
458-
COPT[comp].extend(['-Wall', '-Wextra',
459-
#'-Wpedantic'
460-
])
461+
COPT[comp].extend(['-Wall', '-Wextra', '-Wpedantic'])
461462

462463
if SUP_WERROR:
463464
for comp in COPT:

src/python-zstd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ static PyObject *py_zstd_compress_mt2(PyObject* self, PyObject *args)
202202
static int32_t lastLevel =0;
203203
int32_t threads = 0;
204204
int32_t strict = 0;
205-
ZSTD_CCtx* cctx = NULL;
206205

207206
#if PY_MAJOR_VERSION >= 3
208207
if (!PyArg_ParseTuple(args, "y#|iii", &source, &source_size, &level, &threads, &strict))

src/python-zstd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ static PyObject *ZstdError;
9494

9595
static ZSTD_CCtx* m_cctx;
9696

97+
void free_cContext();
98+
void reset_cContext(int32_t threads, int32_t level);
99+
void init_cContext( int32_t threads, int32_t level);
100+
97101
static PyObject *py_zstd_compress_mt(PyObject* self, PyObject *args);
98102
static PyObject *py_zstd_compress_mt2(PyObject* self, PyObject *args);
99103
static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args);

0 commit comments

Comments
 (0)