all: Reformat C and Python source code with tools/codeformat.py.

This is run with uncrustify 0.70.1, and black 19.10b0.
This commit is contained in:
Damien George
2020-02-27 15:36:53 +11:00
parent 3f39d18c2b
commit 69661f3343
539 changed files with 10496 additions and 8254 deletions

View File

@@ -82,10 +82,10 @@ int mp_js_process_char(int c) {
void mp_js_init(int heap_size) {
int stack_dummy;
stack_top = (char*)&stack_dummy;
stack_top = (char *)&stack_dummy;
#if MICROPY_ENABLE_GC
char *heap = (char*)malloc(heap_size * sizeof(char));
char *heap = (char *)malloc(heap_size * sizeof(char));
gc_init(heap, heap + heap_size);
#endif
@@ -95,7 +95,7 @@ void mp_js_init(int heap_size) {
#endif
mp_init();
mp_obj_list_init(mp_sys_path, 0);
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_));
mp_obj_list_init(mp_sys_argv, 0);
@@ -113,7 +113,7 @@ void gc_collect(void) {
longjmp(dummy, 1);
}
gc_collect_start();
gc_collect_root((void*)stack_top, ((mp_uint_t)(void*)(&dummy + 1) - (mp_uint_t)stack_top) / sizeof(mp_uint_t));
gc_collect_root((void *)stack_top, ((mp_uint_t)(void *)(&dummy + 1) - (mp_uint_t)stack_top) / sizeof(mp_uint_t));
gc_collect_end();
}
@@ -131,11 +131,15 @@ mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
void nlr_jump_fail(void *val) {
while (1);
while (1) {
;
}
}
void NORETURN __fatal_error(const char *msg) {
while (1);
while (1) {
;
}
}
#ifndef NDEBUG

View File

@@ -52,5 +52,5 @@ STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
const mp_obj_module_t mp_module_utime = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&time_module_globals,
.globals = (mp_obj_dict_t *)&time_module_globals,
};

View File

@@ -162,7 +162,7 @@ extern const struct _mp_obj_module_t mp_module_utime;
vm_hook_divisor = MICROPY_VM_HOOK_COUNT; \
extern void mp_js_hook(void); \
mp_js_hook(); \
}
}
#define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL
#define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL