Skip to content

Commit 8af105f

Browse files
committed
Make mergeable
1 parent 14cf4e3 commit 8af105f

File tree

6 files changed

+11
-42
lines changed

6 files changed

+11
-42
lines changed

crates/vm/src/stdlib/ctypes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub(crate) mod pointer;
99
pub(crate) mod structure;
1010
pub(crate) mod thunk;
1111
pub(crate) mod union;
12-
pub(crate) mod util;
1312

1413
use crate::builtins::PyModule;
1514
use crate::class::PyClassImpl;

crates/vm/src/stdlib/ctypes/field.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::{Py, PyResult, VirtualMachine};
88
#[pyclass(name = "PyCFieldType", base = PyType, module = "_ctypes")]
99
#[derive(PyPayload, Debug)]
1010
pub struct PyCFieldType {
11+
#[allow(dead_code)]
1112
pub(super) inner: PyCField,
1213
}
1314

@@ -122,13 +123,3 @@ impl PyCField {
122123
self.bit_offset
123124
}
124125
}
125-
126-
#[inline(always)]
127-
pub const fn low_bit(offset: usize) -> usize {
128-
offset & 0xFFFF
129-
}
130-
131-
#[inline(always)]
132-
pub const fn high_bit(offset: usize) -> usize {
133-
offset >> 16
134-
}

crates/vm/src/stdlib/ctypes/function.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ impl ReturnType for PyNone {
102102
pub struct PyCFuncPtr {
103103
pub name: PyRwLock<Option<String>>,
104104
pub ptr: PyRwLock<Option<CodePtr>>,
105+
#[allow(dead_code)]
105106
pub needs_free: AtomicCell<bool>,
106107
pub arg_types: PyRwLock<Option<Vec<PyTypeRef>>>,
107108
pub res_type: PyRwLock<Option<PyObjectRef>>,
108109
pub _flags_: AtomicCell<i32>,
110+
#[allow(dead_code)]
109111
pub handler: PyObjectRef,
110112
}
111113

crates/vm/src/stdlib/ctypes/pointer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use crate::{PyObjectRef, PyResult};
77
#[pyclass(name = "PyCPointerType", base = PyType, module = "_ctypes")]
88
#[derive(PyPayload, Debug)]
99
pub struct PyCPointerType {
10-
pub inner: PyCPointer,
10+
#[allow(dead_code)]
11+
pub(crate) inner: PyCPointer,
1112
}
1213

1314
#[pyclass]

crates/vm/src/stdlib/ctypes/util.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

extra_tests/snippets/stdlib_ctypes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,19 @@ def LoadLibrary(self, name):
338338
libc = cdll.LoadLibrary("libc.dylib")
339339
libc.rand()
340340
i = c_int(1)
341-
print("start srand")
342-
print(libc.srand(i))
343-
print(test_byte_array)
341+
# print("start srand")
342+
# print(libc.srand(i))
343+
# print(test_byte_array)
344344
else:
345345
import os
346346

347347
libc = cdll.msvcrt
348348
libc.rand()
349349
i = c_int(1)
350350
print("start srand")
351-
print(libc.srand(i))
352-
print(test_byte_array)
353-
print(test_byte_array._type_)
351+
# print(libc.srand(i))
352+
# print(test_byte_array)
353+
# print(test_byte_array._type_)
354354
# print("start printf")
355355
# libc.printf(test_byte_array)
356356

0 commit comments

Comments
 (0)