8000 extmod/modwebsocket: Make compatible with non-default object models. · sparkfun/circuitpython@e0d49b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0d49b7

Browse files
committed
extmod/modwebsocket: Make compatible with non-default object models.
1 parent 6de3786 commit e0d49b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extmod/modwebsocket.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ STATIC mp_obj_t websocket_make_new(const mp_obj_type_t *type, size_t n_args, siz
7373
if (n_args > 1 && args[1] == mp_const_true) {
7474
o->opts |= BLOCKING_WRITE;
7575
}
76-
return o;
76+
return MP_OBJ_FROM_PTR(o);
7777
}
7878

7979
STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) {
80-
mp_obj_websocket_t *self = self_in;
80+
mp_obj_websocket_t *self = MP_OBJ_TO_PTR(self_in);
8181
const mp_stream_p_t *stream_p = mp_get_stream_raise(self->sock, MP_STREAM_OP_READ);
8282
while (1) {
8383
if (self->to_recv != 0) {
@@ -219,7 +219,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
219219
}
220220

221221
STATIC mp_uint_t websocket_write(mp_obj_t self_in, const void *buf, mp_uint_t size, int *errcode) {
222-
mp_obj_websocket_t *self = self_in;
222+
mp_obj_websocket_t *self = MP_OBJ_TO_PTR(self_in);
223223
assert(size < 0x10000);
224224
byte header[4] = {0x80 | (self->opts & FRAME_OPCODE_MASK)};
225225
int hdr_sz;

0 commit comments

Comments
 (0)
0