File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ extern "C" {
10
10
pub static mut PyByteArrayIter_Type : PyTypeObject ;
11
11
}
12
12
13
+ #[ repr( C ) ]
14
+ pub struct PyByteArraybject {
15
+ pub ob_base : PyVarObject ,
16
+ pub ob_alloc : Py_ssize_t ,
17
+ pub ob_bytes : * mut c_char ,
18
+ pub ob_start : * mut c_char ,
19
+ pub ob_exports : Py_ssize_t ,
20
+ }
21
+
13
22
#[ inline]
14
23
pub unsafe fn PyByteArray_Check ( op : * mut PyObject ) -> c_int {
15
24
PyObject_TypeCheck ( op, & mut PyByteArray_Type )
Original file line number Diff line number Diff line change 1
1
use crate :: ffi:: object:: * ;
2
- use crate :: ffi:: pyport:: Py_ssize_t ;
2
+ use crate :: ffi:: pyport:: { Py_hash_t , Py_ssize_t } ;
3
3
use std:: os:: raw:: { c_char, c_int} ;
4
4
5
5
#[ cfg_attr( windows, link( name = "pythonXY" ) ) ]
@@ -9,6 +9,13 @@ extern "C" {
9
9
pub static mut PyBytesIter_Type : PyTypeObject ;
10
10
}
11
11
12
+ #[ repr( C ) ]
13
+ pub struct PyBytesObject {
14
+ pub ob_base : PyVarObject ,
15
+ pub ob_shash : Py_hash_t ,
16
+ pub ob_sval : [ c_char ; 1 ] ,
17
+ }
18
+
12
19
#[ inline]
13
20
pub unsafe fn PyBytes_Check ( op : * mut PyObject ) -> c_int {
14
21
PyType_FastSubclass ( Py_TYPE ( op) , Py_TPFLAGS_BYTES_SUBCLASS )
Original file line number Diff line number Diff line change @@ -31,13 +31,6 @@ pub struct PyCodeObject {
31
31
pub co_extra : * mut c_void ,
32
32
}
33
33
34
- impl Default for PyCodeObject {
35
- #[ inline]
36
- fn default ( ) -> Self {
37
- unsafe { :: std:: mem:: zeroed ( ) }
38
- }
39
- }
40
-
41
34
/* Masks for co_flags */
42
35
pub const CO_OPTIMIZED : c_int = 0x0001 ;
43
36
pub const CO_NEWLOCALS : c_int = 0x0002 ;
You can’t perform that action at this time.
0 commit comments