py, unix, lib: Allow to compile with -Wold-style-definition.

This commit is contained in:
Damien George 2015-01-12 22:34:38 +00:00
parent cd34207409
commit abc1959e2c
5 changed files with 8 additions and 8 deletions

View File

@ -117,7 +117,7 @@ typedef struct _mp_obj_uctypes_struct_t {
uint32_t flags; uint32_t flags;
} mp_obj_uctypes_struct_t; } mp_obj_uctypes_struct_t;
STATIC NORETURN void syntax_error() { STATIC NORETURN void syntax_error(void) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor")); nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor"));
} }

View File

@ -249,7 +249,7 @@ end_key:
return -1; return -1;
} }
void readline_note_newline() { void readline_note_newline(void) {
rl.orig_line_len = rl.line->len; rl.orig_line_len = rl.line->len;
rl.cursor_pos = rl.orig_line_len; rl.cursor_pos = rl.orig_line_len;
} }

View File

@ -649,7 +649,7 @@ void *gc_realloc(void *ptr_in, mp_uint_t n_bytes) {
} }
#endif // Alternative gc_realloc impl #endif // Alternative gc_realloc impl
void gc_dump_info() { void gc_dump_info(void) {
gc_info_t info; gc_info_t info;
gc_info(&info); gc_info(&info);
printf("GC: total: " UINT_FMT ", used: " UINT_FMT ", free: " UINT_FMT "\n", info.total, info.used, info.free); printf("GC: total: " UINT_FMT ", used: " UINT_FMT ", free: " UINT_FMT "\n", info.total, info.used, info.free);

View File

@ -37,17 +37,17 @@
#if MICROPY_PY_MICROPYTHON_MEM_INFO #if MICROPY_PY_MICROPYTHON_MEM_INFO
#if MICROPY_MEM_STATS #if MICROPY_MEM_STATS
STATIC mp_obj_t mp_micropython_mem_total() { STATIC mp_obj_t mp_micropython_mem_total(void) {
return MP_OBJ_NEW_SMALL_INT(m_get_total_bytes_allocated()); return MP_OBJ_NEW_SMALL_INT(m_get_total_bytes_allocated());
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_total_obj, mp_micropython_mem_total); STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_total_obj, mp_micropython_mem_total);
STATIC mp_obj_t mp_micropython_mem_current() { STATIC mp_obj_t mp_micropython_mem_current(void) {
return MP_OBJ_NEW_SMALL_INT(m_get_current_bytes_allocated()); return MP_OBJ_NEW_SMALL_INT(m_get_current_bytes_allocated());
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_current_obj, mp_micropython_mem_current); STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_current_obj, mp_micropython_mem_current);
STATIC mp_obj_t mp_micropython_mem_peak() { STATIC mp_obj_t mp_micropython_mem_peak(void) {
return MP_OBJ_NEW_SMALL_INT(m_get_peak_bytes_allocated()); return MP_OBJ_NEW_SMALL_INT(m_get_peak_bytes_allocated());
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_peak_obj, mp_micropython_mem_peak); STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_peak_obj, mp_micropython_mem_peak);

View File

@ -57,7 +57,7 @@ void msec_sleep_tv(struct timeval *tv) {
#error Unsupported clock() implementation #error Unsupported clock() implementation
#endif #endif
STATIC mp_obj_t mod_time_time() { STATIC mp_obj_t mod_time_time(void) {
#if MICROPY_PY_BUILTINS_FLOAT #if MICROPY_PY_BUILTINS_FLOAT
struct timeval tv; struct timeval tv;
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
@ -70,7 +70,7 @@ STATIC mp_obj_t mod_time_time() {
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_time_time_obj, mod_time_time); STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_time_time_obj, mod_time_time);
// Note: this is deprecated since CPy3.3, but pystone still uses it. // Note: this is deprecated since CPy3.3, but pystone still uses it.
STATIC mp_obj_t mod_time_clock() { STATIC mp_obj_t mod_time_clock(void) {
#if MICROPY_PY_BUILTINS_FLOAT #if MICROPY_PY_BUILTINS_FLOAT
// float cannot represent full range of int32 precisely, so we pre-divide // float cannot represent full range of int32 precisely, so we pre-divide
// int to reduce resolution, and then actually do float division hoping // int to reduce resolution, and then actually do float division hoping