mirror of
https://github.com/python/cpython.git
synced 2026-03-22 12:40:54 +00:00
bpo-32011: Revert "Issue GH-15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (GH-4381) (#4405)
Simplify the reverted code. This reverts commite9bbe8b87b. (cherry picked from commit00987f6230)
This commit is contained in:
parent
3864248866
commit
d15bb5fcad
3 changed files with 46 additions and 0 deletions
|
|
@ -32,6 +32,9 @@
|
|||
#define TYPE_STOPITER 'S'
|
||||
#define TYPE_ELLIPSIS '.'
|
||||
#define TYPE_INT 'i'
|
||||
/* TYPE_INT64 is not generated anymore.
|
||||
Supported for backward compatibility only. */
|
||||
#define TYPE_INT64 'I'
|
||||
#define TYPE_FLOAT 'f'
|
||||
#define TYPE_BINARY_FLOAT 'g'
|
||||
#define TYPE_COMPLEX 'x'
|
||||
|
|
@ -777,6 +780,19 @@ r_long(RFILE *p)
|
|||
return x;
|
||||
}
|
||||
|
||||
/* r_long64 deals with the TYPE_INT64 code. */
|
||||
static PyObject *
|
||||
r_long64(RFILE *p)
|
||||
{
|
||||
const unsigned char *buffer = (const unsigned char *) r_string(8, p);
|
||||
if (buffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return _PyLong_FromByteArray(buffer, 8,
|
||||
1 /* little endian */,
|
||||
1 /* signed */);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
r_PyLong(RFILE *p)
|
||||
{
|
||||
|
|
@ -976,6 +992,11 @@ r_object(RFILE *p)
|
|||
R_REF(retval);
|
||||
break;
|
||||
|
||||
case TYPE_INT64:
|
||||
retval = r_long64(p);
|
||||
R_REF(retval);
|
||||
break;
|
||||
|
||||
case TYPE_LONG:
|
||||
retval = r_PyLong(p);
|
||||
R_REF(retval);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue