Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
c79ae55a
Commit
c79ae55a
authored
May 15, 2021
by
Max Bachmann
Committed by
GitHub
May 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence C compiler warnings about unused variables in a universal way (GH-4162)
parent
afda509f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
137 additions
and
66 deletions
+137
-66
Cython/Utility/AsyncGen.c
Cython/Utility/AsyncGen.c
+10
-5
Cython/Utility/Buffer.c
Cython/Utility/Buffer.c
+4
-2
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+33
-15
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+43
-21
Cython/Utility/Exceptions.c
Cython/Utility/Exceptions.c
+10
-5
Cython/Utility/ImportExport.c
Cython/Utility/ImportExport.c
+2
-1
Cython/Utility/MemoryView_C.c
Cython/Utility/MemoryView_C.c
+2
-1
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+12
-6
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+7
-2
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+9
-5
Cython/Utility/StringTools.c
Cython/Utility/StringTools.c
+5
-3
No files found.
Cython/Utility/AsyncGen.c
View file @
c79ae55a
...
...
@@ -264,7 +264,8 @@ __Pyx_async_gen_anext(PyObject *g)
}
static
PyObject
*
__Pyx_async_gen_anext_method
(
PyObject
*
g
,
CYTHON_UNUSED
PyObject
*
arg
)
{
__Pyx_async_gen_anext_method
(
PyObject
*
g
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
return
__Pyx_async_gen_anext
(
g
);
}
...
...
@@ -280,8 +281,9 @@ __Pyx_async_gen_asend(__pyx_PyAsyncGenObject *o, PyObject *arg)
static
PyObject
*
__Pyx_async_gen_aclose
(
__pyx_PyAsyncGenObject
*
o
,
CYTHON_UNUSED
PyObject
*
arg
)
__Pyx_async_gen_aclose
(
__pyx_PyAsyncGenObject
*
o
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
if
(
unlikely
(
__Pyx_async_gen_init_hooks
(
o
)))
{
return
NULL
;
}
...
...
@@ -300,7 +302,8 @@ __Pyx_async_gen_athrow(__pyx_PyAsyncGenObject *o, PyObject *args)
static
PyObject
*
__Pyx_async_gen_self_method
(
PyObject
*
g
,
CYTHON_UNUSED
PyObject
*
arg
)
{
__Pyx_async_gen_self_method
(
PyObject
*
g
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
return
__Pyx_NewRef
(
g
);
}
...
...
@@ -586,9 +589,10 @@ __Pyx_async_gen_asend_throw(__pyx_PyAsyncGenASend *o, PyObject *args)
static
PyObject
*
__Pyx_async_gen_asend_close
(
PyObject
*
g
,
CYTHON_UNUSED
PyObject
*
args
)
__Pyx_async_gen_asend_close
(
PyObject
*
g
,
PyObject
*
args
)
{
__pyx_PyAsyncGenASend
*
o
=
(
__pyx_PyAsyncGenASend
*
)
g
;
CYTHON_UNUSED_VAR
(
args
);
o
->
ags_state
=
__PYX_AWAITABLE_STATE_CLOSED
;
Py_RETURN_NONE
;
}
...
...
@@ -1021,9 +1025,10 @@ __Pyx_async_gen_athrow_iternext(__pyx_PyAsyncGenAThrow *o)
static
PyObject
*
__Pyx_async_gen_athrow_close
(
PyObject
*
g
,
CYTHON_UNUSED
PyObject
*
args
)
__Pyx_async_gen_athrow_close
(
PyObject
*
g
,
PyObject
*
args
)
{
__pyx_PyAsyncGenAThrow
*
o
=
(
__pyx_PyAsyncGenAThrow
*
)
g
;
CYTHON_UNUSED_VAR
(
args
);
o
->
agt_state
=
__PYX_AWAITABLE_STATE_CLOSED
;
Py_RETURN_NONE
;
}
...
...
Cython/Utility/Buffer.c
View file @
c79ae55a
...
...
@@ -377,7 +377,8 @@ typedef struct { char c; void *x; } __Pyx_st_void_p;
typedef
struct
{
char
c
;
PY_LONG_LONG
x
;
}
__Pyx_st_longlong
;
#endif
static
size_t
__Pyx_BufFmt_TypeCharToAlignment
(
char
ch
,
CYTHON_UNUSED
int
is_complex
)
{
static
size_t
__Pyx_BufFmt_TypeCharToAlignment
(
char
ch
,
int
is_complex
)
{
CYTHON_UNUSED_VAR
(
is_complex
);
switch
(
ch
)
{
case
'?'
:
case
'c'
:
case
'b'
:
case
'B'
:
case
's'
:
case
'p'
:
return
1
;
case
'h'
:
case
'H'
:
return
sizeof
(
__Pyx_st_short
)
-
sizeof
(
short
);
...
...
@@ -411,7 +412,8 @@ typedef struct { void *x; char c; } __Pyx_pad_void_p;
typedef
struct
{
PY_LONG_LONG
x
;
char
c
;
}
__Pyx_pad_longlong
;
#endif
static
size_t
__Pyx_BufFmt_TypeCharToPadding
(
char
ch
,
CYTHON_UNUSED
int
is_complex
)
{
static
size_t
__Pyx_BufFmt_TypeCharToPadding
(
char
ch
,
int
is_complex
)
{
CYTHON_UNUSED_VAR
(
is_complex
);
switch
(
ch
)
{
case
'?'
:
case
'c'
:
case
'b'
:
case
'B'
:
case
's'
:
case
'p'
:
return
1
;
case
'h'
:
case
'H'
:
return
sizeof
(
__Pyx_pad_short
)
-
sizeof
(
short
);
...
...
Cython/Utility/Coroutine.c
View file @
c79ae55a
...
...
@@ -330,12 +330,13 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /*proto*/
//////////////////// pep479 ////////////////////
//@requires: Exceptions.c::GetException
static
void
__Pyx_Generator_Replace_StopIteration
(
CYTHON_UNUSED
int
in_async_gen
)
{
static
void
__Pyx_Generator_Replace_StopIteration
(
int
in_async_gen
)
{
PyObject
*
exc
,
*
val
,
*
tb
,
*
cur_exc
;
__Pyx_PyThreadState_declare
#ifdef __Pyx_StopAsyncIteration_USED
int
is_async_stopiteration
=
0
;
#endif
CYTHON_MAYBE_UNUSED_VAR
(
in_async_gen
);
cur_exc
=
PyErr_Occurred
();
if
(
likely
(
!
__Pyx_PyErr_GivenExceptionMatches
(
cur_exc
,
PyExc_StopIteration
)))
{
...
...
@@ -507,9 +508,10 @@ static int __pyx_Generator_init(void); /*proto*/
// Returns 0 if no exception or StopIteration is set.
// If any other exception is set, returns -1 and leaves
// pvalue unchanged.
static
int
__Pyx_PyGen__FetchStopIterationValue
(
CYTHON_UNUSED
PyThreadState
*
$
local_tstate_cname
,
PyObject
**
pvalue
)
{
static
int
__Pyx_PyGen__FetchStopIterationValue
(
PyThreadState
*
$
local_tstate_cname
,
PyObject
**
pvalue
)
{
PyObject
*
et
,
*
ev
,
*
tb
;
PyObject
*
value
=
NULL
;
CYTHON_UNUSED_VAR
(
$
local_tstate_cname
);
__Pyx_ErrFetch
(
&
et
,
&
ev
,
&
tb
);
...
...
@@ -614,8 +616,9 @@ void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
}
#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static
void
__Pyx__Coroutine_AlreadyRunningError
(
CYTHON_UNUSED
__pyx_CoroutineObject
*
gen
)
{
static
void
__Pyx__Coroutine_AlreadyRunningError
(
__pyx_CoroutineObject
*
gen
)
{
const
char
*
msg
;
CYTHON_MAYBE_UNUSED_VAR
(
gen
);
if
((
0
))
{
#ifdef __Pyx_Coroutine_USED
}
else
if
(
__Pyx_Coroutine_Check
((
PyObject
*
)
gen
))
{
...
...
@@ -632,8 +635,9 @@ static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineOb
}
#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static
void
__Pyx__Coroutine_NotStartedError
(
CYTHON_UNUSED
PyObject
*
gen
)
{
static
void
__Pyx__Coroutine_NotStartedError
(
PyObject
*
gen
)
{
const
char
*
msg
;
CYTHON_MAYBE_UNUSED_VAR
(
gen
);
if
((
0
))
{
#ifdef __Pyx_Coroutine_USED
}
else
if
(
__Pyx_Coroutine_Check
(
gen
))
{
...
...
@@ -650,7 +654,9 @@ static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static
void
__Pyx__Coroutine_AlreadyTerminatedError
(
CYTHON_UNUSED
PyObject
*
gen
,
PyObject
*
value
,
CYTHON_UNUSED
int
closing
)
{
static
void
__Pyx__Coroutine_AlreadyTerminatedError
(
PyObject
*
gen
,
PyObject
*
value
,
int
closing
)
{
CYTHON_MAYBE_UNUSED_VAR
(
gen
);
CYTHON_MAYBE_UNUSED_VAR
(
closing
);
#ifdef __Pyx_Coroutine_USED
if
(
!
closing
&&
__Pyx_Coroutine_Check
(
gen
))
{
// `self` is an exhausted coroutine: raise an error,
...
...
@@ -780,7 +786,8 @@ static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStr
}
static
CYTHON_INLINE
PyObject
*
__Pyx_Coroutine_MethodReturn
(
CYTHON_UNUSED
PyObject
*
gen
,
PyObject
*
retval
)
{
PyObject
*
__Pyx_Coroutine_MethodReturn
(
PyObject
*
gen
,
PyObject
*
retval
)
{
CYTHON_MAYBE_UNUSED_VAR
(
gen
);
if
(
unlikely
(
!
retval
))
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
...
...
@@ -984,7 +991,8 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
return
__Pyx_Coroutine_SendEx
(
gen
,
Py_None
,
0
);
}
static
PyObject
*
__Pyx_Coroutine_Close_Method
(
PyObject
*
self
,
CYTHON_UNUSED
PyObject
*
arg
)
{
static
PyObject
*
__Pyx_Coroutine_Close_Method
(
PyObject
*
self
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
return
__Pyx_Coroutine_Close
(
self
);
}
...
...
@@ -1315,9 +1323,10 @@ static void __Pyx_Coroutine_del(PyObject *self) {
}
static
PyObject
*
__Pyx_Coroutine_get_name
(
__pyx_CoroutineObject
*
self
,
CYTHON_UNUSED
void
*
context
)
__Pyx_Coroutine_get_name
(
__pyx_CoroutineObject
*
self
,
void
*
context
)
{
PyObject
*
name
=
self
->
gi_name
;
CYTHON_UNUSED_VAR
(
context
);
// avoid NULL pointer dereference during garbage collection
if
(
unlikely
(
!
name
))
name
=
Py_None
;
Py_INCREF
(
name
);
...
...
@@ -1325,8 +1334,9 @@ __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *contex
}
static
int
__Pyx_Coroutine_set_name
(
__pyx_CoroutineObject
*
self
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_Coroutine_set_name
(
__pyx_CoroutineObject
*
self
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
#if PY_MAJOR_VERSION >= 3
if
(
unlikely
(
value
==
NULL
||
!
PyUnicode_Check
(
value
)))
#else
...
...
@@ -1343,9 +1353,10 @@ __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UN
}
static
PyObject
*
__Pyx_Coroutine_get_qualname
(
__pyx_CoroutineObject
*
self
,
CYTHON_UNUSED
void
*
context
)
__Pyx_Coroutine_get_qualname
(
__pyx_CoroutineObject
*
self
,
void
*
context
)
{
PyObject
*
name
=
self
->
gi_qualname
;
CYTHON_UNUSED_VAR
(
context
);
// avoid NULL pointer dereference during garbage collection
if
(
unlikely
(
!
name
))
name
=
Py_None
;
Py_INCREF
(
name
);
...
...
@@ -1353,8 +1364,9 @@ __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *co
}
static
int
__Pyx_Coroutine_set_qualname
(
__pyx_CoroutineObject
*
self
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_Coroutine_set_qualname
(
__pyx_CoroutineObject
*
self
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
#if PY_MAJOR_VERSION >= 3
if
(
unlikely
(
value
==
NULL
||
!
PyUnicode_Check
(
value
)))
#else
...
...
@@ -1371,9 +1383,10 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHO
}
static
PyObject
*
__Pyx_Coroutine_get_frame
(
__pyx_CoroutineObject
*
self
,
CYTHON_UNUSED
void
*
context
)
__Pyx_Coroutine_get_frame
(
__pyx_CoroutineObject
*
self
,
void
*
context
)
{
PyObject
*
frame
=
self
->
gi_frame
;
CYTHON_UNUSED_VAR
(
context
);
if
(
!
frame
)
{
if
(
unlikely
(
!
self
->
gi_code
))
{
// Avoid doing something stupid, e.g. during garbage collection.
...
...
@@ -1468,7 +1481,8 @@ static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, Py
return
__Pyx_Coroutine_Throw
(
self
->
coroutine
,
args
);
}
static
PyObject
*
__Pyx_CoroutineAwait_Close
(
__pyx_CoroutineAwaitObject
*
self
,
CYTHON_UNUSED
PyObject
*
arg
)
{
static
PyObject
*
__Pyx_CoroutineAwait_Close
(
__pyx_CoroutineAwaitObject
*
self
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
return
__Pyx_Coroutine_Close
(
self
->
coroutine
);
}
...
...
@@ -1478,7 +1492,10 @@ static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
}
#if !CYTHON_COMPILING_IN_PYPY
static
PyObject
*
__Pyx_CoroutineAwait_no_new
(
CYTHON_UNUSED
PyTypeObject
*
type
,
CYTHON_UNUSED
PyObject
*
args
,
CYTHON_UNUSED
PyObject
*
kwargs
)
{
static
PyObject
*
__Pyx_CoroutineAwait_no_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
CYTHON_UNUSED_VAR
(
type
);
CYTHON_UNUSED_VAR
(
args
);
CYTHON_UNUSED_VAR
(
kwargs
);
PyErr_SetString
(
PyExc_TypeError
,
"cannot instantiate type, use 'await coroutine' instead"
);
return
NULL
;
}
...
...
@@ -1572,7 +1589,8 @@ static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
#endif
#if PY_VERSION_HEX < 0x030500B1
static
PyObject
*
__Pyx_Coroutine_await_method
(
PyObject
*
coroutine
,
CYTHON_UNUSED
PyObject
*
arg
)
{
static
PyObject
*
__Pyx_Coroutine_await_method
(
PyObject
*
coroutine
,
PyObject
*
arg
)
{
CYTHON_UNUSED_VAR
(
arg
);
return
__Pyx__Coroutine_await
(
coroutine
);
}
#endif
...
...
Cython/Utility/CythonFunction.c
View file @
c79ae55a
...
...
@@ -101,8 +101,9 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
#include <structmember.h>
static
PyObject
*
__Pyx_CyFunction_get_doc
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
closure
)
__Pyx_CyFunction_get_doc
(
__pyx_CyFunctionObject
*
op
,
void
*
closure
)
{
CYTHON_UNUSED_VAR
(
closure
);
if
(
unlikely
(
op
->
func_doc
==
NULL
))
{
if
(
op
->
func
.
m_ml
->
ml_doc
)
{
#if PY_MAJOR_VERSION >= 3
...
...
@@ -122,8 +123,9 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure
}
static
int
__Pyx_CyFunction_set_doc
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_set_doc
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
value
==
NULL
)
{
// Mark as deleted
value
=
Py_None
;
...
...
@@ -134,8 +136,9 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNU
}
static
PyObject
*
__Pyx_CyFunction_get_name
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_name
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
op
->
func_name
==
NULL
))
{
#if PY_MAJOR_VERSION >= 3
op
->
func_name
=
PyUnicode_InternFromString
(
op
->
func
.
m_ml
->
ml_name
);
...
...
@@ -150,8 +153,9 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *contex
}
static
int
__Pyx_CyFunction_set_name
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_set_name
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
#if PY_MAJOR_VERSION >= 3
if
(
unlikely
(
value
==
NULL
||
!
PyUnicode_Check
(
value
)))
#else
...
...
@@ -168,15 +172,17 @@ __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UN
}
static
PyObject
*
__Pyx_CyFunction_get_qualname
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_qualname
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
Py_INCREF
(
op
->
func_qualname
);
return
op
->
func_qualname
;
}
static
int
__Pyx_CyFunction_set_qualname
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_set_qualname
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
#if PY_MAJOR_VERSION >= 3
if
(
unlikely
(
value
==
NULL
||
!
PyUnicode_Check
(
value
)))
#else
...
...
@@ -193,8 +199,9 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHO
}
static
PyObject
*
__Pyx_CyFunction_get_dict
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_dict
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
op
->
func_dict
==
NULL
))
{
op
->
func_dict
=
PyDict_New
();
if
(
unlikely
(
op
->
func_dict
==
NULL
))
...
...
@@ -205,8 +212,9 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *contex
}
static
int
__Pyx_CyFunction_set_dict
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_set_dict
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
value
==
NULL
))
{
PyErr_SetString
(
PyExc_TypeError
,
"function's dictionary may not be deleted"
);
...
...
@@ -223,23 +231,27 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UN
}
static
PyObject
*
__Pyx_CyFunction_get_globals
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_globals
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
Py_INCREF
(
op
->
func_globals
);
return
op
->
func_globals
;
}
static
PyObject
*
__Pyx_CyFunction_get_closure
(
CYTHON_UNUSED
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_closure
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
op
);
CYTHON_UNUSED_VAR
(
context
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
__Pyx_CyFunction_get_code
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
__Pyx_CyFunction_get_code
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
PyObject
*
result
=
(
op
->
func_code
)
?
op
->
func_code
:
Py_None
;
CYTHON_UNUSED_VAR
(
context
);
Py_INCREF
(
result
);
return
result
;
}
...
...
@@ -270,7 +282,8 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
}
static
int
__Pyx_CyFunction_set_defaults
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_set_defaults
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
!
value
)
{
// del => explicit None to prevent rebuilding
value
=
Py_None
;
...
...
@@ -285,8 +298,9 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHO
}
static
PyObject
*
__Pyx_CyFunction_get_defaults
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_get_defaults
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
PyObject
*
result
=
op
->
defaults_tuple
;
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
!
result
))
{
if
(
op
->
defaults_getter
)
{
if
(
unlikely
(
__Pyx_CyFunction_init_defaults
(
op
)
<
0
))
return
NULL
;
...
...
@@ -300,7 +314,8 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *co
}
static
int
__Pyx_CyFunction_set_kwdefaults
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_set_kwdefaults
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
!
value
)
{
// del => explicit None to prevent rebuilding
value
=
Py_None
;
...
...
@@ -315,8 +330,9 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYT
}
static
PyObject
*
__Pyx_CyFunction_get_kwdefaults
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_get_kwdefaults
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
PyObject
*
result
=
op
->
defaults_kwdict
;
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
!
result
))
{
if
(
op
->
defaults_getter
)
{
if
(
unlikely
(
__Pyx_CyFunction_init_defaults
(
op
)
<
0
))
return
NULL
;
...
...
@@ -330,7 +346,8 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *
}
static
int
__Pyx_CyFunction_set_annotations
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_set_annotations
(
__pyx_CyFunctionObject
*
op
,
PyObject
*
value
,
void
*
context
)
{
CYTHON_UNUSED_VAR
(
context
);
if
(
!
value
||
value
==
Py_None
)
{
value
=
NULL
;
}
else
if
(
unlikely
(
!
PyDict_Check
(
value
)))
{
...
...
@@ -344,8 +361,9 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CY
}
static
PyObject
*
__Pyx_CyFunction_get_annotations
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_get_annotations
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
PyObject
*
result
=
op
->
func_annotations
;
CYTHON_UNUSED_VAR
(
context
);
if
(
unlikely
(
!
result
))
{
result
=
PyDict_New
();
if
(
unlikely
(
!
result
))
return
NULL
;
...
...
@@ -356,8 +374,9 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void
}
static
PyObject
*
__Pyx_CyFunction_get_is_coroutine
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
context
)
{
__Pyx_CyFunction_get_is_coroutine
(
__pyx_CyFunctionObject
*
op
,
void
*
context
)
{
int
is_coroutine
;
CYTHON_UNUSED_VAR
(
context
);
if
(
op
->
func_is_coroutine
)
{
return
__Pyx_NewRef
(
op
->
func_is_coroutine
);
}
...
...
@@ -388,8 +407,9 @@ ignore:
//#if PY_VERSION_HEX >= 0x030400C1
//static PyObject *
//__Pyx_CyFunction_get_signature(__pyx_CyFunctionObject *op,
CYTHON_UNUSED
void *context) {
//__Pyx_CyFunction_get_signature(__pyx_CyFunctionObject *op, void *context) {
// PyObject *inspect_module, *signature_class, *signature;
// CYTHON_UNUSED_VAR(context);
// // from inspect import Signature
// inspect_module = PyImport_ImportModuleLevelObject(PYIDENT("inspect"), NULL, NULL, NULL, 0);
// if (unlikely(!inspect_module))
...
...
@@ -450,8 +470,9 @@ static PyMemberDef __pyx_CyFunction_members[] = {
};
static
PyObject
*
__Pyx_CyFunction_reduce
(
__pyx_CyFunctionObject
*
m
,
CYTHON_UNUSED
PyObject
*
args
)
__Pyx_CyFunction_reduce
(
__pyx_CyFunctionObject
*
m
,
PyObject
*
args
)
{
CYTHON_UNUSED_VAR
(
args
);
#if PY_MAJOR_VERSION >= 3
Py_INCREF
(
m
->
func_qualname
);
return
m
->
func_qualname
;
...
...
@@ -1348,9 +1369,10 @@ bad:
}
static
PyObject
*
__Pyx_FusedFunction_get_self
(
__pyx_FusedFunctionObject
*
m
,
CYTHON_UNUSED
void
*
closure
)
__Pyx_FusedFunction_get_self
(
__pyx_FusedFunctionObject
*
m
,
void
*
closure
)
{
PyObject
*
self
=
m
->
self
;
CYTHON_UNUSED_VAR
(
closure
);
if
(
unlikely
(
!
self
))
{
PyErr_SetString
(
PyExc_AttributeError
,
"'function' object has no attribute '__self__'"
);
}
else
{
...
...
Cython/Utility/Exceptions.c
View file @
c79ae55a
...
...
@@ -127,9 +127,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
// has changed quite a lot between the two versions.
#if PY_MAJOR_VERSION < 3
static
void
__Pyx_Raise
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
,
CYTHON_UNUSED
PyObject
*
cause
)
{
static
void
__Pyx_Raise
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
,
PyObject
*
cause
)
{
__Pyx_PyThreadState_declare
CYTHON_UNUSED_VAR
(
cause
);
/* 'cause' is only used in Py3 */
Py_XINCREF
(
type
);
if
(
!
value
||
value
==
Py_None
)
...
...
@@ -590,9 +590,9 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno,
//@requires: PyErrFetchRestore
//@requires: PyThreadStateGet
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
CYTHON_UNUSED
int
clineno
,
CYTHON_UNUSED
int
lineno
,
CYTHON_UNUSED
const
char
*
filename
,
int
full_traceback
,
CYTHON_UNUSED
int
nogil
)
{
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
int
clineno
,
int
lineno
,
const
char
*
filename
,
int
full_traceback
,
int
nogil
)
{
PyObject
*
old_exc
,
*
old_val
,
*
old_tb
;
PyObject
*
ctx
;
__Pyx_PyThreadState_declare
...
...
@@ -605,6 +605,11 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
else
state
=
(
PyGILState_STATE
)
-
1
;
#endif
#endif
CYTHON_UNUSED_VAR
(
clineno
);
CYTHON_UNUSED_VAR
(
lineno
);
CYTHON_UNUSED_VAR
(
filename
);
CYTHON_MAYBE_UNUSED_VAR
(
nogil
);
__Pyx_PyThreadState_assign
__Pyx_ErrFetch
(
&
old_exc
,
&
old_val
,
&
old_tb
);
if
(
full_traceback
)
{
...
...
Cython/Utility/ImportExport.c
View file @
c79ae55a
...
...
@@ -71,9 +71,10 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
}
#endif
static
PyObject
*
__Pyx__ImportDottedModule
(
PyObject
*
name
,
CYTHON_UNUSED
PyObject
*
parts_tuple
)
{
static
PyObject
*
__Pyx__ImportDottedModule
(
PyObject
*
name
,
PyObject
*
parts_tuple
)
{
#if PY_MAJOR_VERSION < 3
PyObject
*
module
,
*
from_list
,
*
star
=
PYIDENT
(
"*"
);
CYTHON_UNUSED_VAR
(
parts_tuple
);
from_list
=
PyList_New
(
1
);
if
(
unlikely
(
!
from_list
))
return
NULL
;
...
...
Cython/Utility/MemoryView_C.c
View file @
c79ae55a
...
...
@@ -230,8 +230,9 @@ fail:
}
static
int
__pyx_check_suboffsets
(
Py_buffer
*
buf
,
int
dim
,
CYTHON_UNUSED
int
ndim
,
int
spec
)
__pyx_check_suboffsets
(
Py_buffer
*
buf
,
int
dim
,
int
ndim
,
int
spec
)
{
CYTHON_UNUSED_VAR
(
ndim
);
// Todo: without PyBUF_INDIRECT we may not have suboffset information, i.e., the
// ptr may not be set to NULL but may be uninitialized?
if
(
spec
&
__Pyx_MEMVIEW_DIRECT
)
{
...
...
Cython/Utility/ModuleSetupCode.c
View file @
c79ae55a
...
...
@@ -335,14 +335,18 @@
# endif
#endif
#ifndef CYTHON_
MAYBE_
UNUSED_VAR
#ifndef CYTHON_UNUSED_VAR
# if defined(__cplusplus)
template
<
class
T
>
void
CYTHON_
MAYBE_
UNUSED_VAR
(
const
T
&
)
{
}
template
<
class
T
>
void
CYTHON_UNUSED_VAR
(
const
T
&
)
{
}
# else
# define CYTHON_
MAYBE_
UNUSED_VAR(x) (void)(x)
# define CYTHON_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
...
...
@@ -1217,8 +1221,9 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject
return
result
;
}
static
CYTHON_SMALL_CODE
PyObject
*
$
{
pymodule_create_func_cname
}(
PyObject
*
spec
,
CYTHON_UNUSED
PyModuleDef
*
def
)
{
static
CYTHON_SMALL_CODE
PyObject
*
$
{
pymodule_create_func_cname
}(
PyObject
*
spec
,
PyModuleDef
*
def
)
{
PyObject
*
module
=
NULL
,
*
moddict
,
*
modname
;
CYTHON_UNUSED_VAR
(
def
);
// For now, we only have exactly one module instance.
if
(
__Pyx_check_single_interpreter
())
...
...
@@ -1540,7 +1545,8 @@ static int __Pyx_RegisterCleanup(void); /*proto*/
//@substitute: naming
#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
static
PyObject
*
$
{
cleanup_cname
}
_atexit
(
PyObject
*
module
,
CYTHON_UNUSED
PyObject
*
unused
)
{
static
PyObject
*
$
{
cleanup_cname
}
_atexit
(
PyObject
*
module
,
PyObject
*
unused
)
{
CYTHON_UNUSED_VAR
(
unused
);
$
{
cleanup_cname
}(
module
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
...
...
@@ -1775,7 +1781,7 @@ static void __Pyx_FastGilFuncInit0(void) {
#else
static
void
__Pyx_FastGilFuncInit0
(
void
)
{
CYTHON_UNUSED
void
*
force_use
=
(
void
*
)
&
__Pyx_FetchCommonPointer
;
CYTHON_UNUSED
_VAR
(
&
__Pyx_FetchCommonPointer
)
;
}
#endif
...
...
Cython/Utility/ObjectHandling.c
View file @
c79ae55a
...
...
@@ -648,7 +648,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
{{
endif
}}
Py_ssize_t
cstart
,
Py_ssize_t
cstop
,
PyObject
**
_py_start
,
PyObject
**
_py_stop
,
PyObject
**
_py_slice
,
int
has_cstart
,
int
has_cstop
,
CYTHON_UNUSED
int
wraparound
)
{
int
has_cstart
,
int
has_cstop
,
int
wraparound
)
{
__Pyx_TypeName
obj_type_name
;
#if CYTHON_USE_TYPE_SLOTS
PyMappingMethods
*
mp
;
...
...
@@ -693,6 +693,8 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
return
ms
->
sq_ass_slice
(
obj
,
cstart
,
cstop
,
value
);
{{
endif
}}
}
#else
CYTHON_UNUSED_VAR
(
wraparound
);
#endif
mp
=
Py_TYPE
(
obj
)
->
tp_as_mapping
;
...
...
@@ -701,6 +703,8 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
{{
else
}}
if
(
likely
(
mp
&&
mp
->
mp_ass_subscript
))
{{
endif
}}
#else
CYTHON_UNUSED_VAR
(
wraparound
);
#endif
{
{{
if
access
==
'
Get
'
}}
PyObject
*
{{
else
}}
int
{{
endif
}}
result
;
...
...
@@ -2865,7 +2869,8 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN
#if PY_MAJOR_VERSION >= 3
// This should be an actual function (not a macro), such that we can put it
// directly in a tp_descr_get slot.
static
PyObject
*
__Pyx_PyMethod_New
(
PyObject
*
func
,
PyObject
*
self
,
CYTHON_UNUSED
PyObject
*
typ
)
{
static
PyObject
*
__Pyx_PyMethod_New
(
PyObject
*
func
,
PyObject
*
self
,
PyObject
*
typ
)
{
CYTHON_UNUSED_VAR
(
typ
);
if
(
!
self
)
return
__Pyx_NewRef
(
func
);
return
PyMethod_New
(
func
,
self
);
...
...
Cython/Utility/Optimize.c
View file @
c79ae55a
...
...
@@ -227,8 +227,9 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
/////////////// dict_setdefault ///////////////
static
CYTHON_INLINE
PyObject
*
__Pyx_PyDict_SetDefault
(
PyObject
*
d
,
PyObject
*
key
,
PyObject
*
default_value
,
CYTHON_UNUSED
int
is_safe_type
)
{
int
is_safe_type
)
{
PyObject
*
value
;
CYTHON_MAYBE_UNUSED_VAR
(
is_safe_type
);
#if PY_VERSION_HEX >= 0x030400A0
// we keep the method call at the end to avoid "unused" C compiler warnings
if
((
1
))
{
...
...
@@ -1037,7 +1038,9 @@ return_compare = (
)
}}
static
CYTHON_INLINE
{{
c_ret_type
}}
__Pyx_PyInt_
{{
''
if
ret_type
.
is_pyobject
else
'
Bool
'
}}{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
CYTHON_UNUSED
long
intval
,
CYTHON_UNUSED
long
inplace
)
{
static
CYTHON_INLINE
{{
c_ret_type
}}
__Pyx_PyInt_
{{
''
if
ret_type
.
is_pyobject
else
'
Bool
'
}}{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
long
intval
,
long
inplace
)
{
CYTHON_MAYBE_UNUSED_VAR
(
intval
);
CYTHON_UNUSED_VAR
(
inplace
);
if
(
op1
==
op2
)
{
{{
return_true
if
op
==
'
Eq
'
else
return_false
}};
}
...
...
@@ -1143,9 +1146,10 @@ def zerodiv_check(operand, optype='integer', _is_mod=op == 'Remainder', _needs_c
)
if
_needs_check
else
''
)
}}
static
{{
c_ret_type
}}
{{
cfunc_name
}}(
PyObject
*
op1
,
PyObject
*
op2
,
CYTHON_UNUSED
long
intval
,
int
inplace
,
int
zerodivision_check
)
{
// Prevent "unused" warnings.
(
void
)
inplace
;
(
void
)
zerodivision_check
;
static
{{
c_ret_type
}}
{{
cfunc_name
}}(
PyObject
*
op1
,
PyObject
*
op2
,
long
intval
,
int
inplace
,
int
zerodivision_check
)
{
CYTHON_MAYBE_UNUSED_VAR
(
intval
);
CYTHON_MAYBE_UNUSED_VAR
(
inplace
);
CYTHON_UNUSED_VAR
(
zerodivision_check
);
{{
if
op
in
(
'
Eq
'
,
'
Ne
'
)}}
if
(
op1
==
op2
)
{
...
...
Cython/Utility/StringTools.c
View file @
c79ae55a
...
...
@@ -889,12 +889,13 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co
//@substitute: naming
static
PyObject
*
__Pyx_PyUnicode_Join
(
PyObject
*
value_tuple
,
Py_ssize_t
value_count
,
Py_ssize_t
result_ulength
,
CYTHON_UNUSED
Py_UCS4
max_char
)
{
Py_UCS4
max_char
)
{
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject
*
result_uval
;
int
result_ukind
,
kind_shift
;
Py_ssize_t
i
,
char_pos
;
void
*
result_udata
;
CYTHON_MAYBE_UNUSED_VAR
(
max_char
);
#if CYTHON_PEP393_ENABLED
// Py 3.3+ (post PEP-393)
result_uval
=
PyUnicode_New
(
result_ulength
,
max_char
);
...
...
@@ -950,8 +951,9 @@ bad:
return
NULL
;
#else
// non-CPython fallback
result_ulength
++
;
value_count
++
;
CYTHON_UNUSED_VAR
(
max_char
);
CYTHON_UNUSED_VAR
(
result_ulength
);
CYTHON_UNUSED_VAR
(
value_count
);
return
PyUnicode_Join
(
$
empty_unicode
,
value_tuple
);
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment