Skip to content

Commit abc1959

Browse files
committed
py, unix, lib: Allow to compile with -Wold-style-definition.
1 parent cd34207 commit abc1959

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

extmod/moductypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ typedef struct _mp_obj_uctypes_struct_t {
117117
uint32_t flags;
118118
} mp_obj_uctypes_struct_t;
119119

120-
STATIC NORETURN void syntax_error() {
120+
STATIC NORETURN void syntax_error(void) {
121121
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor"));
122122
}
123123

lib/mp-readline/readline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ int readline_process_char(int c) {
249249
return -1;
250250
}
251251

252-
void readline_note_newline() {
252+
void readline_note_newline(void) {
253253
rl.orig_line_len = rl.line->len;
254254
rl.cursor_pos = rl.orig_line_len;
255255
}

py/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ void *gc_realloc(void *ptr_in, mp_uint_t n_bytes) {
649649
}
650650
#endif // Alternative gc_realloc impl
651651

652-
void gc_dump_info() {
652+
void gc_dump_info(void) {
653653
gc_info_t info;
654654
gc_info(&info);
655655
printf("GC: total: " UINT_FMT ", used: " UINT_FMT ", free: " UINT_FMT "\n", info.total, info.used, info.free);

py/modmicropython.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@
3737
#if MICROPY_PY_MICROPYTHON_MEM_INFO
3838

3939
#if MICROPY_MEM_STATS
40-
STATIC mp_obj_t mp_micropython_mem_total() {
40+
STATIC mp_obj_t mp_micropython_mem_total(void) {
4141
return MP_OBJ_NEW_SMALL_INT(m_get_total_bytes_allocated());
4242
}
4343
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_total_obj, mp_micropython_mem_total);
4444

45-
STATIC mp_obj_t mp_micropython_mem_current() {
45+
STATIC mp_obj_t mp_micropython_mem_current(void) {
4646
return MP_OBJ_NEW_SMALL_INT(m_get_current_bytes_allocated());
4747
}
4848
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_current_obj, mp_micropython_mem_current);
4949

50-
STATIC mp_obj_t mp_micropython_mem_peak() {
50+
STATIC mp_obj_t mp_micropython_mem_peak(void) {
5151
return MP_OBJ_NEW_SMALL_INT(m_get_peak_bytes_allocated());
5252
}
5353
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_peak_obj, mp_micropython_mem_peak);

unix/modtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void msec_sleep_tv(struct timeval *tv) {
5757
#error Unsupported clock() implementation
5858
#endif
5959

60-
STATIC mp_obj_t mod_time_time() {
60+
STATIC mp_obj_t mod_time_time(void) {
6161
#if MICROPY_PY_BUILTINS_FLOAT
6262
struct timeval tv;
6363
gettimeofday(&tv, NULL);
@@ -70,7 +70,7 @@ STATIC mp_obj_t mod_time_time() {
7070
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_time_time_obj, mod_time_time);
7171

7272
// Note: this is deprecated since CPy3.3, but pystone still uses it.
73-
STATIC mp_obj_t mod_time_clock() {
73+
STATIC mp_obj_t mod_time_clock(void) {
7474
#if MICROPY_PY_BUILTINS_FLOAT
7575
// float cannot represent full range of int32 precisely, so we pre-divide
7676
// int to reduce resolution, and then actually do float division hoping

0 commit comments

Comments
 (0)