summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-04-16 09:13:57 +0200
committerDamien George <damien.p.george@gmail.com>2020-04-23 11:24:25 +1000
commit84fa3312cfa7d2237d4b56952f2cd6e3591210c4 (patch)
treedc2b3e67bad9969fc5792ca0822798d58addf174 /py
parentd6243568a05d423b58522435c3779975acbf56dd (diff)
downloadmicropython-84fa3312cfa7d2237d4b56952f2cd6e3591210c4.tar.gz
micropython-84fa3312cfa7d2237d4b56952f2cd6e3591210c4.zip
all: Format code to add space after C++-style comment start.
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
Diffstat (limited to 'py')
-rw-r--r--py/asmx64.c12
-rw-r--r--py/asmx86.c20
-rw-r--r--py/bc.h2
-rw-r--r--py/builtinimport.c2
-rw-r--r--py/compile.c6
-rw-r--r--py/emitbc.c2
-rw-r--r--py/gc.c4
-rw-r--r--py/modcmath.c26
-rw-r--r--py/modmath.c4
-rw-r--r--py/moduerrno.c2
-rw-r--r--py/mpconfig.h2
-rw-r--r--py/mpz.c2
-rw-r--r--py/objnamedtuple.c2
-rw-r--r--py/objstr.c8
-rw-r--r--py/objtype.c2
-rw-r--r--py/parse.c2
-rw-r--r--py/runtime.c4
17 files changed, 51 insertions, 51 deletions
diff --git a/py/asmx64.c b/py/asmx64.c
index f52b028a0b..723671d5a3 100644
--- a/py/asmx64.c
+++ b/py/asmx64.c
@@ -63,15 +63,15 @@
#define OPCODE_SUB_R64_FROM_RM64 (0x29)
#define OPCODE_SUB_I32_FROM_RM64 (0x81) /* /5 */
#define OPCODE_SUB_I8_FROM_RM64 (0x83) /* /5 */
-//#define OPCODE_SHL_RM32_BY_I8 (0xc1) /* /4 */
-//#define OPCODE_SHR_RM32_BY_I8 (0xc1) /* /5 */
-//#define OPCODE_SAR_RM32_BY_I8 (0xc1) /* /7 */
+// #define OPCODE_SHL_RM32_BY_I8 (0xc1) /* /4 */
+// #define OPCODE_SHR_RM32_BY_I8 (0xc1) /* /5 */
+// #define OPCODE_SAR_RM32_BY_I8 (0xc1) /* /7 */
#define OPCODE_SHL_RM64_CL (0xd3) /* /4 */
#define OPCODE_SAR_RM64_CL (0xd3) /* /7 */
-//#define OPCODE_CMP_I32_WITH_RM32 (0x81) /* /7 */
-//#define OPCODE_CMP_I8_WITH_RM32 (0x83) /* /7 */
+// #define OPCODE_CMP_I32_WITH_RM32 (0x81) /* /7 */
+// #define OPCODE_CMP_I8_WITH_RM32 (0x83) /* /7 */
#define OPCODE_CMP_R64_WITH_RM64 (0x39) /* /r */
-//#define OPCODE_CMP_RM32_WITH_R32 (0x3b)
+// #define OPCODE_CMP_RM32_WITH_R32 (0x3b)
#define OPCODE_TEST_R8_WITH_RM8 (0x84) /* /r */
#define OPCODE_TEST_R64_WITH_RM64 (0x85) /* /r */
#define OPCODE_JMP_REL8 (0xeb)
diff --git a/py/asmx86.c b/py/asmx86.c
index 4a8be3f793..96de372aec 100644
--- a/py/asmx86.c
+++ b/py/asmx86.c
@@ -41,13 +41,13 @@
#define OPCODE_NOP (0x90)
#define OPCODE_PUSH_R32 (0x50)
-//#define OPCODE_PUSH_I32 (0x68)
-//#define OPCODE_PUSH_M32 (0xff) /* /6 */
+// #define OPCODE_PUSH_I32 (0x68)
+// #define OPCODE_PUSH_M32 (0xff) /* /6 */
#define OPCODE_POP_R32 (0x58)
#define OPCODE_RET (0xc3)
-//#define OPCODE_MOV_I8_TO_R8 (0xb0) /* +rb */
+// #define OPCODE_MOV_I8_TO_R8 (0xb0) /* +rb */
#define OPCODE_MOV_I32_TO_R32 (0xb8)
-//#define OPCODE_MOV_I32_TO_RM32 (0xc7)
+// #define OPCODE_MOV_I32_TO_RM32 (0xc7)
#define OPCODE_MOV_R8_TO_RM8 (0x88) /* /r */
#define OPCODE_MOV_R32_TO_RM32 (0x89) /* /r */
#define OPCODE_MOV_RM32_TO_R32 (0x8b) /* /r */
@@ -63,15 +63,15 @@
#define OPCODE_SUB_R32_FROM_RM32 (0x29)
#define OPCODE_SUB_I32_FROM_RM32 (0x81) /* /5 */
#define OPCODE_SUB_I8_FROM_RM32 (0x83) /* /5 */
-//#define OPCODE_SHL_RM32_BY_I8 (0xc1) /* /4 */
-//#define OPCODE_SHR_RM32_BY_I8 (0xc1) /* /5 */
-//#define OPCODE_SAR_RM32_BY_I8 (0xc1) /* /7 */
+// #define OPCODE_SHL_RM32_BY_I8 (0xc1) /* /4 */
+// #define OPCODE_SHR_RM32_BY_I8 (0xc1) /* /5 */
+// #define OPCODE_SAR_RM32_BY_I8 (0xc1) /* /7 */
#define OPCODE_SHL_RM32_CL (0xd3) /* /4 */
#define OPCODE_SAR_RM32_CL (0xd3) /* /7 */
-//#define OPCODE_CMP_I32_WITH_RM32 (0x81) /* /7 */
-//#define OPCODE_CMP_I8_WITH_RM32 (0x83) /* /7 */
+// #define OPCODE_CMP_I32_WITH_RM32 (0x81) /* /7 */
+// #define OPCODE_CMP_I8_WITH_RM32 (0x83) /* /7 */
#define OPCODE_CMP_R32_WITH_RM32 (0x39)
-//#define OPCODE_CMP_RM32_WITH_R32 (0x3b)
+// #define OPCODE_CMP_RM32_WITH_R32 (0x3b)
#define OPCODE_TEST_R8_WITH_RM8 (0x84) /* /r */
#define OPCODE_TEST_R32_WITH_RM32 (0x85) /* /r */
#define OPCODE_JMP_REL8 (0xeb)
diff --git a/py/bc.h b/py/bc.h
index 65af407006..0c19c51659 100644
--- a/py/bc.h
+++ b/py/bc.h
@@ -216,7 +216,7 @@ typedef struct _mp_code_state_t {
// Variable-length
mp_obj_t state[0];
// Variable-length, never accessed by name, only as (void*)(state + n_state)
- //mp_exc_stack_t exc_state[0];
+ // mp_exc_stack_t exc_state[0];
} mp_code_state_t;
mp_uint_t mp_decode_uint(const byte **ptr);
diff --git a/py/builtinimport.c b/py/builtinimport.c
index 28a8f41f75..bdc82e77c8 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -440,7 +440,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
vstr_add_char(&path, PATH_SEP_CHAR);
vstr_add_str(&path, "__init__.py");
if (stat_file_py_or_mpy(&path) != MP_IMPORT_STAT_FILE) {
- //mp_warning("%s is imported as namespace package", vstr_str(&path));
+ // mp_warning("%s is imported as namespace package", vstr_str(&path));
} else {
do_load(module_obj, &path);
}
diff --git a/py/compile.c b/py/compile.c
index 4ce69c4159..078b92fc20 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -682,7 +682,7 @@ STATIC void compile_funcdef_lambdef_param(compiler_t *comp, mp_parse_node_t pn)
mp_parse_node_struct_t *pns = (mp_parse_node_struct_t *)pn;
pn_id = pns->nodes[0];
- //pn_colon = pns->nodes[1]; // unused
+ // pn_colon = pns->nodes[1]; // unused
pn_equal = pns->nodes[2];
} else {
@@ -2874,7 +2874,7 @@ STATIC void compile_scope_func_lambda_param(compiler_t *comp, mp_parse_node_t pn
if (MP_PARSE_NODE_IS_NULL(pns->nodes[0])) {
// bare star
// TODO see http://www.python.org/dev/peps/pep-3102/
- //assert(comp->scope_cur->num_dict_params == 0);
+ // assert(comp->scope_cur->num_dict_params == 0);
pns = NULL;
} else if (MP_PARSE_NODE_IS_ID(pns->nodes[0])) {
// named star
@@ -3192,7 +3192,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
mp_parse_node_struct_t *pns = (mp_parse_node_struct_t *)scope->pn;
assert(MP_PARSE_NODE_STRUCT_KIND(pns) == PN_funcdef);
- //qstr f_id = MP_PARSE_NODE_LEAF_ARG(pns->nodes[0]); // function name
+ // qstr f_id = MP_PARSE_NODE_LEAF_ARG(pns->nodes[0]); // function name
// parameters are in pns->nodes[1]
if (comp->pass == MP_PASS_CODE_SIZE) {
diff --git a/py/emitbc.c b/py/emitbc.c
index e90c28cb8d..c74b7fbc4d 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -940,4 +940,4 @@ const mp_emit_method_table_id_ops_t mp_emit_bc_method_table_delete_id_ops = {
};
#endif
-#endif //MICROPY_ENABLE_COMPILER
+#endif // MICROPY_ENABLE_COMPILER
diff --git a/py/gc.c b/py/gc.c
index 7d159ad062..9c6336852a 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -834,7 +834,7 @@ void gc_dump_alloc_table(void) {
}
// print header for new line of blocks
// (the cast to uint32_t is for 16-bit ports)
- //mp_printf(&mp_plat_print, "\n%05x: ", (uint)(PTR_FROM_BLOCK(bl) & (uint32_t)0xfffff));
+ // mp_printf(&mp_plat_print, "\n%05x: ", (uint)(PTR_FROM_BLOCK(bl) & (uint32_t)0xfffff));
mp_printf(&mp_plat_print, "\n%05x: ", (uint)((bl * BYTES_PER_BLOCK) & (uint32_t)0xfffff));
}
int c = ' ';
@@ -956,7 +956,7 @@ void gc_test(void) {
mp_uint_t *p = gc_alloc(i, false);
printf("p=%p\n", p);
if (i & 3) {
- //ptrs[i] = p;
+ // ptrs[i] = p;
}
}
diff --git a/py/modcmath.c b/py/modcmath.c
index f1ce8fb5df..fb1f2a8fc2 100644
--- a/py/modcmath.c
+++ b/py/modcmath.c
@@ -125,21 +125,21 @@ STATIC const mp_rom_map_elem_t mp_module_cmath_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_log10), MP_ROM_PTR(&mp_cmath_log10_obj) },
#endif
{ MP_ROM_QSTR(MP_QSTR_sqrt), MP_ROM_PTR(&mp_cmath_sqrt_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_acos), MP_ROM_PTR(&mp_cmath_acos_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_asin), MP_ROM_PTR(&mp_cmath_asin_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_atan), MP_ROM_PTR(&mp_cmath_atan_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_acos), MP_ROM_PTR(&mp_cmath_acos_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_asin), MP_ROM_PTR(&mp_cmath_asin_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_atan), MP_ROM_PTR(&mp_cmath_atan_obj) },
{ MP_ROM_QSTR(MP_QSTR_cos), MP_ROM_PTR(&mp_cmath_cos_obj) },
{ MP_ROM_QSTR(MP_QSTR_sin), MP_ROM_PTR(&mp_cmath_sin_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_tan), MP_ROM_PTR(&mp_cmath_tan_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_acosh), MP_ROM_PTR(&mp_cmath_acosh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_asinh), MP_ROM_PTR(&mp_cmath_asinh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_atanh), MP_ROM_PTR(&mp_cmath_atanh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_cosh), MP_ROM_PTR(&mp_cmath_cosh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_sinh), MP_ROM_PTR(&mp_cmath_sinh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_tanh), MP_ROM_PTR(&mp_cmath_tanh_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_isfinite), MP_ROM_PTR(&mp_cmath_isfinite_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_isinf), MP_ROM_PTR(&mp_cmath_isinf_obj) },
- //{ MP_ROM_QSTR(MP_QSTR_isnan), MP_ROM_PTR(&mp_cmath_isnan_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_tan), MP_ROM_PTR(&mp_cmath_tan_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_acosh), MP_ROM_PTR(&mp_cmath_acosh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_asinh), MP_ROM_PTR(&mp_cmath_asinh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_atanh), MP_ROM_PTR(&mp_cmath_atanh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_cosh), MP_ROM_PTR(&mp_cmath_cosh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_sinh), MP_ROM_PTR(&mp_cmath_sinh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_tanh), MP_ROM_PTR(&mp_cmath_tanh_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_isfinite), MP_ROM_PTR(&mp_cmath_isfinite_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_isinf), MP_ROM_PTR(&mp_cmath_isinf_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_isnan), MP_ROM_PTR(&mp_cmath_isnan_obj) },
};
STATIC MP_DEFINE_CONST_DICT(mp_module_cmath_globals, mp_module_cmath_globals_table);
diff --git a/py/modmath.c b/py/modmath.c
index f6f43b4ad8..5ff892ba11 100644
--- a/py/modmath.c
+++ b/py/modmath.c
@@ -146,7 +146,7 @@ STATIC mp_float_t MICROPY_FLOAT_C_FUN(fabs_func)(mp_float_t x) {
}
MATH_FUN_1(fabs, fabs_func)
// floor(x)
-MATH_FUN_1_TO_INT(floor, floor) //TODO: delegate to x.__floor__() if x is not a float
+MATH_FUN_1_TO_INT(floor, floor) // TODO: delegate to x.__floor__() if x is not a float
// fmod(x, y)
MATH_FUN_2(fmod, fmod)
// isfinite(x)
@@ -169,7 +169,7 @@ MATH_FUN_1(gamma, tgamma)
// lgamma(x): return the natural logarithm of the gamma function of x
MATH_FUN_1(lgamma, lgamma)
#endif
-//TODO: fsum
+// TODO: fsum
#if MICROPY_PY_MATH_ISCLOSE
STATIC mp_obj_t mp_math_isclose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
diff --git a/py/moduerrno.c b/py/moduerrno.c
index 93a08d8bf6..d9affd9b20 100644
--- a/py/moduerrno.c
+++ b/py/moduerrno.c
@@ -119,4 +119,4 @@ qstr mp_errno_to_str(mp_obj_t errno_val) {
#endif
}
-#endif //MICROPY_PY_UERRNO
+#endif // MICROPY_PY_UERRNO
diff --git a/py/mpconfig.h b/py/mpconfig.h
index c2352bbdd2..1327d8b027 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1556,7 +1556,7 @@ typedef double mp_float_t;
#define UINT_FMT "%u"
#define INT_FMT "%d"
#endif
-#endif //INT_FMT
+#endif // INT_FMT
// Modifier for function which doesn't return
#ifndef NORETURN
diff --git a/py/mpz.c b/py/mpz.c
index fb9ac6e9e6..b3d8806792 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -852,7 +852,7 @@ size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, unsigne
z->len = 0;
for (; cur < top; ++cur) { // XXX UTF8 next char
- //mp_uint_t v = char_to_numeric(cur#); // XXX UTF8 get char
+ // mp_uint_t v = char_to_numeric(cur#); // XXX UTF8 get char
mp_uint_t v = *cur;
if ('0' <= v && v <= '9') {
v -= '0';
diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c
index 48111b0b45..e4543f5b9b 100644
--- a/py/objnamedtuple.c
+++ b/py/objnamedtuple.c
@@ -48,7 +48,7 @@ STATIC mp_obj_t namedtuple_asdict(mp_obj_t self_in) {
mp_obj_namedtuple_t *self = MP_OBJ_TO_PTR(self_in);
const qstr *fields = ((mp_obj_namedtuple_type_t *)self->tuple.base.type)->fields;
mp_obj_t dict = mp_obj_new_dict(self->tuple.len);
- //make it an OrderedDict
+ // make it an OrderedDict
mp_obj_dict_t *dictObj = MP_OBJ_TO_PTR(dict);
dictObj->base.type = &mp_type_ordereddict;
dictObj->map.is_ordered = 1;
diff --git a/py/objstr.c b/py/objstr.c
index 548fa1bb3b..a276a255e5 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -284,11 +284,11 @@ const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle,
}
for (;;) {
if (memcmp(&haystack[str_index], needle, nlen) == 0) {
- //found
+ // found
return haystack + str_index;
}
if (str_index == str_index_end) {
- //not found
+ // not found
break;
}
str_index += direction;
@@ -396,7 +396,7 @@ mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
case MP_BINARY_OP_CONTAINS:
return mp_obj_new_bool(find_subbytes(lhs_data, lhs_len, rhs_data, rhs_len, 1) != NULL);
- //case MP_BINARY_OP_NOT_EQUAL: // This is never passed here
+ // case MP_BINARY_OP_NOT_EQUAL: // This is never passed here
case MP_BINARY_OP_EQUAL: // This will be passed only for bytes, str is dealt with in mp_obj_equal()
case MP_BINARY_OP_LESS:
case MP_BINARY_OP_LESS_EQUAL:
@@ -849,7 +849,7 @@ STATIC mp_obj_t str_uni_strip(int type, size_t n_args, const mp_obj_t *args) {
}
assert(last_good_char_pos >= first_good_char_pos);
- //+1 to accommodate the last character
+ // +1 to accommodate the last character
size_t stripped_len = last_good_char_pos - first_good_char_pos + 1;
if (stripped_len == orig_str_len) {
// If nothing was stripped, don't bother to dup original string
diff --git a/py/objtype.c b/py/objtype.c
index a8eeb1a9f7..d08c69e284 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -1137,7 +1137,7 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict)
o->attr = mp_obj_instance_attr;
o->subscr = instance_subscr;
o->getiter = mp_obj_instance_getiter;
- //o->iternext = ; not implemented
+ // o->iternext = ; not implemented
o->buffer_p.get_buffer = instance_get_buffer;
if (bases_len > 0) {
diff --git a/py/parse.c b/py/parse.c
index bb18904d78..35f06afea6 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -56,7 +56,7 @@
#define RULE_ARG_OPT_RULE (0x3000)
// (un)comment to use rule names; for debugging
-//#define USE_RULE_NAME (1)
+// #define USE_RULE_NAME (1)
// *FORMAT-OFF*
diff --git a/py/runtime.c b/py/runtime.c
index 79ca45fb18..157bc74a8d 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -152,8 +152,8 @@ void mp_deinit(void) {
MICROPY_PORT_DEINIT_FUNC;
#endif
- //mp_obj_dict_free(&dict_main);
- //mp_map_deinit(&MP_STATE_VM(mp_loaded_modules_map));
+ // mp_obj_dict_free(&dict_main);
+ // mp_map_deinit(&MP_STATE_VM(mp_loaded_modules_map));
}
mp_obj_t mp_load_name(qstr qst) {