mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886)
This commit is contained in:
parent
a82fbc13d0
commit
7861dfd26a
14 changed files with 533 additions and 26 deletions
|
@ -1000,9 +1000,10 @@ bp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
|
|||
(unsigned char *)p,
|
||||
8,
|
||||
0, /* little_endian */
|
||||
1 /* signed */);
|
||||
1, /* signed */
|
||||
0 /* !with_exceptions */);
|
||||
Py_DECREF(v);
|
||||
if (res == -1 && PyErr_Occurred()) {
|
||||
if (res < 0) {
|
||||
PyErr_Format(state->StructError,
|
||||
"'%c' format requires %lld <= number <= %lld",
|
||||
f->format,
|
||||
|
@ -1024,9 +1025,10 @@ bp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f
|
|||
(unsigned char *)p,
|
||||
8,
|
||||
0, /* little_endian */
|
||||
0 /* signed */);
|
||||
0, /* signed */
|
||||
0 /* !with_exceptions */);
|
||||
Py_DECREF(v);
|
||||
if (res == -1 && PyErr_Occurred()) {
|
||||
if (res < 0) {
|
||||
PyErr_Format(state->StructError,
|
||||
"'%c' format requires 0 <= number <= %llu",
|
||||
f->format,
|
||||
|
@ -1260,9 +1262,10 @@ lp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
|
|||
(unsigned char *)p,
|
||||
8,
|
||||
1, /* little_endian */
|
||||
1 /* signed */);
|
||||
1, /* signed */
|
||||
0 /* !with_exceptions */);
|
||||
Py_DECREF(v);
|
||||
if (res == -1 && PyErr_Occurred()) {
|
||||
if (res < 0) {
|
||||
PyErr_Format(state->StructError,
|
||||
"'%c' format requires %lld <= number <= %lld",
|
||||
f->format,
|
||||
|
@ -1284,9 +1287,10 @@ lp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f
|
|||
(unsigned char *)p,
|
||||
8,
|
||||
1, /* little_endian */
|
||||
0 /* signed */);
|
||||
0, /* signed */
|
||||
0 /* !with_exceptions */);
|
||||
Py_DECREF(v);
|
||||
if (res == -1 && PyErr_Occurred()) {
|
||||
if (res < 0) {
|
||||
PyErr_Format(state->StructError,
|
||||
"'%c' format requires 0 <= number <= %llu",
|
||||
f->format,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue