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
9ce10ad7
Commit
9ce10ad7
authored
Oct 23, 2013
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19356: Avoid using a C variabled named "_self", it's a reserved word in some C compilers.
parent
7fbbced5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
50 deletions
+53
-50
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes.c
+40
-40
Modules/_ctypes/callbacks.c
Modules/_ctypes/callbacks.c
+6
-6
Modules/_elementtree.c
Modules/_elementtree.c
+2
-2
Modules/_io/textio.c
Modules/_io/textio.c
+2
-2
No files found.
Misc/NEWS
View file @
9ce10ad7
...
...
@@ -568,6 +568,9 @@ Tools/Demos
Build
-----
-
Issue
#
19356
:
Avoid
using
a
C
variabled
named
"_self"
,
it
's a reserved
word in some C compilers.
- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
- Issue #16067: Add description into MSI file to replace installer'
s
temporary
name
.
...
...
Modules/_ctypes/_ctypes.c
View file @
9ce10ad7
...
...
@@ -143,18 +143,18 @@ typedef struct {
}
DictRemoverObject
;
static
void
_DictRemover_dealloc
(
PyObject
*
_
self
)
_DictRemover_dealloc
(
PyObject
*
my
self
)
{
DictRemoverObject
*
self
=
(
DictRemoverObject
*
)
_
self
;
DictRemoverObject
*
self
=
(
DictRemoverObject
*
)
my
self
;
Py_XDECREF
(
self
->
key
);
Py_XDECREF
(
self
->
dict
);
Py_TYPE
(
self
)
->
tp_free
(
_
self
);
Py_TYPE
(
self
)
->
tp_free
(
my
self
);
}
static
PyObject
*
_DictRemover_call
(
PyObject
*
_
self
,
PyObject
*
args
,
PyObject
*
kw
)
_DictRemover_call
(
PyObject
*
my
self
,
PyObject
*
args
,
PyObject
*
kw
)
{
DictRemoverObject
*
self
=
(
DictRemoverObject
*
)
_
self
;
DictRemoverObject
*
self
=
(
DictRemoverObject
*
)
my
self
;
if
(
self
->
key
&&
self
->
dict
)
{
if
(
-
1
==
PyDict_DelItem
(
self
->
dict
,
self
->
key
))
/* XXX Error context */
...
...
@@ -2471,17 +2471,17 @@ static PyMemberDef PyCData_members[] = {
{
NULL
},
};
static
int
PyCData_NewGetBuffer
(
PyObject
*
_
self
,
Py_buffer
*
view
,
int
flags
)
static
int
PyCData_NewGetBuffer
(
PyObject
*
my
self
,
Py_buffer
*
view
,
int
flags
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
StgDictObject
*
dict
=
PyObject_stgdict
(
_
self
);
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
StgDictObject
*
dict
=
PyObject_stgdict
(
my
self
);
Py_ssize_t
i
;
if
(
view
==
NULL
)
return
0
;
view
->
buf
=
self
->
b_ptr
;
view
->
obj
=
_
self
;
Py_INCREF
(
_
self
);
view
->
obj
=
my
self
;
Py_INCREF
(
my
self
);
view
->
len
=
self
->
b_size
;
view
->
readonly
=
0
;
/* use default format character if not set */
...
...
@@ -2516,36 +2516,36 @@ PyCData_nohash(PyObject *self)
}
static
PyObject
*
PyCData_reduce
(
PyObject
*
_
self
,
PyObject
*
args
)
PyCData_reduce
(
PyObject
*
my
self
,
PyObject
*
args
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
if
(
PyObject_stgdict
(
_
self
)
->
flags
&
(
TYPEFLAG_ISPOINTER
|
TYPEFLAG_HASPOINTER
))
{
if
(
PyObject_stgdict
(
my
self
)
->
flags
&
(
TYPEFLAG_ISPOINTER
|
TYPEFLAG_HASPOINTER
))
{
PyErr_SetString
(
PyExc_ValueError
,
"ctypes objects containing pointers cannot be pickled"
);
return
NULL
;
}
return
Py_BuildValue
(
"O(O(NN))"
,
_unpickle
,
Py_TYPE
(
_
self
),
PyObject_GetAttrString
(
_
self
,
"__dict__"
),
Py_TYPE
(
my
self
),
PyObject_GetAttrString
(
my
self
,
"__dict__"
),
PyBytes_FromStringAndSize
(
self
->
b_ptr
,
self
->
b_size
));
}
static
PyObject
*
PyCData_setstate
(
PyObject
*
_
self
,
PyObject
*
args
)
PyCData_setstate
(
PyObject
*
my
self
,
PyObject
*
args
)
{
void
*
data
;
Py_ssize_t
len
;
int
res
;
PyObject
*
dict
,
*
mydict
;
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
if
(
!
PyArg_ParseTuple
(
args
,
"Os#"
,
&
dict
,
&
data
,
&
len
))
return
NULL
;
if
(
len
>
self
->
b_size
)
len
=
self
->
b_size
;
memmove
(
self
->
b_ptr
,
data
,
len
);
mydict
=
PyObject_GetAttrString
(
_
self
,
"__dict__"
);
mydict
=
PyObject_GetAttrString
(
my
self
,
"__dict__"
);
res
=
PyDict_Update
(
mydict
,
dict
);
Py_DECREF
(
mydict
);
if
(
res
==
-
1
)
...
...
@@ -4183,9 +4183,9 @@ Array_init(CDataObject *self, PyObject *args, PyObject *kw)
}
static
PyObject
*
Array_item
(
PyObject
*
_
self
,
Py_ssize_t
index
)
Array_item
(
PyObject
*
my
self
,
Py_ssize_t
index
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
Py_ssize_t
offset
,
size
;
StgDictObject
*
stgdict
;
...
...
@@ -4209,9 +4209,9 @@ Array_item(PyObject *_self, Py_ssize_t index)
}
static
PyObject
*
Array_subscript
(
PyObject
*
_
self
,
PyObject
*
item
)
Array_subscript
(
PyObject
*
my
self
,
PyObject
*
item
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
if
(
PyIndex_Check
(
item
))
{
Py_ssize_t
i
=
PyNumber_AsSsize_t
(
item
,
PyExc_IndexError
);
...
...
@@ -4220,7 +4220,7 @@ Array_subscript(PyObject *_self, PyObject *item)
return
NULL
;
if
(
i
<
0
)
i
+=
self
->
b_length
;
return
Array_item
(
_
self
,
i
);
return
Array_item
(
my
self
,
i
);
}
else
if
PySlice_Check
(
item
)
{
StgDictObject
*
stgdict
,
*
itemdict
;
...
...
@@ -4297,7 +4297,7 @@ Array_subscript(PyObject *_self, PyObject *item)
for
(
cur
=
start
,
i
=
0
;
i
<
slicelen
;
cur
+=
step
,
i
++
)
{
PyObject
*
v
=
Array_item
(
_
self
,
cur
);
PyObject
*
v
=
Array_item
(
my
self
,
cur
);
PyList_SET_ITEM
(
np
,
i
,
v
);
}
return
np
;
...
...
@@ -4311,9 +4311,9 @@ Array_subscript(PyObject *_self, PyObject *item)
}
static
int
Array_ass_item
(
PyObject
*
_
self
,
Py_ssize_t
index
,
PyObject
*
value
)
Array_ass_item
(
PyObject
*
my
self
,
Py_ssize_t
index
,
PyObject
*
value
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
Py_ssize_t
size
,
offset
;
StgDictObject
*
stgdict
;
char
*
ptr
;
...
...
@@ -4340,9 +4340,9 @@ Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
}
static
int
Array_ass_subscript
(
PyObject
*
_
self
,
PyObject
*
item
,
PyObject
*
value
)
Array_ass_subscript
(
PyObject
*
my
self
,
PyObject
*
item
,
PyObject
*
value
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
if
(
value
==
NULL
)
{
PyErr_SetString
(
PyExc_TypeError
,
...
...
@@ -4357,7 +4357,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
return
-
1
;
if
(
i
<
0
)
i
+=
self
->
b_length
;
return
Array_ass_item
(
_
self
,
i
,
value
);
return
Array_ass_item
(
my
self
,
i
,
value
);
}
else
if
(
PySlice_Check
(
item
))
{
Py_ssize_t
start
,
stop
,
step
,
slicelen
,
otherlen
,
i
,
cur
;
...
...
@@ -4382,7 +4382,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
int
result
;
if
(
item
==
NULL
)
return
-
1
;
result
=
Array_ass_item
(
_
self
,
cur
,
item
);
result
=
Array_ass_item
(
my
self
,
cur
,
item
);
Py_DECREF
(
item
);
if
(
result
==
-
1
)
return
-
1
;
...
...
@@ -4397,9 +4397,9 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
}
static
Py_ssize_t
Array_length
(
PyObject
*
_
self
)
Array_length
(
PyObject
*
my
self
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
return
self
->
b_length
;
}
...
...
@@ -4685,9 +4685,9 @@ static PyTypeObject Simple_Type = {
PyCPointer_Type
*/
static
PyObject
*
Pointer_item
(
PyObject
*
_
self
,
Py_ssize_t
index
)
Pointer_item
(
PyObject
*
my
self
,
Py_ssize_t
index
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
Py_ssize_t
size
;
Py_ssize_t
offset
;
StgDictObject
*
stgdict
,
*
itemdict
;
...
...
@@ -4716,9 +4716,9 @@ Pointer_item(PyObject *_self, Py_ssize_t index)
}
static
int
Pointer_ass_item
(
PyObject
*
_
self
,
Py_ssize_t
index
,
PyObject
*
value
)
Pointer_ass_item
(
PyObject
*
my
self
,
Py_ssize_t
index
,
PyObject
*
value
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
Py_ssize_t
size
;
Py_ssize_t
offset
;
StgDictObject
*
stgdict
,
*
itemdict
;
...
...
@@ -4848,14 +4848,14 @@ Pointer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
static
PyObject
*
Pointer_subscript
(
PyObject
*
_
self
,
PyObject
*
item
)
Pointer_subscript
(
PyObject
*
my
self
,
PyObject
*
item
)
{
CDataObject
*
self
=
(
CDataObject
*
)
_
self
;
CDataObject
*
self
=
(
CDataObject
*
)
my
self
;
if
(
PyIndex_Check
(
item
))
{
Py_ssize_t
i
=
PyNumber_AsSsize_t
(
item
,
PyExc_IndexError
);
if
(
i
==
-
1
&&
PyErr_Occurred
())
return
NULL
;
return
Pointer_item
(
_
self
,
i
);
return
Pointer_item
(
my
self
,
i
);
}
else
if
(
PySlice_Check
(
item
))
{
PySliceObject
*
slice
=
(
PySliceObject
*
)
item
;
...
...
@@ -4968,7 +4968,7 @@ Pointer_subscript(PyObject *_self, PyObject *item)
return
NULL
;
for
(
cur
=
start
,
i
=
0
;
i
<
len
;
cur
+=
step
,
i
++
)
{
PyObject
*
v
=
Pointer_item
(
_
self
,
cur
);
PyObject
*
v
=
Pointer_item
(
my
self
,
cur
);
PyList_SET_ITEM
(
np
,
i
,
v
);
}
return
np
;
...
...
Modules/_ctypes/callbacks.c
View file @
9ce10ad7
...
...
@@ -10,9 +10,9 @@
/**************************************************************/
static
void
CThunkObject_dealloc
(
PyObject
*
_
self
)
CThunkObject_dealloc
(
PyObject
*
my
self
)
{
CThunkObject
*
self
=
(
CThunkObject
*
)
_
self
;
CThunkObject
*
self
=
(
CThunkObject
*
)
my
self
;
PyObject_GC_UnTrack
(
self
);
Py_XDECREF
(
self
->
converters
);
Py_XDECREF
(
self
->
callable
);
...
...
@@ -23,9 +23,9 @@ CThunkObject_dealloc(PyObject *_self)
}
static
int
CThunkObject_traverse
(
PyObject
*
_
self
,
visitproc
visit
,
void
*
arg
)
CThunkObject_traverse
(
PyObject
*
my
self
,
visitproc
visit
,
void
*
arg
)
{
CThunkObject
*
self
=
(
CThunkObject
*
)
_
self
;
CThunkObject
*
self
=
(
CThunkObject
*
)
my
self
;
Py_VISIT
(
self
->
converters
);
Py_VISIT
(
self
->
callable
);
Py_VISIT
(
self
->
restype
);
...
...
@@ -33,9 +33,9 @@ CThunkObject_traverse(PyObject *_self, visitproc visit, void *arg)
}
static
int
CThunkObject_clear
(
PyObject
*
_
self
)
CThunkObject_clear
(
PyObject
*
my
self
)
{
CThunkObject
*
self
=
(
CThunkObject
*
)
_
self
;
CThunkObject
*
self
=
(
CThunkObject
*
)
my
self
;
Py_CLEAR
(
self
->
converters
);
Py_CLEAR
(
self
->
callable
);
Py_CLEAR
(
self
->
restype
);
...
...
Modules/_elementtree.c
View file @
9ce10ad7
...
...
@@ -809,9 +809,9 @@ element_deepcopy(ElementObject* self, PyObject* args)
}
static
PyObject
*
element_sizeof
(
PyObject
*
_
self
,
PyObject
*
args
)
element_sizeof
(
PyObject
*
my
self
,
PyObject
*
args
)
{
ElementObject
*
self
=
(
ElementObject
*
)
_
self
;
ElementObject
*
self
=
(
ElementObject
*
)
my
self
;
Py_ssize_t
result
=
sizeof
(
ElementObject
);
if
(
self
->
extra
)
{
result
+=
sizeof
(
ElementObjectExtra
);
...
...
Modules/_io/textio.c
View file @
9ce10ad7
...
...
@@ -282,12 +282,12 @@ check_decoded(PyObject *decoded)
#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF)
PyObject
*
_PyIncrementalNewlineDecoder_decode
(
PyObject
*
_
self
,
_PyIncrementalNewlineDecoder_decode
(
PyObject
*
my
self
,
PyObject
*
input
,
int
final
)
{
PyObject
*
output
;
Py_ssize_t
output_len
;
nldecoder_object
*
self
=
(
nldecoder_object
*
)
_
self
;
nldecoder_object
*
self
=
(
nldecoder_object
*
)
my
self
;
if
(
self
->
decoder
==
NULL
)
{
PyErr_SetString
(
PyExc_ValueError
,
...
...
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