|
33 | 33 | #define TYPE_STOPITER 'S' |
34 | 34 | #define TYPE_ELLIPSIS '.' |
35 | 35 | #define TYPE_INT 'i' |
36 | | -/* TYPE_INT64 is deprecated. It is not |
37 | | - generated anymore, and support for reading it |
38 | | - will be removed in Python 3.4. */ |
39 | | -#define TYPE_INT64 'I' |
40 | 36 | #define TYPE_FLOAT 'f' |
41 | 37 | #define TYPE_BINARY_FLOAT 'g' |
42 | 38 | #define TYPE_COMPLEX 'x' |
@@ -638,42 +634,6 @@ r_long(RFILE *p) |
638 | 634 | return x; |
639 | 635 | } |
640 | 636 |
|
641 | | -/* r_long64 deals with the TYPE_INT64 code. On a machine with |
642 | | - sizeof(long) > 4, it returns a Python int object, else a Python long |
643 | | - object. Note that w_long64 writes out TYPE_INT if 32 bits is enough, |
644 | | - so there's no inefficiency here in returning a PyLong on 32-bit boxes |
645 | | - for everything written via TYPE_INT64 (i.e., if an int is written via |
646 | | - TYPE_INT64, it *needs* more than 32 bits). |
647 | | -*/ |
648 | | -static PyObject * |
649 | | -r_long64(RFILE *p) |
650 | | -{ |
651 | | - PyObject *result = NULL; |
652 | | - long lo4 = r_long(p); |
653 | | - long hi4 = r_long(p); |
654 | | - |
655 | | - if (!PyErr_Occurred()) { |
656 | | -#if SIZEOF_LONG > 4 |
657 | | - long x = (hi4 << 32) | (lo4 & 0xFFFFFFFFL); |
658 | | - result = PyLong_FromLong(x); |
659 | | -#else |
660 | | - unsigned char buf[8]; |
661 | | - int one = 1; |
662 | | - int is_little_endian = (int)*(char*)&one; |
663 | | - if (is_little_endian) { |
664 | | - memcpy(buf, &lo4, 4); |
665 | | - memcpy(buf+4, &hi4, 4); |
666 | | - } |
667 | | - else { |
668 | | - memcpy(buf, &hi4, 4); |
669 | | - memcpy(buf+4, &lo4, 4); |
670 | | - } |
671 | | - result = _PyLong_FromByteArray(buf, 8, is_little_endian, 1); |
672 | | -#endif |
673 | | - } |
674 | | - return result; |
675 | | -} |
676 | | - |
677 | 637 | static PyObject * |
678 | 638 | r_PyLong(RFILE *p) |
679 | 639 | { |
@@ -871,11 +831,6 @@ r_object(RFILE *p) |
871 | 831 | R_REF(retval); |
872 | 832 | break; |
873 | 833 |
|
874 | | - case TYPE_INT64: |
875 | | - retval = r_long64(p); |
876 | | - R_REF(retval); |
877 | | - break; |
878 | | - |
879 | 834 | case TYPE_LONG: |
880 | 835 | retval = r_PyLong(p); |
881 | 836 | R_REF(retval); |
@@ -1201,7 +1156,7 @@ r_object(RFILE *p) |
1201 | 1156 | PyObject *name = NULL; |
1202 | 1157 | int firstlineno; |
1203 | 1158 | PyObject *lnotab = NULL; |
1204 | | - |
| 1159 | + |
1205 | 1160 | idx = r_ref_reserve(flag, p); |
1206 | 1161 | if (idx < 0) { |
1207 | 1162 | retval = NULL; |
|
0 commit comments