Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2df58d5c
Commit
2df58d5c
authored
Jul 08, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ANSI-fy the sources.
parent
23231ab0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
Modules/operator.c
Modules/operator.c
+16
-19
No files found.
Modules/operator.c
View file @
2df58d5c
...
...
@@ -69,42 +69,42 @@ used for special class methods; variants without leading and trailing\n\
#include "Python.h"
#define spam1(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spam1(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1; \
if(! PyArg_ParseTuple(a,"O",&a1)) return NULL; \
return AOP(a1); }
#define spam2(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spam2(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1, *a2; \
if(! PyArg_ParseTuple(a,"OO",&a1,&a2)) return NULL; \
return AOP(a1,a2); }
#define spamoi(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spamoi(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1; int a2; \
if(! PyArg_ParseTuple(a,"Oi",&a1,&a2)) return NULL; \
return AOP(a1,a2); }
#define spam2n(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spam2n(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1, *a2; \
if(! PyArg_ParseTuple(a,"OO",&a1,&a2)) return NULL; \
if(-1 == AOP(a1,a2)) return NULL; \
Py_INCREF(Py_None); \
return Py_None; }
#define spam3n(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spam3n(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1, *a2, *a3; \
if(! PyArg_ParseTuple(a,"OOO",&a1,&a2,&a3)) return NULL; \
if(-1 == AOP(a1,a2,a3)) return NULL; \
Py_INCREF(Py_None); \
return Py_None; }
#define spami(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spami(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1; long r; \
if(! PyArg_ParseTuple(a,"O",&a1)) return NULL; \
if(-1 == (r=AOP(a1))) return NULL; \
return PyInt_FromLong(r); }
#define spami2(OP,AOP) static PyObject *OP(
s,a) PyObject *s, *a;
{ \
#define spami2(OP,AOP) static PyObject *OP(
PyObject *s, PyObject *a)
{ \
PyObject *a1, *a2; long r; \
if(! PyArg_ParseTuple(a,"OO",&a1,&a2)) return NULL; \
if(-1 == (r=AOP(a1,a2))) return NULL; \
...
...
@@ -140,8 +140,7 @@ spam2n(op_delitem , PyObject_DelItem)
spam3n
(
op_setitem
,
PyObject_SetItem
)
static
PyObject
*
op_getslice
(
s
,
a
)
PyObject
*
s
,
*
a
;
op_getslice
(
PyObject
*
s
,
PyObject
*
a
)
{
PyObject
*
a1
;
int
a2
,
a3
;
...
...
@@ -152,8 +151,7 @@ op_getslice(s,a)
}
static
PyObject
*
op_setslice
(
s
,
a
)
PyObject
*
s
,
*
a
;
op_setslice
(
PyObject
*
s
,
PyObject
*
a
)
{
PyObject
*
a1
,
*
a4
;
int
a2
,
a3
;
...
...
@@ -169,8 +167,7 @@ op_setslice(s,a)
}
static
PyObject
*
op_delslice
(
s
,
a
)
PyObject
*
s
,
*
a
;
op_delslice
(
PyObject
*
s
,
PyObject
*
a
)
{
PyObject
*
a1
;
int
a2
,
a3
;
...
...
@@ -188,13 +185,13 @@ op_delslice(s,a)
#undef spam1
#undef spam2
#ifdef HAVE_OLD_CPP
#define spam1(OP,DOC) {"OP", OP,
1
, DOC},
#define spam2(OP,ALTOP,DOC) {"OP", op_
/**/
OP,
1
, DOC}, \
{"ALTOP", op_
/**/
OP,
1
, DOC},
#define spam1(OP,DOC) {"OP", OP,
METH_VARARGS
, DOC},
#define spam2(OP,ALTOP,DOC) {"OP", op_
/**/
OP,
METH_VARARGS
, DOC}, \
{"ALTOP", op_
/**/
OP,
METH_VARARGS
, DOC},
#else
#define spam1(OP,DOC) {#OP, OP,
1
, DOC},
#define spam2(OP,ALTOP,DOC) {#OP, op_##OP,
1
, DOC}, \
{#ALTOP, op_##OP,
1
, DOC},
#define spam1(OP,DOC) {#OP, OP,
METH_VARARGS
, DOC},
#define spam2(OP,ALTOP,DOC) {#OP, op_##OP,
METH_VARARGS
, DOC}, \
{#ALTOP, op_##OP,
METH_VARARGS
, DOC},
#endif
static
struct
PyMethodDef
operator_methods
[]
=
{
...
...
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