diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/file.c | 2 | ||||
-rw-r--r-- | unix/modffi.c | 8 | ||||
-rw-r--r-- | unix/modsocket.c | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/unix/file.c b/unix/file.c index a2706a96c5..6688028a4c 100644 --- a/unix/file.c +++ b/unix/file.c @@ -61,6 +61,7 @@ extern const mp_obj_type_t mp_type_fileio; extern const mp_obj_type_t mp_type_textio; STATIC void fdfile_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_fdfile_t *self = self_in; print(env, "<io.%s %d>", mp_obj_get_type_str(self), self->fd); } @@ -123,6 +124,7 @@ STATIC mp_obj_t fdfile_close(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_close_obj, fdfile_close); STATIC mp_obj_t fdfile___exit__(mp_uint_t n_args, const mp_obj_t *args) { + (void)n_args; return fdfile_close(args[0]); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fdfile___exit___obj, 4, 4, fdfile___exit__); diff --git a/unix/modffi.c b/unix/modffi.c index 5f33e7721b..fc218caf17 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -161,6 +161,7 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type) // FFI module STATIC void ffimod_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_ffimod_t *self = self_in; print(env, "<ffimod %p>", self->handle); } @@ -173,6 +174,7 @@ STATIC mp_obj_t ffimod_close(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(ffimod_close_obj, ffimod_close); STATIC mp_obj_t ffimod_func(mp_uint_t n_args, const mp_obj_t *args) { + (void)n_args; // always 4 mp_obj_ffimod_t *self = args[0]; const char *rettype = mp_obj_str_get_str(args[1]); const char *symname = mp_obj_str_get_str(args[2]); @@ -267,6 +269,9 @@ STATIC mp_obj_t ffimod_var(mp_obj_t self_in, mp_obj_t vartype_in, mp_obj_t symna MP_DEFINE_CONST_FUN_OBJ_3(ffimod_var_obj, ffimod_var); STATIC mp_obj_t ffimod_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { + (void)n_args; + (void)n_kw; + const char *fname = mp_obj_str_get_str(args[0]); void *mod = dlopen(fname, RTLD_NOW | RTLD_LOCAL); @@ -298,6 +303,7 @@ STATIC const mp_obj_type_t ffimod_type = { // FFI function STATIC void ffifunc_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_ffifunc_t *self = self_in; print(env, "<ffifunc %p>", self->func); } @@ -366,6 +372,7 @@ STATIC const mp_obj_type_t ffifunc_type = { // FFI callback for Python function STATIC void fficallback_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_fficallback_t *self = self_in; print(env, "<fficallback %p>", self->func); } @@ -379,6 +386,7 @@ STATIC const mp_obj_type_t fficallback_type = { // FFI variable STATIC void ffivar_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_ffivar_t *self = self_in; // Variable value printed as cast to int print(env, "<ffivar @%p: 0x%x>", self->var, *(int*)self->var); diff --git a/unix/modsocket.c b/unix/modsocket.c index 3982650f1b..8f6ac26c6d 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -83,6 +83,7 @@ STATIC mp_obj_socket_t *socket_new(int fd) { STATIC void socket_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { + (void)kind; mp_obj_socket_t *self = self_in; print(env, "<_socket %d>", self->fd); } @@ -206,6 +207,7 @@ STATIC mp_obj_t socket_send(mp_uint_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_send_obj, 2, 3, socket_send); STATIC mp_obj_t socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) { + (void)n_args; // always 4 mp_obj_socket_t *self = args[0]; int level = MP_OBJ_SMALL_INT_VALUE(args[1]); int option = mp_obj_get_int(args[2]); @@ -259,6 +261,9 @@ STATIC mp_obj_t socket_makefile(mp_uint_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 3, socket_makefile); STATIC mp_obj_t socket_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { + (void)type_in; + (void)n_kw; + int family = AF_INET; int type = SOCK_STREAM; int proto = 0; |