summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-03-08 14:10:02 +1100
committerDamien George <damien@micropython.org>2023-04-27 18:03:06 +1000
commitb1229efbd1509654dec6053865ab828d769e29db (patch)
treee1a65606dd1f0a8cfe2af08f9c4ff821fb575b02 /py
parente160fe7bc64212a3ce56f5478f208e2b4d343a8b (diff)
all: Fix spelling mistakes based on codespell check.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r--py/asmbase.c2
-rw-r--r--py/asmthumb.c2
-rw-r--r--py/compile.c2
-rw-r--r--py/emitbc.c2
-rw-r--r--py/emitnative.c2
-rw-r--r--py/formatfloat.c2
-rw-r--r--py/gc.c4
-rw-r--r--py/makecompresseddata.py2
-rw-r--r--py/mkrules.mk4
-rw-r--r--py/modbuiltins.c2
-rw-r--r--py/objexcept.c2
-rw-r--r--py/objtype.c2
-rw-r--r--py/parse.c4
-rw-r--r--py/runtime.c2
-rw-r--r--py/scope.h2
-rw-r--r--py/sequence.c2
16 files changed, 19 insertions, 19 deletions
diff --git a/py/asmbase.c b/py/asmbase.c
index da4273506..cf64e3f3d 100644
--- a/py/asmbase.c
+++ b/py/asmbase.c
@@ -80,7 +80,7 @@ uint8_t *mp_asm_base_get_cur_to_write_bytes(void *as_in, size_t num_bytes_to_wri
void mp_asm_base_label_assign(mp_asm_base_t *as, size_t label) {
assert(label < as->max_num_labels);
- // Assiging a label ends any dead-code region, and all following machine
+ // Assigning a label ends any dead-code region, and all following machine
// code should be emitted (until another mp_asm_base_suppress_code() call).
as->suppress = false;
diff --git a/py/asmthumb.c b/py/asmthumb.c
index 49574c43a..395134028 100644
--- a/py/asmthumb.c
+++ b/py/asmthumb.c
@@ -290,7 +290,7 @@ bool asm_thumb_b_n_label(asm_thumb_t *as, uint label) {
#define OP_BCC_N(cond, byte_offset) (0xd000 | ((cond) << 8) | (((byte_offset) >> 1) & 0x00ff))
-// all these bit arithmetics need coverage testing!
+// all these bit-arithmetic operations need coverage testing!
#define OP_BCC_W_HI(cond, byte_offset) (0xf000 | ((cond) << 6) | (((byte_offset) >> 10) & 0x0400) | (((byte_offset) >> 14) & 0x003f))
#define OP_BCC_W_LO(byte_offset) (0x8000 | ((byte_offset) & 0x2000) | (((byte_offset) >> 1) & 0x0fff))
diff --git a/py/compile.c b/py/compile.c
index 7a1660b1b..c95371108 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -3493,7 +3493,7 @@ void mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_file, bool
}
}
- // update maximim number of labels needed
+ // update maximum number of labels needed
if (comp->next_label > max_num_labels) {
max_num_labels = comp->next_label;
}
diff --git a/py/emitbc.c b/py/emitbc.c
index 70a4d8b12..a07657408 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -439,7 +439,7 @@ void mp_emit_bc_set_source_line(emit_t *emit, mp_uint_t source_line) {
}
void mp_emit_bc_label_assign(emit_t *emit, mp_uint_t l) {
- // Assiging a label ends any dead-code region, and all following opcodes
+ // Assigning a label ends any dead-code region, and all following opcodes
// should be emitted (until another unconditional flow control).
emit->suppress = false;
diff --git a/py/emitnative.c b/py/emitnative.c
index 3cb003315..c6e615009 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -894,7 +894,7 @@ STATIC void emit_access_stack(emit_t *emit, int pos, vtype_kind_t *vtype, int re
}
// does an efficient X=pop(); discard(); push(X)
-// needs a (non-temp) register in case the poped element was stored in the stack
+// needs a (non-temp) register in case the popped element was stored in the stack
STATIC void emit_fold_stack_top(emit_t *emit, int reg_dest) {
stack_info_t *si = &emit->stack_info[emit->stack_size - 2];
si[0] = si[1];
diff --git a/py/formatfloat.c b/py/formatfloat.c
index fc1b2fe7f..050d3a9df 100644
--- a/py/formatfloat.c
+++ b/py/formatfloat.c
@@ -39,7 +39,7 @@
Routine for converting a arbitrary floating
point number into a string.
- The code in this funcion was inspired from Fred Bayer's pdouble.c.
+ The code in this function was inspired from Fred Bayer's pdouble.c.
Since pdouble.c was released as Public Domain, I'm releasing this
code as public domain as well.
diff --git a/py/gc.c b/py/gc.c
index ad3e11040..0873a0e11 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -150,10 +150,10 @@ STATIC void gc_setup_area(mp_state_mem_area_t *area, void *start, void *end) {
#endif
#if MICROPY_ENABLE_FINALISER
- // clear ATBs and FTBs
+ // clear ATB's and FTB's
memset(area->gc_alloc_table_start, 0, gc_finaliser_table_byte_len + area->gc_alloc_table_byte_len + ALLOC_TABLE_GAP_BYTE);
#else
- // clear ATBs
+ // clear ATB's
memset(area->gc_alloc_table_start, 0, area->gc_alloc_table_byte_len + ALLOC_TABLE_GAP_BYTE);
#endif
diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py
index 9603de871..1bce3e8e8 100644
--- a/py/makecompresseddata.py
+++ b/py/makecompresseddata.py
@@ -24,7 +24,7 @@ def check_non_ascii(msg):
# Replace <char><space> with <char | 0x80>.
-# Trival scheme to demo/test.
+# Trivial scheme to demo/test.
def space_compression(error_strings):
for line in error_strings:
check_non_ascii(line)
diff --git a/py/mkrules.mk b/py/mkrules.mk
index a58bd2ee0..aa7f77bd2 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -34,7 +34,7 @@ QSTR_GEN_CXXFLAGS += $(QSTR_GEN_FLAGS)
# tree.
#
# So for example, py/map.c would have an object file name py/map.o
-# The object files will go into the build directory and mantain the same
+# The object files will go into the build directory and maintain the same
# directory structure as the source tree. So the final dependency will look
# like this:
#
@@ -192,7 +192,7 @@ endif
ifneq ($(PROG),)
# Build a standalone executable (unix does this)
-# The executable should have an .exe extension for builds targetting 'pure'
+# The executable should have an .exe extension for builds targeting 'pure'
# Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc.
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
diff --git a/py/modbuiltins.c b/py/modbuiltins.c
index 06e9f1acb..da29e5b67 100644
--- a/py/modbuiltins.c
+++ b/py/modbuiltins.c
@@ -79,7 +79,7 @@ STATIC mp_obj_t mp_builtin___build_class__(size_t n_args, const mp_obj_t *args)
meta_args[2] = class_locals; // dict of members
mp_obj_t new_class = mp_call_function_n_kw(meta, 3, 0, meta_args);
- // store into cell if neede
+ // store into cell if needed
if (cell != mp_const_none) {
mp_obj_cell_set(cell, new_class);
}
diff --git a/py/objexcept.c b/py/objexcept.c
index 515cbe742..cc0ddd9dc 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -217,7 +217,7 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, siz
mp_obj_tuple_t *o_tuple;
if (n_args == 0) {
- // No args, can use the empty tuple straightaway
+ // No args, can use the empty tuple straight away
o_tuple = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj;
} else {
// Try to allocate memory for the tuple containing the args
diff --git a/py/objtype.c b/py/objtype.c
index 909fc8339..7f71968ea 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -619,7 +619,7 @@ STATIC void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des
mp_obj_t member = dest[0];
if (member != MP_OBJ_NULL) {
if (!(self->base.type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS)) {
- // Class doesn't have any special accessors to check so return straightaway
+ // Class doesn't have any special accessors to check so return straight away
return;
}
diff --git a/py/parse.c b/py/parse.c
index 62de3282b..c228d3a34 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -553,7 +553,7 @@ STATIC mp_parse_node_t make_node_const_object(parser_t *parser, size_t src_line,
return (mp_parse_node_t)pn;
}
-// Create a parse node represeting a constant object, possibly optimising the case of
+// Create a parse node representing a constant object, possibly optimising the case of
// an integer, by putting the (small) integer value directly in the parse node itself.
STATIC mp_parse_node_t make_node_const_object_optimised(parser_t *parser, size_t src_line, mp_obj_t obj) {
if (mp_obj_is_small_int(obj)) {
@@ -1002,7 +1002,7 @@ STATIC void push_result_rule(parser_t *parser, size_t src_line, uint8_t rule_id,
#if MICROPY_COMP_CONST_TUPLE
if (build_tuple(parser, src_line, rule_id, num_args)) {
- // we built a tuple from this rule so return straightaway
+ // we built a tuple from this rule so return straight away
return;
}
#endif
diff --git a/py/runtime.c b/py/runtime.c
index 23fae6041..3c7c0350c 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -450,7 +450,7 @@ mp_obj_t MICROPY_WRAP_MP_BINARY_OP(mp_binary_op)(mp_binary_op_t op, mp_obj_t lhs
} else {
// standard precision is enough for right-shift
if (rhs_val >= (mp_int_t)(sizeof(lhs_val) * MP_BITS_PER_BYTE)) {
- // Shifting to big amounts is underfined behavior
+ // Shifting to big amounts is undefined behavior
// in C and is CPU-dependent; propagate sign bit.
rhs_val = sizeof(lhs_val) * MP_BITS_PER_BYTE - 1;
}
diff --git a/py/scope.h b/py/scope.h
index b781dde42..e7d2a304f 100644
--- a/py/scope.h
+++ b/py/scope.h
@@ -50,7 +50,7 @@ typedef struct _id_info_t {
uint8_t kind;
uint8_t flags;
// when it's an ID_INFO_KIND_LOCAL this is the unique number of the local
- // whet it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable
+ // when it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable
uint16_t local_num;
qstr qst;
} id_info_t;
diff --git a/py/sequence.c b/py/sequence.c
index fa660a338..583860743 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -156,7 +156,7 @@ bool mp_seq_cmp_objs(mp_uint_t op, const mp_obj_t *items1, size_t len1, const mp
continue;
}
- // Othewise, if they are not equal, we can have final decision based on them
+ // Otherwise, if they are not equal, we can have final decision based on them
if (op == MP_BINARY_OP_EQUAL) {
// In particular, if we are checking for equality, here're the answer
return false;