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
96d743ec
Commit
96d743ec
authored
Mar 03, 2005
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #1115086: support PY_LONGLONG in structmember.
parent
7e78ade6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
Include/structmember.h
Include/structmember.h
+4
-0
Misc/NEWS
Misc/NEWS
+2
-0
Python/structmember.c
Python/structmember.c
+32
-0
No files found.
Include/structmember.h
View file @
96d743ec
...
...
@@ -65,6 +65,10 @@ typedef struct PyMemberDef {
#define T_OBJECT_EX 16
/* Like T_OBJECT, but raises AttributeError
when the value is NULL, instead of
converting to None. */
#ifdef HAVE_LONG_LONG
#define T_LONGLONG 17
#define T_ULONGLONG 18
#endif
/* HAVE_LONG_LONG */
/* Flags */
#define READONLY 1
...
...
Misc/NEWS
View file @
96d743ec
...
...
@@ -10,6 +10,8 @@ What's New in Python 2.5 alpha 1?
Core and builtins
-----------------
- Patch #1115086: Support PY_LONGLONG in structmember.
- Bug #1155938: new style classes did not check that __init__() was
returning None.
...
...
Python/structmember.c
View file @
96d743ec
...
...
@@ -118,6 +118,14 @@ PyMember_GetOne(char *addr, PyMemberDef *l)
PyErr_SetString
(
PyExc_AttributeError
,
l
->
name
);
Py_XINCREF
(
v
);
break
;
#ifdef HAVE_LONG_LONG
case
T_LONGLONG
:
v
=
PyLong_FromLongLong
(
*
(
PY_LONG_LONG
*
)
addr
);
break
;
case
T_ULONGLONG
:
v
=
PyLong_FromUnsignedLongLong
(
*
(
unsigned
PY_LONG_LONG
*
)
addr
);
break
;
#endif
/* HAVE_LONG_LONG */
default:
PyErr_SetString
(
PyExc_SystemError
,
"bad memberdescr type"
);
v
=
NULL
;
...
...
@@ -246,6 +254,30 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
return
-
1
;
}
break
;
#ifdef HAVE_LONG_LONG
case
T_LONGLONG
:
if
(
!
PyLong_Check
(
v
))
{
PyErr_BadArgument
();
return
-
1
;
}
else
{
*
(
PY_LONG_LONG
*
)
addr
=
PyLong_AsLongLong
(
v
);
if
((
*
addr
==
-
1
)
&&
PyErr_Occurred
())
{
return
-
1
;
}
}
break
;
case
T_ULONGLONG
:
if
(
!
PyLong_Check
(
v
))
{
PyErr_BadArgument
();
return
-
1
;
}
else
{
*
(
unsigned
PY_LONG_LONG
*
)
addr
=
PyLong_AsUnsignedLongLong
(
v
);
if
((
*
addr
==
-
1
)
&&
PyErr_Occurred
())
{
return
-
1
;
}
}
break
;
#endif
/* HAVE_LONG_LONG */
default:
PyErr_Format
(
PyExc_SystemError
,
"bad memberdescr type for %s"
,
l
->
name
);
...
...
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