Skip to content

Commit 63dfbd1

Browse files
authored
Remove the STATIC macro. (#664)
Reflect the changes proposed in micropython/micropython#13763.
1 parent c491105 commit 63dfbd1

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

code/ndarray.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ ndarray_obj_t *ndarray_from_iterable(mp_obj_t obj, uint8_t dtype) {
917917
return ndarray;
918918
}
919919

920-
STATIC uint8_t ndarray_init_helper(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
920+
static uint8_t ndarray_init_helper(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
921921
static const mp_arg_t allowed_args[] = {
922922
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },
923923
{ MP_QSTR_dtype, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_INT(NDARRAY_FLOAT) } },
@@ -940,7 +940,7 @@ STATIC uint8_t ndarray_init_helper(size_t n_args, const mp_obj_t *pos_args, mp_m
940940
return _dtype;
941941
}
942942

943-
STATIC mp_obj_t ndarray_make_new_core(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args, mp_map_t *kw_args) {
943+
static mp_obj_t ndarray_make_new_core(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args, mp_map_t *kw_args) {
944944
uint8_t dtype = ndarray_init_helper(n_args, args, kw_args);
945945

946946
if(mp_obj_is_type(args[0], &ulab_ndarray_type)) {

code/numpy/approx.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ULAB_DEFINE_FLOAT_CONST(approx_trapz_dx, MICROPY_FLOAT_CONST(1.0), 0x3f800000UL,
4747
//| ...
4848
//|
4949

50-
STATIC mp_obj_t approx_interp(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
50+
static mp_obj_t approx_interp(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
5151
static const mp_arg_t allowed_args[] = {
5252
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },
5353
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },
@@ -151,7 +151,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(approx_interp_obj, 2, approx_interp);
151151
//| ...
152152
//|
153153

154-
STATIC mp_obj_t approx_trapz(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
154+
static mp_obj_t approx_trapz(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
155155
static const mp_arg_t allowed_args[] = {
156156
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },
157157
{ MP_QSTR_x, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },

code/numpy/fft/fft.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ static mp_obj_t fft_ifft(size_t n_args, const mp_obj_t *args) {
8888
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fft_ifft_obj, 1, 2, fft_ifft);
8989
#endif
9090

91-
STATIC const mp_rom_map_elem_t ulab_fft_globals_table[] = {
91+
static const mp_rom_map_elem_t ulab_fft_globals_table[] = {
9292
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_fft) },
9393
{ MP_ROM_QSTR(MP_QSTR_fft), MP_ROM_PTR(&fft_fft_obj) },
9494
{ MP_ROM_QSTR(MP_QSTR_ifft), MP_ROM_PTR(&fft_ifft_obj) },
9595
};
9696

97-
STATIC MP_DEFINE_CONST_DICT(mp_module_ulab_fft_globals, ulab_fft_globals_table);
97+
static MP_DEFINE_CONST_DICT(mp_module_ulab_fft_globals, ulab_fft_globals_table);
9898

9999
const mp_obj_module_t ulab_fft_module = {
100100
.base = { &mp_type_module },

code/numpy/linalg/linalg.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ static mp_obj_t linalg_qr(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_
506506
MP_DEFINE_CONST_FUN_OBJ_KW(linalg_qr_obj, 1, linalg_qr);
507507
#endif
508508

509-
STATIC const mp_rom_map_elem_t ulab_linalg_globals_table[] = {
509+
static const mp_rom_map_elem_t ulab_linalg_globals_table[] = {
510510
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_linalg) },
511511
#if ULAB_MAX_DIMS > 1
512512
#if ULAB_LINALG_HAS_CHOLESKY
@@ -530,7 +530,7 @@ STATIC const mp_rom_map_elem_t ulab_linalg_globals_table[] = {
530530
#endif
531531
};
532532

533-
STATIC MP_DEFINE_CONST_DICT(mp_module_ulab_linalg_globals, ulab_linalg_globals_table);
533+
static MP_DEFINE_CONST_DICT(mp_module_ulab_linalg_globals, ulab_linalg_globals_table);
534534

535535
const mp_obj_module_t ulab_linalg_module = {
536536
.base = { &mp_type_module },

code/scipy/optimize/optimize.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static mp_float_t optimize_python_call(const mp_obj_type_t *type, mp_obj_t fun,
5555
//| ...
5656
//|
5757

58-
STATIC mp_obj_t optimize_bisect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
58+
static mp_obj_t optimize_bisect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
5959
// Simple bisection routine
6060
static const mp_arg_t allowed_args[] = {
6161
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },
@@ -125,7 +125,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(optimize_bisect_obj, 3, optimize_bisect);
125125
//| ...
126126
//|
127127

128-
STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
128+
static mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
129129
// downhill simplex method in 1D
130130
static const mp_arg_t allowed_args[] = {
131131
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE } },

code/ulab.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
#define ULAB_VERSION_STRING xstr(ULAB_VERSION) xstr(-) xstr(ULAB_MAX_DIMS) xstr(D)
4444
#endif
4545

46-
STATIC MP_DEFINE_STR_OBJ(ulab_version_obj, ULAB_VERSION_STRING);
46+
static MP_DEFINE_STR_OBJ(ulab_version_obj, ULAB_VERSION_STRING);
4747

4848
#ifdef ULAB_HASH
49-
STATIC MP_DEFINE_STR_OBJ(ulab_sha_obj, xstr(ULAB_HASH));
49+
static MP_DEFINE_STR_OBJ(ulab_sha_obj, xstr(ULAB_HASH));
5050
#endif
5151

52-
STATIC const mp_rom_map_elem_t ulab_ndarray_locals_dict_table[] = {
52+
static const mp_rom_map_elem_t ulab_ndarray_locals_dict_table[] = {
5353
#if ULAB_MAX_DIMS > 1
5454
#if NDARRAY_HAS_RESHAPE
5555
{ MP_ROM_QSTR(MP_QSTR_reshape), MP_ROM_PTR(&ndarray_reshape_obj) },
@@ -78,7 +78,7 @@ STATIC const mp_rom_map_elem_t ulab_ndarray_locals_dict_table[] = {
7878
#endif
7979
};
8080

81-
STATIC MP_DEFINE_CONST_DICT(ulab_ndarray_locals_dict, ulab_ndarray_locals_dict_table);
81+
static MP_DEFINE_CONST_DICT(ulab_ndarray_locals_dict, ulab_ndarray_locals_dict_table);
8282

8383
#if defined(MP_DEFINE_CONST_OBJ_TYPE)
8484
// MicroPython after-b41aaaa (Sept 19 2022).
@@ -192,7 +192,7 @@ const mp_obj_type_t ndarray_flatiter_type = {
192192
#endif
193193
#endif
194194

195-
STATIC const mp_rom_map_elem_t ulab_globals_table[] = {
195+
static const mp_rom_map_elem_t ulab_globals_table[] = {
196196
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ulab) },
197197
{ MP_ROM_QSTR(MP_QSTR___version__), MP_ROM_PTR(&ulab_version_obj) },
198198
#ifdef ULAB_HASH
@@ -217,7 +217,7 @@ STATIC const mp_rom_map_elem_t ulab_globals_table[] = {
217217
#endif
218218
};
219219

220-
STATIC MP_DEFINE_CONST_DICT (
220+
static MP_DEFINE_CONST_DICT (
221221
mp_module_ulab_globals,
222222
ulab_globals_table
223223
);

docs/manual/source/ulab-programming.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ the ``user`` module:
896896

897897
.. code:: c
898898
899-
STATIC const mp_rom_map_elem_t ulab_user_globals_table[] = {
899+
static const mp_rom_map_elem_t ulab_user_globals_table[] = {
900900
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_user) },
901901
{ MP_OBJ_NEW_QSTR(MP_QSTR_square), (mp_obj_t)&user_square_obj },
902902
};

docs/ulab-programming.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@
718718
"Finally, we have to bind this function object in the globals table of the `user` module: \n",
719719
"\n",
720720
"```c\n",
721-
"STATIC const mp_rom_map_elem_t ulab_user_globals_table[] = {\n",
721+
"static const mp_rom_map_elem_t ulab_user_globals_table[] = {\n",
722722
" { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_user) },\n",
723723
" { MP_OBJ_NEW_QSTR(MP_QSTR_square), (mp_obj_t)&user_square_obj },\n",
724724
"};\n",

0 commit comments

Comments
 (0)