Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f66bff

Browse files
committed
Remove STATIC macro
1 parent db55ee0 commit 0f66bff

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ports/nrf/modules/machine/rtc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ typedef struct _machine_rtc_obj_t {
8080
} machine_rtc_obj_t;
8181

8282
// singleton RTC object
83-
STATIC const machine_rtc_obj_t machine_rtc_obj = {{&machine_rtc_type}};
83+
static const machine_rtc_obj_t machine_rtc_obj = {{&machine_rtc_type}};
8484

85-
STATIC mp_obj_t machine_rtc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
85+
static mp_obj_t machine_rtc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
8686
// check arguments
8787
mp_arg_check_num(n_args, n_kw, 0, 0, false);
8888

8989
// return constant object
9090
return (mp_obj_t)&machine_rtc_obj;
9191
}
9292

93-
STATIC mp_obj_t machine_rtc_datetime(mp_uint_t n_args, const mp_obj_t *args) {
93+
static mp_obj_t machine_rtc_datetime(mp_uint_t n_args, const mp_obj_t *args) {
9494
if (n_args == 1) {
9595
timeutils_struct_time_t t;
9696

@@ -129,12 +129,12 @@ STATIC mp_obj_t machine_rtc_datetime(mp_uint_t n_args, const mp_obj_t *args) {
129129
}
130130
return mp_const_none;
131131
}
132-
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_rtc_datetime_obj, 1, 2, machine_rtc_datetime);
132+
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_rtc_datetime_obj, 1, 2, machine_rtc_datetime);
133133

134-
STATIC const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = {
134+
static const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = {
135135
{ MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&machine_rtc_datetime_obj) },
136136
};
137-
STATIC MP_DEFINE_CONST_DICT(machine_rtc_locals_dict, machine_rtc_locals_dict_table);
137+
static MP_DEFINE_CONST_DICT(machine_rtc_locals_dict, machine_rtc_locals_dict_table);
138138

139139
MP_DEFINE_CONST_OBJ_TYPE(
140140
machine_rtc_type,

ports/nrf/modules/utime/modutime.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void rtc_get_time(timeutils_struct_time_t *time);
4545
// Convert a time expressed in seconds since the Epoch into an 8-tuple which
4646
// contains: (year, month, mday, hour, minute, second, weekday, yearday)
4747
// If secs is not provided or None, then the current time from is used.
48-
STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
48+
static mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
4949
if (n_args == 0 || args[0] == mp_const_none) {
5050
// Get current date and time.
5151
timeutils_struct_time_t t;
@@ -85,7 +85,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime);
8585
// This is inverse function of localtime. It's argument is a full 8-tuple
8686
// which expresses a time as per localtime. It returns an integer which is
8787
// the number of seconds since the Epoch.
88-
STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
88+
static mp_obj_t time_mktime(mp_obj_t tuple) {
8989
size_t len;
9090
mp_obj_t *elem;
9191
mp_obj_get_array(tuple, &len, &elem);
@@ -104,17 +104,17 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
104104
#if MICROPY_PY_MACHINE_RTC
105105
// time()
106106
// Return the number of seconds since the Epoch.
107-
STATIC mp_obj_t time_time(void) {
107+
static mp_obj_t time_time(void) {
108108
// datetime_t t;
109109
timeutils_struct_time_t t;
110110
rtc_get_time(&t);
111111
return mp_obj_new_int_from_ull(timeutils_seconds_since_epoch(t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec));
112112
}
113113

114-
STATIC MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time);
114+
static MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time);
115115
#endif
116116

117-
STATIC const mp_rom_map_elem_t time_module_globals_table[] = {
117+
static const mp_rom_map_elem_t time_module_globals_table[] = {
118118
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_utime) },
119119

120120
#if MICROPY_PY_MACHINE_RTC
@@ -136,7 +136,7 @@ STATIC const mp_rom_map_elem_t time_module_globals_table[] = {
136136
{ MP_ROM_QSTR(MP_QSTR_ticks_diff), MP_ROM_PTR(&mp_utime_ticks_diff_obj) },
137137
};
138138

139-
STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
139+
static MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
140140

141141
const mp_obj_module_t mp_module_utime = {
142142
.base = { &mp_type_module },

0 commit comments

Comments
 (0)