diff options
| author | Damien George | 2014-12-10 22:07:04 +0000 |
|---|---|---|
| committer | Damien George | 2014-12-10 22:08:14 +0000 |
| commit | 969a6b37bfc655609e540053c2bdcce8a6fdc64d (patch) | |
| tree | 5e7d74f72d702efd07ff6ba6d93d3a10e4e00fd2 /extmod/moductypes.c | |
| parent | d51107927d53a80835195ba1ac97048c203f05f2 (diff) | |
py: Make functions static where appropriate.
Diffstat (limited to 'extmod/moductypes.c')
| -rw-r--r-- | extmod/moductypes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/extmod/moductypes.c b/extmod/moductypes.c index b8f68bf8c..4d2e3f696 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -559,7 +559,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_ob /// \function addressof() /// Return address of object's data (applies to object providing buffer /// interface). -mp_obj_t uctypes_struct_addressof(mp_obj_t buf) { +STATIC mp_obj_t uctypes_struct_addressof(mp_obj_t buf) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ); return mp_obj_new_int((mp_int_t)bufinfo.buf); @@ -570,7 +570,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_addressof_obj, uctypes_struct_addressof /// Capture memory at given address of given size as bytearray. Memory is /// captured by reference (and thus memory pointed by bytearray may change /// or become invalid at later time). Use bytes_at() to capture by value. -mp_obj_t uctypes_struct_bytearray_at(mp_obj_t ptr, mp_obj_t size) { +STATIC mp_obj_t uctypes_struct_bytearray_at(mp_obj_t ptr, mp_obj_t size) { return mp_obj_new_bytearray_by_ref(mp_obj_int_get_truncated(size), (void*)mp_obj_int_get_truncated(ptr)); } MP_DEFINE_CONST_FUN_OBJ_2(uctypes_struct_bytearray_at_obj, uctypes_struct_bytearray_at); @@ -579,7 +579,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(uctypes_struct_bytearray_at_obj, uctypes_struct_bytear /// Capture memory at given address of given size as bytes. Memory is /// captured by value, i.e. copied. Use bytearray_at() to capture by reference /// ("zero copy"). -mp_obj_t uctypes_struct_bytes_at(mp_obj_t ptr, mp_obj_t size) { +STATIC mp_obj_t uctypes_struct_bytes_at(mp_obj_t ptr, mp_obj_t size) { return mp_obj_new_bytes((void*)mp_obj_int_get_truncated(ptr), mp_obj_int_get_truncated(size)); } MP_DEFINE_CONST_FUN_OBJ_2(uctypes_struct_bytes_at_obj, uctypes_struct_bytes_at); |
