mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 19:50:30 +01:00
all: Remove third argument to MP_REGISTER_MODULE.
It's no longer needed because this macro is now processed after preprocessing the source code via cpp (in the qstr extraction stage), which means unused MP_REGISTER_MODULE's are filtered out by the preprocessor. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include "py/objint.h"
|
||||
#include "py/gc.h"
|
||||
|
||||
#if MICROPY_PY_FFI
|
||||
|
||||
/*
|
||||
* modffi uses character codes to encode a value type, based on "struct"
|
||||
* module type codes, with some extensions and overridings.
|
||||
@@ -632,4 +634,6 @@ const mp_obj_module_t mp_module_ffi = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_ffi_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_ffi, mp_module_ffi, MICROPY_PY_FFI);
|
||||
MP_REGISTER_MODULE(MP_QSTR_ffi, mp_module_ffi);
|
||||
|
||||
#endif // MICROPY_PY_FFI
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#if MICROPY_PY_JNI
|
||||
|
||||
#define JJ(call, ...) (*env)->call(env, __VA_ARGS__)
|
||||
#define JJ1(call) (*env)->call(env)
|
||||
#define MATCH(s, static) (!strncmp(s, static, sizeof(static) - 1))
|
||||
@@ -713,4 +715,6 @@ const mp_obj_module_t mp_module_jni = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_jni_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_jni, mp_module_jni, MICROPY_PY_JNI);
|
||||
MP_REGISTER_MODULE(MP_QSTR_jni, mp_module_jni);
|
||||
|
||||
#endif // MICROPY_PY_JNI
|
||||
|
||||
@@ -110,6 +110,6 @@ const mp_obj_module_t mp_module_machine = {
|
||||
.globals = (mp_obj_dict_t *)&machine_module_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);
|
||||
MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine);
|
||||
|
||||
#endif // MICROPY_PY_MACHINE
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "py/runtime.h"
|
||||
#include "py/mphal.h"
|
||||
|
||||
#if MICROPY_PY_TERMIOS
|
||||
|
||||
STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) {
|
||||
struct termios term;
|
||||
int fd = mp_obj_get_int(fd_in);
|
||||
@@ -149,4 +151,6 @@ const mp_obj_module_t mp_module_termios = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_termios_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_termios, mp_module_termios, MICROPY_PY_TERMIOS);
|
||||
MP_REGISTER_MODULE(MP_QSTR_termios, mp_module_termios);
|
||||
|
||||
#endif // MICROPY_PY_TERMIOS
|
||||
|
||||
@@ -232,6 +232,6 @@ const mp_obj_module_t mp_module_time = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_time_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_time, MICROPY_PY_UTIME);
|
||||
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_time);
|
||||
|
||||
#endif // MICROPY_PY_UTIME
|
||||
|
||||
@@ -351,6 +351,6 @@ const mp_obj_module_t mp_module_uselect = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_select_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_uselect, mp_module_uselect, MICROPY_PY_USELECT_POSIX);
|
||||
MP_REGISTER_MODULE(MP_QSTR_uselect, mp_module_uselect);
|
||||
|
||||
#endif // MICROPY_PY_USELECT_POSIX
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
#include "extmod/vfs.h"
|
||||
#include <poll.h>
|
||||
|
||||
#if MICROPY_PY_SOCKET
|
||||
|
||||
/*
|
||||
The idea of this module is to implement reasonable minimum of
|
||||
socket-related functions to write typical clients and servers.
|
||||
@@ -702,4 +704,6 @@ const mp_obj_module_t mp_module_socket = {
|
||||
.globals = (mp_obj_dict_t *)&mp_module_socket_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_socket, MICROPY_PY_SOCKET);
|
||||
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_socket);
|
||||
|
||||
#endif // MICROPY_PY_SOCKET
|
||||
|
||||
Reference in New Issue
Block a user