Skip to content

Commit f5f9edf

Browse files
committed
all: Rename UMODULE to MODULE in preprocessor/Makefile vars.
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
1 parent 7f5d5c7 commit f5f9edf

File tree

126 files changed

+563
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+563
-563
lines changed

docs/library/random.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This module implements a pseudo-random number generator (PRNG).
2424
.. note::
2525

2626
The :func:`randrange`, :func:`randint` and :func:`choice` functions are only
27-
available if the ``MICROPY_PY_URANDOM_EXTRA_FUNCS`` configuration option is
27+
available if the ``MICROPY_PY_RANDOM_EXTRA_FUNCS`` configuration option is
2828
enabled.
2929

3030

@@ -73,7 +73,7 @@ Other Functions
7373
supported by the port) initialise the PRNG with a true random number
7474
(usually a hardware generated random number).
7575

76-
The ``None`` case only works if ``MICROPY_PY_URANDOM_SEED_INIT_FUNC`` is
76+
The ``None`` case only works if ``MICROPY_PY_RANDOM_SEED_INIT_FUNC`` is
7777
enabled by the port, otherwise it raises ``ValueError``.
7878

7979
.. function:: choice(sequence)

examples/natmod/uheapq/uheapq.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define MICROPY_PY_UHEAPQ (1)
1+
#define MICROPY_PY_HEAPQ (1)
22

33
#include "py/dynruntime.h"
44

examples/natmod/urandom/urandom.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#define MICROPY_PY_URANDOM (1)
2-
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
1+
#define MICROPY_PY_RANDOM (1)
2+
#define MICROPY_PY_RANDOM_EXTRA_FUNCS (1)
33

44
#include "py/dynruntime.h"
55

@@ -19,7 +19,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
1919
mp_store_global(MP_QSTR___name__, MP_OBJ_NEW_QSTR(MP_QSTR_random));
2020
mp_store_global(MP_QSTR_getrandbits, MP_OBJ_FROM_PTR(&mod_random_getrandbits_obj));
2121
mp_store_global(MP_QSTR_seed, MP_OBJ_FROM_PTR(&mod_random_seed_obj));
22-
#if MICROPY_PY_URANDOM_EXTRA_FUNCS
22+
#if MICROPY_PY_RANDOM_EXTRA_FUNCS
2323
mp_store_global(MP_QSTR_randrange, MP_OBJ_FROM_PTR(&mod_random_randrange_obj));
2424
mp_store_global(MP_QSTR_randint, MP_OBJ_FROM_PTR(&mod_random_randint_obj));
2525
mp_store_global(MP_QSTR_choice, MP_OBJ_FROM_PTR(&mod_random_choice_obj));

examples/natmod/ure/ure.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#define MICROPY_STACK_CHECK (1)
2-
#define MICROPY_PY_URE (1)
3-
#define MICROPY_PY_URE_MATCH_GROUPS (1)
4-
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
5-
#define MICROPY_PY_URE_SUB (0) // requires vstr interface
2+
#define MICROPY_PY_RE (1)
3+
#define MICROPY_PY_RE_MATCH_GROUPS (1)
4+
#define MICROPY_PY_RE_MATCH_SPAN_START_END (1)
5+
#define MICROPY_PY_RE_SUB (0) // requires vstr interface
66

77
#include <alloca.h>
88
#include "py/dynruntime.h"

examples/natmod/uzlib/uzlib.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define MICROPY_PY_UZLIB (1)
1+
#define MICROPY_PY_ZLIB (1)
22

33
#include "py/dynruntime.h"
44

extmod/extmod.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ endif
108108
################################################################################
109109
# ussl
110110

111-
ifeq ($(MICROPY_PY_USSL),1)
112-
CFLAGS_EXTMOD += -DMICROPY_PY_USSL=1
111+
ifeq ($(MICROPY_PY_SSL),1)
112+
CFLAGS_EXTMOD += -DMICROPY_PY_SSL=1
113113
ifeq ($(MICROPY_SSL_AXTLS),1)
114114
AXTLS_DIR = lib/axtls
115115
GIT_SUBMODULES += $(AXTLS_DIR)

extmod/modlwip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(lwip_socket_bind_obj, lwip_socket_bind);
918918
STATIC mp_obj_t lwip_socket_listen(size_t n_args, const mp_obj_t *args) {
919919
lwip_socket_obj_t *socket = MP_OBJ_TO_PTR(args[0]);
920920

921-
mp_int_t backlog = MICROPY_PY_USOCKET_LISTEN_BACKLOG_DEFAULT;
921+
mp_int_t backlog = MICROPY_PY_SOCKET_LISTEN_BACKLOG_DEFAULT;
922922
if (n_args > 1) {
923923
backlog = mp_obj_get_int(args[1]);
924924
backlog = (backlog < 0) ? 0 : backlog;

extmod/modnetwork.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef struct _mod_network_socket_obj_t {
101101
int32_t timeout;
102102
mp_obj_t callback;
103103
int32_t state : 8;
104-
#if MICROPY_PY_USOCKET_EXTENDED_STATE
104+
#if MICROPY_PY_SOCKET_EXTENDED_STATE
105105
// Extended socket state for NICs/ports that need it.
106106
void *_private;
107107
#endif

extmod/moduasyncio.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ STATIC mp_obj_t task_queue_make_new(const mp_obj_type_t *type, size_t n_args, si
6464
// Ticks for task ordering in pairing heap
6565

6666
STATIC mp_obj_t ticks(void) {
67-
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_ms() & (MICROPY_PY_UTIME_TICKS_PERIOD - 1));
67+
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_ms() & (MICROPY_PY_TIME_TICKS_PERIOD - 1));
6868
}
6969

7070
STATIC mp_int_t ticks_diff(mp_obj_t t1_in, mp_obj_t t0_in) {
7171
mp_uint_t t0 = MP_OBJ_SMALL_INT_VALUE(t0_in);
7272
mp_uint_t t1 = MP_OBJ_SMALL_INT_VALUE(t1_in);
73-
mp_int_t diff = ((t1 - t0 + MICROPY_PY_UTIME_TICKS_PERIOD / 2) & (MICROPY_PY_UTIME_TICKS_PERIOD - 1))
74-
- MICROPY_PY_UTIME_TICKS_PERIOD / 2;
73+
mp_int_t diff = ((t1 - t0 + MICROPY_PY_TIME_TICKS_PERIOD / 2) & (MICROPY_PY_TIME_TICKS_PERIOD - 1))
74+
- MICROPY_PY_TIME_TICKS_PERIOD / 2;
7575
return diff;
7676
}
7777

extmod/modubinascii.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "py/binary.h"
3333
#include "py/objstr.h"
3434

35-
#if MICROPY_PY_UBINASCII
35+
#if MICROPY_PY_BINASCII
3636

3737
#if MICROPY_PY_BUILTINS_BYTES_HEX
3838
STATIC mp_obj_t bytes_hex_as_bytes(size_t n_args, const mp_obj_t *args) {
@@ -170,7 +170,7 @@ STATIC mp_obj_t mod_binascii_b2a_base64(size_t n_args, const mp_obj_t *pos_args,
170170
}
171171
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mod_binascii_b2a_base64_obj, 1, mod_binascii_b2a_base64);
172172

173-
#if MICROPY_PY_UBINASCII_CRC32
173+
#if MICROPY_PY_BINASCII_CRC32
174174
#include "lib/uzlib/tinf.h"
175175

176176
STATIC mp_obj_t mod_binascii_crc32(size_t n_args, const mp_obj_t *args) {
@@ -191,7 +191,7 @@ STATIC const mp_rom_map_elem_t mp_module_binascii_globals_table[] = {
191191
#endif
192192
{ MP_ROM_QSTR(MP_QSTR_a2b_base64), MP_ROM_PTR(&mod_binascii_a2b_base64_obj) },
193193
{ MP_ROM_QSTR(MP_QSTR_b2a_base64), MP_ROM_PTR(&mod_binascii_b2a_base64_obj) },
194-
#if MICROPY_PY_UBINASCII_CRC32
194+
#if MICROPY_PY_BINASCII_CRC32
195195
{ MP_ROM_QSTR(MP_QSTR_crc32), MP_ROM_PTR(&mod_binascii_crc32_obj) },
196196
#endif
197197
};
@@ -205,4 +205,4 @@ const mp_obj_module_t mp_module_binascii = {
205205

206206
MP_REGISTER_MODULE(MP_QSTR_binascii, mp_module_binascii);
207207

208-
#endif // MICROPY_PY_UBINASCII
208+
#endif // MICROPY_PY_BINASCII

extmod/moducryptolib.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "py/mpconfig.h"
2929

30-
#if MICROPY_PY_UCRYPTOLIB
30+
#if MICROPY_PY_CRYPTOLIB
3131

3232
#include <assert.h>
3333
#include <string.h>
@@ -90,7 +90,7 @@ typedef struct _mp_obj_aes_t {
9090
} mp_obj_aes_t;
9191

9292
static inline bool is_ctr_mode(int block_mode) {
93-
#if MICROPY_PY_UCRYPTOLIB_CTR
93+
#if MICROPY_PY_CRYPTOLIB_CTR
9494
return block_mode == UCRYPTOLIB_MODE_CTR;
9595
#else
9696
return false;
@@ -140,7 +140,7 @@ STATIC void aes_process_cbc_impl(AES_CTX_IMPL *ctx, const uint8_t *in, uint8_t *
140140
}
141141
}
142142

143-
#if MICROPY_PY_UCRYPTOLIB_CTR
143+
#if MICROPY_PY_CRYPTOLIB_CTR
144144
// axTLS doesn't have CTR support out of the box. This implements the counter part using the ECB primitive.
145145
STATIC void aes_process_ctr_impl(AES_CTX_IMPL *ctx, const uint8_t *in, uint8_t *out, size_t in_len, struct ctr_params *ctr_params) {
146146
size_t n = ctr_params->offset;
@@ -203,7 +203,7 @@ STATIC void aes_process_cbc_impl(AES_CTX_IMPL *ctx, const uint8_t *in, uint8_t *
203203
mbedtls_aes_crypt_cbc(&ctx->u.mbedtls_ctx, encrypt ? MBEDTLS_AES_ENCRYPT : MBEDTLS_AES_DECRYPT, in_len, ctx->iv, in, out);
204204
}
205205

206-
#if MICROPY_PY_UCRYPTOLIB_CTR
206+
#if MICROPY_PY_CRYPTOLIB_CTR
207207
STATIC void aes_process_ctr_impl(AES_CTX_IMPL *ctx, const uint8_t *in, uint8_t *out, size_t in_len, struct ctr_params *ctr_params) {
208208
mbedtls_aes_crypt_ctr(&ctx->u.mbedtls_ctx, in_len, &ctr_params->offset, ctx->iv, ctr_params->encrypted_counter, in, out);
209209
}
@@ -219,7 +219,7 @@ STATIC mp_obj_t cryptolib_aes_make_new(const mp_obj_type_t *type, size_t n_args,
219219
switch (block_mode) {
220220
case UCRYPTOLIB_MODE_ECB:
221221
case UCRYPTOLIB_MODE_CBC:
222-
#if MICROPY_PY_UCRYPTOLIB_CTR
222+
#if MICROPY_PY_CRYPTOLIB_CTR
223223
case UCRYPTOLIB_MODE_CTR:
224224
#endif
225225
break;
@@ -318,7 +318,7 @@ STATIC mp_obj_t aes_process(size_t n_args, const mp_obj_t *args, bool encrypt) {
318318
aes_process_cbc_impl(&self->ctx, in_bufinfo.buf, out_buf_ptr, in_bufinfo.len, encrypt);
319319
break;
320320

321-
#if MICROPY_PY_UCRYPTOLIB_CTR
321+
#if MICROPY_PY_CRYPTOLIB_CTR
322322
case UCRYPTOLIB_MODE_CTR:
323323
aes_process_ctr_impl(&self->ctx, in_bufinfo.buf, out_buf_ptr, in_bufinfo.len,
324324
ctr_params_from_aes(self));
@@ -359,10 +359,10 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
359359
STATIC const mp_rom_map_elem_t mp_module_cryptolib_globals_table[] = {
360360
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_cryptolib) },
361361
{ MP_ROM_QSTR(MP_QSTR_aes), MP_ROM_PTR(&cryptolib_aes_type) },
362-
#if MICROPY_PY_UCRYPTOLIB_CONSTS
362+
#if MICROPY_PY_CRYPTOLIB_CONSTS
363363
{ MP_ROM_QSTR(MP_QSTR_MODE_ECB), MP_ROM_INT(UCRYPTOLIB_MODE_ECB) },
364364
{ MP_ROM_QSTR(MP_QSTR_MODE_CBC), MP_ROM_INT(UCRYPTOLIB_MODE_CBC) },
365-
#if MICROPY_PY_UCRYPTOLIB_CTR
365+
#if MICROPY_PY_CRYPTOLIB_CTR
366366
{ MP_ROM_QSTR(MP_QSTR_MODE_CTR), MP_ROM_INT(UCRYPTOLIB_MODE_CTR) },
367367
#endif
368368
#endif
@@ -377,4 +377,4 @@ const mp_obj_module_t mp_module_cryptolib = {
377377

378378
MP_REGISTER_MODULE(MP_QSTR_cryptolib, mp_module_cryptolib);
379379

380-
#endif // MICROPY_PY_UCRYPTOLIB
380+
#endif // MICROPY_PY_CRYPTOLIB

extmod/moduhashlib.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929

3030
#include "py/runtime.h"
3131

32-
#if MICROPY_PY_UHASHLIB
32+
#if MICROPY_PY_HASHLIB
3333

3434
#if MICROPY_SSL_MBEDTLS
3535
#include "mbedtls/version.h"
3636
#endif
3737

38-
#if MICROPY_PY_UHASHLIB_SHA256
38+
#if MICROPY_PY_HASHLIB_SHA256
3939

4040
#if MICROPY_SSL_MBEDTLS
4141
#include "mbedtls/sha256.h"
@@ -45,7 +45,7 @@
4545

4646
#endif
4747

48-
#if MICROPY_PY_UHASHLIB_SHA1 || MICROPY_PY_UHASHLIB_MD5
48+
#if MICROPY_PY_HASHLIB_SHA1 || MICROPY_PY_HASHLIB_MD5
4949

5050
#if MICROPY_SSL_AXTLS
5151
#include "lib/axtls/crypto/crypto.h"
@@ -70,7 +70,7 @@ static void hashlib_ensure_not_final(mp_obj_hash_t *self) {
7070
}
7171
}
7272

73-
#if MICROPY_PY_UHASHLIB_SHA256
73+
#if MICROPY_PY_HASHLIB_SHA256
7474
STATIC mp_obj_t hashlib_sha256_update(mp_obj_t self_in, mp_obj_t arg);
7575

7676
#if MICROPY_SSL_MBEDTLS
@@ -161,12 +161,12 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
161161
hashlib_sha256_type,
162162
MP_QSTR_sha256,
163163
MP_TYPE_FLAG_NONE,
164-
make_new, uhashlib_sha256_make_new,
164+
make_new, hashlib_sha256_make_new,
165165
locals_dict, &hashlib_sha256_locals_dict
166166
);
167167
#endif
168168

169-
#if MICROPY_PY_UHASHLIB_SHA1
169+
#if MICROPY_PY_HASHLIB_SHA1
170170
STATIC mp_obj_t hashlib_sha1_update(mp_obj_t self_in, mp_obj_t arg);
171171

172172
#if MICROPY_SSL_AXTLS
@@ -260,7 +260,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
260260
);
261261
#endif
262262

263-
#if MICROPY_PY_UHASHLIB_MD5
263+
#if MICROPY_PY_HASHLIB_MD5
264264
STATIC mp_obj_t hashlib_md5_update(mp_obj_t self_in, mp_obj_t arg);
265265

266266
#if MICROPY_SSL_AXTLS
@@ -352,17 +352,17 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
352352
make_new, hashlib_md5_make_new,
353353
locals_dict, &hashlib_md5_locals_dict
354354
);
355-
#endif // MICROPY_PY_UHASHLIB_MD5
355+
#endif // MICROPY_PY_HASHLIB_MD5
356356

357357
STATIC const mp_rom_map_elem_t mp_module_hashlib_globals_table[] = {
358358
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_hashlib) },
359-
#if MICROPY_PY_UHASHLIB_SHA256
359+
#if MICROPY_PY_HASHLIB_SHA256
360360
{ MP_ROM_QSTR(MP_QSTR_sha256), MP_ROM_PTR(&hashlib_sha256_type) },
361361
#endif
362-
#if MICROPY_PY_UHASHLIB_SHA1
362+
#if MICROPY_PY_HASHLIB_SHA1
363363
{ MP_ROM_QSTR(MP_QSTR_sha1), MP_ROM_PTR(&hashlib_sha1_type) },
364364
#endif
365-
#if MICROPY_PY_UHASHLIB_MD5
365+
#if MICROPY_PY_HASHLIB_MD5
366366
{ MP_ROM_QSTR(MP_QSTR_md5), MP_ROM_PTR(&hashlib_md5_type) },
367367
#endif
368368
};
@@ -376,4 +376,4 @@ const mp_obj_module_t mp_module_hashlib = {
376376

377377
MP_REGISTER_MODULE(MP_QSTR_hashlib, mp_module_hashlib);
378378

379-
#endif // MICROPY_PY_UHASHLIB
379+
#endif // MICROPY_PY_HASHLIB

extmod/moduheapq.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "py/objlist.h"
2828
#include "py/runtime.h"
2929

30-
#if MICROPY_PY_UHEAPQ
30+
#if MICROPY_PY_HEAPQ
3131

3232
// the algorithm here is modelled on CPython's heapq.py
3333

@@ -121,4 +121,4 @@ const mp_obj_module_t mp_module_heapq = {
121121
MP_REGISTER_MODULE(MP_QSTR_heapq, mp_module_heapq);
122122
#endif
123123

124-
#endif // MICROPY_PY_UHEAPQ
124+
#endif // MICROPY_PY_HEAPQ

extmod/modujson.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
#include "py/runtime.h"
3333
#include "py/stream.h"
3434

35-
#if MICROPY_PY_UJSON
35+
#if MICROPY_PY_JSON
3636

37-
#if MICROPY_PY_UJSON_SEPARATORS
37+
#if MICROPY_PY_JSON_SEPARATORS
3838

3939
enum {
4040
DUMP_MODE_TO_STRING = 1,
@@ -383,4 +383,4 @@ const mp_obj_module_t mp_module_json = {
383383

384384
MP_REGISTER_MODULE(MP_QSTR_json, mp_module_json);
385385

386-
#endif // MICROPY_PY_UJSON
386+
#endif // MICROPY_PY_JSON

0 commit comments

Comments
 (0)