summaryrefslogtreecommitdiff
path: root/shared-bindings/displayio/Shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared-bindings/displayio/Shape.c')
-rw-r--r--shared-bindings/displayio/Shape.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c
index 37a049d0c..e60d670b7 100644
--- a/shared-bindings/displayio/Shape.c
+++ b/shared-bindings/displayio/Shape.c
@@ -53,19 +53,16 @@
//| :param bool mirror_x: When true the left boundary is mirrored to the right.
//| :param bool mirror_y: When true the top boundary is mirrored to the bottom.
//|
-STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
- mp_arg_check_num(n_args, n_kw, 2, 4, true);
- mp_map_t kw_args;
- mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args);
+STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_width, ARG_height, ARG_mirror_x, ARG_mirror_y };
static const mp_arg_t allowed_args[] = {
- { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED },
- { MP_QSTR_height, MP_ARG_INT | MP_ARG_REQUIRED },
+ { MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT },
+ { MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT },
{ MP_QSTR_mirror_x, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
{ MP_QSTR_mirror_y, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
- mp_arg_parse_all(n_args, pos_args, &kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
+ mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
displayio_shape_t *self = m_new_obj(displayio_shape_t);
self->base.type = &displayio_shape_type;