all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
diff --git a/py/asmarm.h b/py/asmarm.h
index e273b98..c590092 100644
--- a/py/asmarm.h
+++ b/py/asmarm.h
@@ -24,8 +24,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_ASMARM_H__
-#define __MICROPY_INCLUDED_PY_ASMARM_H__
+#ifndef MICROPY_INCLUDED_PY_ASMARM_H
+#define MICROPY_INCLUDED_PY_ASMARM_H
#include "py/misc.h"
#include "py/asmbase.h"
@@ -202,4 +202,4 @@
#endif // GENERIC_ASM_API
-#endif // __MICROPY_INCLUDED_PY_ASMARM_H__
+#endif // MICROPY_INCLUDED_PY_ASMARM_H
diff --git a/py/asmthumb.h b/py/asmthumb.h
index 52e663b..589c481 100644
--- a/py/asmthumb.h
+++ b/py/asmthumb.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_ASMTHUMB_H__
-#define __MICROPY_INCLUDED_PY_ASMTHUMB_H__
+#ifndef MICROPY_INCLUDED_PY_ASMTHUMB_H
+#define MICROPY_INCLUDED_PY_ASMTHUMB_H
#include "py/misc.h"
#include "py/asmbase.h"
@@ -318,4 +318,4 @@
#endif // GENERIC_ASM_API
-#endif // __MICROPY_INCLUDED_PY_ASMTHUMB_H__
+#endif // MICROPY_INCLUDED_PY_ASMTHUMB_H
diff --git a/py/asmx64.h b/py/asmx64.h
index 4499c53..a384cca 100644
--- a/py/asmx64.h
+++ b/py/asmx64.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_ASMX64_H__
-#define __MICROPY_INCLUDED_PY_ASMX64_H__
+#ifndef MICROPY_INCLUDED_PY_ASMX64_H
+#define MICROPY_INCLUDED_PY_ASMX64_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -197,4 +197,4 @@
#endif // GENERIC_ASM_API
-#endif // __MICROPY_INCLUDED_PY_ASMX64_H__
+#endif // MICROPY_INCLUDED_PY_ASMX64_H
diff --git a/py/asmx86.h b/py/asmx86.h
index 0b44af6..fd34228 100644
--- a/py/asmx86.h
+++ b/py/asmx86.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_ASMX86_H__
-#define __MICROPY_INCLUDED_PY_ASMX86_H__
+#ifndef MICROPY_INCLUDED_PY_ASMX86_H
+#define MICROPY_INCLUDED_PY_ASMX86_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -195,4 +195,4 @@
#endif // GENERIC_ASM_API
-#endif // __MICROPY_INCLUDED_PY_ASMX86_H__
+#endif // MICROPY_INCLUDED_PY_ASMX86_H
diff --git a/py/bc.h b/py/bc.h
index 88045dc..c55d31f 100644
--- a/py/bc.h
+++ b/py/bc.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_BC_H__
-#define __MICROPY_INCLUDED_PY_BC_H__
+#ifndef MICROPY_INCLUDED_PY_BC_H
+#define MICROPY_INCLUDED_PY_BC_H
#include "py/runtime.h"
#include "py/obj.h"
@@ -119,4 +119,4 @@
#endif
-#endif // __MICROPY_INCLUDED_PY_BC_H__
+#endif // MICROPY_INCLUDED_PY_BC_H
diff --git a/py/bc0.h b/py/bc0.h
index b5650ab..be8ac6c 100644
--- a/py/bc0.h
+++ b/py/bc0.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_BC0_H__
-#define __MICROPY_INCLUDED_PY_BC0_H__
+#ifndef MICROPY_INCLUDED_PY_BC0_H
+#define MICROPY_INCLUDED_PY_BC0_H
// Micro Python byte-codes.
// The comment at the end of the line (if it exists) tells the arguments to the byte-code.
@@ -116,4 +116,4 @@
#define MP_BC_UNARY_OP_MULTI (0xd0) // + op(7)
#define MP_BC_BINARY_OP_MULTI (0xd7) // + op(36)
-#endif // __MICROPY_INCLUDED_PY_BC0_H__
+#endif // MICROPY_INCLUDED_PY_BC0_H
diff --git a/py/binary.h b/py/binary.h
index 997d878..04cc6d8 100644
--- a/py/binary.h
+++ b/py/binary.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_BINARY_H__
-#define __MICROPY_INCLUDED_PY_BINARY_H__
+#ifndef MICROPY_INCLUDED_PY_BINARY_H
+#define MICROPY_INCLUDED_PY_BINARY_H
#include "py/obj.h"
@@ -41,4 +41,4 @@
long long mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, const byte *src);
void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *dest, mp_uint_t val);
-#endif // __MICROPY_INCLUDED_PY_BINARY_H__
+#endif // MICROPY_INCLUDED_PY_BINARY_H
diff --git a/py/builtin.h b/py/builtin.h
index ec326d0..4915383 100644
--- a/py/builtin.h
+++ b/py/builtin.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_BUILTIN_H__
-#define __MICROPY_INCLUDED_PY_BUILTIN_H__
+#ifndef MICROPY_INCLUDED_PY_BUILTIN_H
+#define MICROPY_INCLUDED_PY_BUILTIN_H
#include "py/obj.h"
@@ -120,4 +120,4 @@
extern const char *MICROPY_PY_BUILTINS_HELP_TEXT;
-#endif // __MICROPY_INCLUDED_PY_BUILTIN_H__
+#endif // MICROPY_INCLUDED_PY_BUILTIN_H
diff --git a/py/compile.h b/py/compile.h
index 45a9858..f6b262d 100644
--- a/py/compile.h
+++ b/py/compile.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_COMPILE_H__
-#define __MICROPY_INCLUDED_PY_COMPILE_H__
+#ifndef MICROPY_INCLUDED_PY_COMPILE_H
+#define MICROPY_INCLUDED_PY_COMPILE_H
#include "py/lexer.h"
#include "py/parse.h"
@@ -51,4 +51,4 @@
// this is implemented in runtime.c
mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals);
-#endif // __MICROPY_INCLUDED_PY_COMPILE_H__
+#endif // MICROPY_INCLUDED_PY_COMPILE_H
diff --git a/py/emit.h b/py/emit.h
index 0236a9b..a58e20e 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -23,9 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
-#ifndef __MICROPY_INCLUDED_PY_EMIT_H__
-#define __MICROPY_INCLUDED_PY_EMIT_H__
+#ifndef MICROPY_INCLUDED_PY_EMIT_H
+#define MICROPY_INCLUDED_PY_EMIT_H
#include "py/lexer.h"
#include "py/scope.h"
@@ -284,4 +283,4 @@
#define mp_emitter_warning(pass, msg)
#endif
-#endif // __MICROPY_INCLUDED_PY_EMIT_H__
+#endif // MICROPY_INCLUDED_PY_EMIT_H
diff --git a/py/emitglue.h b/py/emitglue.h
index 37c4f1b..3099965 100644
--- a/py/emitglue.h
+++ b/py/emitglue.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_EMITGLUE_H__
-#define __MICROPY_INCLUDED_PY_EMITGLUE_H__
+#ifndef MICROPY_INCLUDED_PY_EMITGLUE_H
+#define MICROPY_INCLUDED_PY_EMITGLUE_H
#include "py/obj.h"
@@ -74,4 +74,4 @@
mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_args, mp_obj_t def_kw_args);
mp_obj_t mp_make_closure_from_raw_code(const mp_raw_code_t *rc, mp_uint_t n_closed_over, const mp_obj_t *args);
-#endif // __MICROPY_INCLUDED_PY_EMITGLUE_H__
+#endif // MICROPY_INCLUDED_PY_EMITGLUE_H
diff --git a/py/formatfloat.h b/py/formatfloat.h
index 0196034..9c8d137 100644
--- a/py/formatfloat.h
+++ b/py/formatfloat.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_FORMATFLOAT_H__
-#define __MICROPY_INCLUDED_PY_FORMATFLOAT_H__
+#ifndef MICROPY_INCLUDED_PY_FORMATFLOAT_H
+#define MICROPY_INCLUDED_PY_FORMATFLOAT_H
#include "py/mpconfig.h"
@@ -32,4 +32,4 @@
int mp_format_float(mp_float_t f, char *buf, size_t bufSize, char fmt, int prec, char sign);
#endif
-#endif // __MICROPY_INCLUDED_PY_FORMATFLOAT_H__
+#endif // MICROPY_INCLUDED_PY_FORMATFLOAT_H
diff --git a/py/frozenmod.h b/py/frozenmod.h
index 7c1299b..6993167 100644
--- a/py/frozenmod.h
+++ b/py/frozenmod.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_FROZENMOD_H__
-#define __MICROPY_INCLUDED_PY_FROZENMOD_H__
+#ifndef MICROPY_INCLUDED_PY_FROZENMOD_H
+#define MICROPY_INCLUDED_PY_FROZENMOD_H
#include "py/lexer.h"
@@ -38,4 +38,4 @@
const char *mp_find_frozen_str(const char *str, size_t *len);
mp_import_stat_t mp_frozen_stat(const char *str);
-#endif // __MICROPY_INCLUDED_PY_FROZENMOD_H__
+#endif // MICROPY_INCLUDED_PY_FROZENMOD_H
diff --git a/py/gc.h b/py/gc.h
index 7d8fe2b..1366955 100644
--- a/py/gc.h
+++ b/py/gc.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_GC_H__
-#define __MICROPY_INCLUDED_PY_GC_H__
+#ifndef MICROPY_INCLUDED_PY_GC_H
+#define MICROPY_INCLUDED_PY_GC_H
#include <stdint.h>
@@ -64,4 +64,4 @@
void gc_dump_info(void);
void gc_dump_alloc_table(void);
-#endif // __MICROPY_INCLUDED_PY_GC_H__
+#endif // MICROPY_INCLUDED_PY_GC_H
diff --git a/py/lexer.h b/py/lexer.h
index 5d998b3..435aa09 100644
--- a/py/lexer.h
+++ b/py/lexer.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_LEXER_H__
-#define __MICROPY_INCLUDED_PY_LEXER_H__
+#ifndef MICROPY_INCLUDED_PY_LEXER_H
+#define MICROPY_INCLUDED_PY_LEXER_H
#include <stdint.h>
@@ -192,4 +192,4 @@
mp_lexer_t *mp_lexer_new_from_fd(qstr filename, int fd, bool close_fd);
#endif
-#endif // __MICROPY_INCLUDED_PY_LEXER_H__
+#endif // MICROPY_INCLUDED_PY_LEXER_H
diff --git a/py/misc.h b/py/misc.h
index 5ac0f93..cebbd38 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MISC_H__
-#define __MICROPY_INCLUDED_PY_MISC_H__
+#ifndef MICROPY_INCLUDED_PY_MISC_H
+#define MICROPY_INCLUDED_PY_MISC_H
// a mini library of useful types and functions
@@ -223,4 +223,4 @@
#define MP_FLOAT_EXP_BIAS ((1 << (MP_FLOAT_EXP_BITS - 1)) - 1)
#endif // MICROPY_PY_BUILTINS_FLOAT
-#endif // __MICROPY_INCLUDED_PY_MISC_H__
+#endif // MICROPY_INCLUDED_PY_MISC_H
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 32d6482..fb507a5 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPCONFIG_H__
-#define __MICROPY_INCLUDED_PY_MPCONFIG_H__
+#ifndef MICROPY_INCLUDED_PY_MPCONFIG_H
+#define MICROPY_INCLUDED_PY_MPCONFIG_H
// This file contains default configuration settings for MicroPython.
// You can override any of the options below using mpconfigport.h file
@@ -1253,4 +1253,4 @@
#define MP_UNLIKELY(x) __builtin_expect((x), 0)
#endif
-#endif // __MICROPY_INCLUDED_PY_MPCONFIG_H__
+#endif // MICROPY_INCLUDED_PY_MPCONFIG_H
diff --git a/py/mperrno.h b/py/mperrno.h
index 6ea99ae..c515ed4 100644
--- a/py/mperrno.h
+++ b/py/mperrno.h
@@ -23,9 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
-#ifndef __MICROPY_INCLUDED_PY_MPERRNO_H__
-#define __MICROPY_INCLUDED_PY_MPERRNO_H__
+#ifndef MICROPY_INCLUDED_PY_MPERRNO_H
+#define MICROPY_INCLUDED_PY_MPERRNO_H
#if MICROPY_USE_INTERNAL_ERRNO
@@ -142,4 +141,4 @@
qstr mp_errno_to_str(mp_obj_t errno_val);
#endif
-#endif // __MICROPY_INCLUDED_PY_MPERRNO_H__
+#endif // MICROPY_INCLUDED_PY_MPERRNO_H
diff --git a/py/mphal.h b/py/mphal.h
index 8d5654f..93a0a40 100644
--- a/py/mphal.h
+++ b/py/mphal.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPHAL_H__
-#define __MICROPY_INCLUDED_PY_MPHAL_H__
+#ifndef MICROPY_INCLUDED_PY_MPHAL_H
+#define MICROPY_INCLUDED_PY_MPHAL_H
#include "py/mpconfig.h"
@@ -80,4 +80,4 @@
#include "extmod/virtpin.h"
#endif
-#endif // __MICROPY_INCLUDED_PY_MPHAL_H__
+#endif // MICROPY_INCLUDED_PY_MPHAL_H
diff --git a/py/mpprint.h b/py/mpprint.h
index 4fc904a..20bd875 100644
--- a/py/mpprint.h
+++ b/py/mpprint.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPPRINT_H__
-#define __MICROPY_INCLUDED_PY_MPPRINT_H__
+#ifndef MICROPY_INCLUDED_PY_MPPRINT_H
+#define MICROPY_INCLUDED_PY_MPPRINT_H
#include "py/mpconfig.h"
@@ -71,4 +71,4 @@
int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args);
#endif
-#endif // __MICROPY_INCLUDED_PY_MPPRINT_H__
+#endif // MICROPY_INCLUDED_PY_MPPRINT_H
diff --git a/py/mpstate.h b/py/mpstate.h
index 2b8f29a..b09ba08 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPSTATE_H__
-#define __MICROPY_INCLUDED_PY_MPSTATE_H__
+#ifndef MICROPY_INCLUDED_PY_MPSTATE_H
+#define MICROPY_INCLUDED_PY_MPSTATE_H
#include <stdint.h>
@@ -248,4 +248,4 @@
#define MP_STATE_THREAD(x) (mp_state_ctx.thread.x)
#endif
-#endif // __MICROPY_INCLUDED_PY_MPSTATE_H__
+#endif // MICROPY_INCLUDED_PY_MPSTATE_H
diff --git a/py/mpthread.h b/py/mpthread.h
index 04d4f19..602df83 100644
--- a/py/mpthread.h
+++ b/py/mpthread.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPTHREAD_H__
-#define __MICROPY_INCLUDED_PY_MPTHREAD_H__
+#ifndef MICROPY_INCLUDED_PY_MPTHREAD_H
+#define MICROPY_INCLUDED_PY_MPTHREAD_H
#include "py/mpconfig.h"
@@ -58,4 +58,4 @@
#define MP_THREAD_GIL_EXIT()
#endif
-#endif // __MICROPY_INCLUDED_PY_MPTHREAD_H__
+#endif // MICROPY_INCLUDED_PY_MPTHREAD_H
diff --git a/py/mpz.h b/py/mpz.h
index 5c88227..878febf 100644
--- a/py/mpz.h
+++ b/py/mpz.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_MPZ_H__
-#define __MICROPY_INCLUDED_PY_MPZ_H__
+#ifndef MICROPY_INCLUDED_PY_MPZ_H
+#define MICROPY_INCLUDED_PY_MPZ_H
#include <stdint.h>
@@ -139,4 +139,4 @@
#endif
size_t mpz_as_str_inpl(const mpz_t *z, unsigned int base, const char *prefix, char base_char, char comma, char *str);
-#endif // __MICROPY_INCLUDED_PY_MPZ_H__
+#endif // MICROPY_INCLUDED_PY_MPZ_H
diff --git a/py/nlr.h b/py/nlr.h
index 7a71ef3..624e973 100644
--- a/py/nlr.h
+++ b/py/nlr.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_NLR_H__
-#define __MICROPY_INCLUDED_PY_NLR_H__
+#ifndef MICROPY_INCLUDED_PY_NLR_H
+#define MICROPY_INCLUDED_PY_NLR_H
// non-local return
// exception handling, basically a stack of setjmp/longjmp buffers
@@ -112,4 +112,4 @@
#endif
-#endif // __MICROPY_INCLUDED_PY_NLR_H__
+#endif // MICROPY_INCLUDED_PY_NLR_H
diff --git a/py/obj.h b/py/obj.h
index a3c06a2..f88c100 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJ_H__
-#define __MICROPY_INCLUDED_PY_OBJ_H__
+#ifndef MICROPY_INCLUDED_PY_OBJ_H
+#define MICROPY_INCLUDED_PY_OBJ_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -864,4 +864,4 @@
memmove(((char*)dest) + (beg + slice_len) * (item_sz), ((char*)dest) + (end) * (item_sz), ((dest_len) + (len_adj) - ((beg) + (slice_len))) * (item_sz)); \
memmove(((char*)dest) + (beg) * (item_sz), slice, slice_len * (item_sz));
-#endif // __MICROPY_INCLUDED_PY_OBJ_H__
+#endif // MICROPY_INCLUDED_PY_OBJ_H
diff --git a/py/objarray.h b/py/objarray.h
index 06a2a07..0389668 100644
--- a/py/objarray.h
+++ b/py/objarray.h
@@ -24,9 +24,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
-#ifndef __MICROPY_INCLUDED_PY_OBJARRAY_H__
-#define __MICROPY_INCLUDED_PY_OBJARRAY_H__
+#ifndef MICROPY_INCLUDED_PY_OBJARRAY_H
+#define MICROPY_INCLUDED_PY_OBJARRAY_H
#include "py/obj.h"
@@ -40,4 +39,4 @@
void *items;
} mp_obj_array_t;
-#endif // __MICROPY_INCLUDED_PY_OBJARRAY_H__
+#endif // MICROPY_INCLUDED_PY_OBJARRAY_H
diff --git a/py/objexcept.h b/py/objexcept.h
index 3128fde..2232e1e 100644
--- a/py/objexcept.h
+++ b/py/objexcept.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJEXCEPT_H__
-#define __MICROPY_INCLUDED_PY_OBJEXCEPT_H__
+#ifndef MICROPY_INCLUDED_PY_OBJEXCEPT_H
+#define MICROPY_INCLUDED_PY_OBJEXCEPT_H
#include "py/obj.h"
#include "py/objtuple.h"
@@ -37,4 +37,4 @@
mp_obj_tuple_t *args;
} mp_obj_exception_t;
-#endif // __MICROPY_INCLUDED_PY_OBJEXCEPT_H__
+#endif // MICROPY_INCLUDED_PY_OBJEXCEPT_H
diff --git a/py/objfun.h b/py/objfun.h
index d02fada..450c98f 100644
--- a/py/objfun.h
+++ b/py/objfun.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJFUN_H__
-#define __MICROPY_INCLUDED_PY_OBJFUN_H__
+#ifndef MICROPY_INCLUDED_PY_OBJFUN_H
+#define MICROPY_INCLUDED_PY_OBJFUN_H
#include "py/obj.h"
@@ -41,4 +41,4 @@
mp_obj_t extra_args[];
} mp_obj_fun_bc_t;
-#endif // __MICROPY_INCLUDED_PY_OBJFUN_H__
+#endif // MICROPY_INCLUDED_PY_OBJFUN_H
diff --git a/py/objgenerator.h b/py/objgenerator.h
index d1b9be4..d61332a 100644
--- a/py/objgenerator.h
+++ b/py/objgenerator.h
@@ -23,12 +23,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJGENERATOR_H__
-#define __MICROPY_INCLUDED_PY_OBJGENERATOR_H__
+#ifndef MICROPY_INCLUDED_PY_OBJGENERATOR_H
+#define MICROPY_INCLUDED_PY_OBJGENERATOR_H
#include "py/obj.h"
#include "py/runtime.h"
mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_val, mp_obj_t throw_val, mp_obj_t *ret_val);
-#endif // __MICROPY_INCLUDED_PY_OBJGENERATOR_H__
+#endif // MICROPY_INCLUDED_PY_OBJGENERATOR_H
diff --git a/py/objint.h b/py/objint.h
index da56c18..f341306 100644
--- a/py/objint.h
+++ b/py/objint.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJINT_H__
-#define __MICROPY_INCLUDED_PY_OBJINT_H__
+#ifndef MICROPY_INCLUDED_PY_OBJINT_H
+#define MICROPY_INCLUDED_PY_OBJINT_H
#include "py/mpz.h"
#include "py/obj.h"
@@ -63,4 +63,4 @@
mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in);
mp_obj_t mp_obj_int_pow3(mp_obj_t base, mp_obj_t exponent, mp_obj_t modulus);
-#endif // __MICROPY_INCLUDED_PY_OBJINT_H__
+#endif // MICROPY_INCLUDED_PY_OBJINT_H
diff --git a/py/objlist.h b/py/objlist.h
index 5b2d216..740ba9f 100644
--- a/py/objlist.h
+++ b/py/objlist.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJLIST_H__
-#define __MICROPY_INCLUDED_PY_OBJLIST_H__
+#ifndef MICROPY_INCLUDED_PY_OBJLIST_H
+#define MICROPY_INCLUDED_PY_OBJLIST_H
#include "py/obj.h"
@@ -35,4 +35,4 @@
mp_obj_t *items;
} mp_obj_list_t;
-#endif // __MICROPY_INCLUDED_PY_OBJLIST_H__
+#endif // MICROPY_INCLUDED_PY_OBJLIST_H
diff --git a/py/objmodule.h b/py/objmodule.h
index 4e6612a..5bfbe51 100644
--- a/py/objmodule.h
+++ b/py/objmodule.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJMODULE_H__
-#define __MICROPY_INCLUDED_PY_OBJMODULE_H__
+#ifndef MICROPY_INCLUDED_PY_OBJMODULE_H
+#define MICROPY_INCLUDED_PY_OBJMODULE_H
#include "py/obj.h"
@@ -34,4 +34,4 @@
mp_obj_t mp_module_get(qstr module_name);
void mp_module_register(qstr qstr, mp_obj_t module);
-#endif // __MICROPY_INCLUDED_PY_OBJMODULE_H__
+#endif // MICROPY_INCLUDED_PY_OBJMODULE_H
diff --git a/py/objstr.h b/py/objstr.h
index e92832d..6fbed40 100644
--- a/py/objstr.h
+++ b/py/objstr.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJSTR_H__
-#define __MICROPY_INCLUDED_PY_OBJSTR_H__
+#ifndef MICROPY_INCLUDED_PY_OBJSTR_H
+#define MICROPY_INCLUDED_PY_OBJSTR_H
#include "py/obj.h"
@@ -102,4 +102,4 @@
MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj);
MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj);
-#endif // __MICROPY_INCLUDED_PY_OBJSTR_H__
+#endif // MICROPY_INCLUDED_PY_OBJSTR_H
diff --git a/py/objtuple.h b/py/objtuple.h
index 555c3b3..6867023 100644
--- a/py/objtuple.h
+++ b/py/objtuple.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJTUPLE_H__
-#define __MICROPY_INCLUDED_PY_OBJTUPLE_H__
+#ifndef MICROPY_INCLUDED_PY_OBJTUPLE_H
+#define MICROPY_INCLUDED_PY_OBJTUPLE_H
#include "py/obj.h"
@@ -61,4 +61,4 @@
mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj_t *items);
-#endif // __MICROPY_INCLUDED_PY_OBJTUPLE_H__
+#endif // MICROPY_INCLUDED_PY_OBJTUPLE_H
diff --git a/py/objtype.h b/py/objtype.h
index 61efd00..104b20a 100644
--- a/py/objtype.h
+++ b/py/objtype.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_OBJTYPE_H__
-#define __MICROPY_INCLUDED_PY_OBJTYPE_H__
+#ifndef MICROPY_INCLUDED_PY_OBJTYPE_H
+#define MICROPY_INCLUDED_PY_OBJTYPE_H
#include "py/obj.h"
@@ -49,4 +49,4 @@
// this needs to be exposed for the above macros to work correctly
mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
-#endif // __MICROPY_INCLUDED_PY_OBJTYPE_H__
+#endif // MICROPY_INCLUDED_PY_OBJTYPE_H
diff --git a/py/parse.h b/py/parse.h
index 769f5a8..fec1882 100644
--- a/py/parse.h
+++ b/py/parse.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_PARSE_H__
-#define __MICROPY_INCLUDED_PY_PARSE_H__
+#ifndef MICROPY_INCLUDED_PY_PARSE_H
+#define MICROPY_INCLUDED_PY_PARSE_H
#include <stddef.h>
#include <stdint.h>
@@ -104,4 +104,4 @@
mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind);
void mp_parse_tree_clear(mp_parse_tree_t *tree);
-#endif // __MICROPY_INCLUDED_PY_PARSE_H__
+#endif // MICROPY_INCLUDED_PY_PARSE_H
diff --git a/py/parsenum.h b/py/parsenum.h
index f140cfc..77fd0f4 100644
--- a/py/parsenum.h
+++ b/py/parsenum.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_PARSENUM_H__
-#define __MICROPY_INCLUDED_PY_PARSENUM_H__
+#ifndef MICROPY_INCLUDED_PY_PARSENUM_H
+#define MICROPY_INCLUDED_PY_PARSENUM_H
#include "py/mpconfig.h"
#include "py/lexer.h"
@@ -34,4 +34,4 @@
mp_obj_t mp_parse_num_integer(const char *restrict str, size_t len, int base, mp_lexer_t *lex);
mp_obj_t mp_parse_num_decimal(const char *str, size_t len, bool allow_imag, bool force_complex, mp_lexer_t *lex);
-#endif // __MICROPY_INCLUDED_PY_PARSENUM_H__
+#endif // MICROPY_INCLUDED_PY_PARSENUM_H
diff --git a/py/parsenumbase.h b/py/parsenumbase.h
index 9da9db8..143796d 100644
--- a/py/parsenumbase.h
+++ b/py/parsenumbase.h
@@ -23,11 +23,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_PARSENUMBASE_H__
-#define __MICROPY_INCLUDED_PY_PARSENUMBASE_H__
+#ifndef MICROPY_INCLUDED_PY_PARSENUMBASE_H
+#define MICROPY_INCLUDED_PY_PARSENUMBASE_H
#include "py/mpconfig.h"
size_t mp_parse_num_base(const char *str, size_t len, int *base);
-#endif // __MICROPY_INCLUDED_PY_PARSENUMBASE_H__
+#endif // MICROPY_INCLUDED_PY_PARSENUMBASE_H
diff --git a/py/qstr.h b/py/qstr.h
index 8c63fbb..4116eb8 100644
--- a/py/qstr.h
+++ b/py/qstr.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_QSTR_H__
-#define __MICROPY_INCLUDED_PY_QSTR_H__
+#ifndef MICROPY_INCLUDED_PY_QSTR_H
+#define MICROPY_INCLUDED_PY_QSTR_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -76,4 +76,4 @@
void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, size_t *n_total_bytes);
void qstr_dump_data(void);
-#endif // __MICROPY_INCLUDED_PY_QSTR_H__
+#endif // MICROPY_INCLUDED_PY_QSTR_H
diff --git a/py/repl.h b/py/repl.h
index 048b0de..c2499a2 100644
--- a/py/repl.h
+++ b/py/repl.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_REPL_H__
-#define __MICROPY_INCLUDED_PY_REPL_H__
+#ifndef MICROPY_INCLUDED_PY_REPL_H
+#define MICROPY_INCLUDED_PY_REPL_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -35,4 +35,4 @@
size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print, const char **compl_str);
#endif
-#endif // __MICROPY_INCLUDED_PY_REPL_H__
+#endif // MICROPY_INCLUDED_PY_REPL_H
diff --git a/py/ringbuf.h b/py/ringbuf.h
index 5e108af..b416927 100644
--- a/py/ringbuf.h
+++ b/py/ringbuf.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_RINGBUF_H__
-#define __MICROPY_INCLUDED_PY_RINGBUF_H__
+#ifndef MICROPY_INCLUDED_PY_RINGBUF_H
+#define MICROPY_INCLUDED_PY_RINGBUF_H
typedef struct _ringbuf_t {
uint8_t *buf;
@@ -69,4 +69,4 @@
return 0;
}
-#endif // __MICROPY_INCLUDED_PY_RINGBUF_H__
+#endif // MICROPY_INCLUDED_PY_RINGBUF_H
diff --git a/py/runtime.h b/py/runtime.h
index d75d23f..0add564 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_RUNTIME_H__
-#define __MICROPY_INCLUDED_PY_RUNTIME_H__
+#ifndef MICROPY_INCLUDED_PY_RUNTIME_H
+#define MICROPY_INCLUDED_PY_RUNTIME_H
#include "py/mpstate.h"
#include "py/obj.h"
@@ -178,4 +178,4 @@
#define mp_warning(msg, ...)
#endif
-#endif // __MICROPY_INCLUDED_PY_RUNTIME_H__
+#endif // MICROPY_INCLUDED_PY_RUNTIME_H
diff --git a/py/runtime0.h b/py/runtime0.h
index 720fe6a..060ee8c 100644
--- a/py/runtime0.h
+++ b/py/runtime0.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__
-#define __MICROPY_INCLUDED_PY_RUNTIME0_H__
+#ifndef MICROPY_INCLUDED_PY_RUNTIME0_H
+#define MICROPY_INCLUDED_PY_RUNTIME0_H
// These must fit in 8 bits; see scope.h
#define MP_SCOPE_FLAG_VARARGS (0x01)
@@ -151,4 +151,4 @@
extern void *const mp_fun_table[MP_F_NUMBER_OF];
-#endif // __MICROPY_INCLUDED_PY_RUNTIME0_H__
+#endif // MICROPY_INCLUDED_PY_RUNTIME0_H
diff --git a/py/scope.h b/py/scope.h
index 826064d..4d0c1b1 100644
--- a/py/scope.h
+++ b/py/scope.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_SCOPE_H__
-#define __MICROPY_INCLUDED_PY_SCOPE_H__
+#ifndef MICROPY_INCLUDED_PY_SCOPE_H
+#define MICROPY_INCLUDED_PY_SCOPE_H
#include "py/parse.h"
#include "py/emitglue.h"
@@ -94,4 +94,4 @@
id_info_t *scope_find_global(scope_t *scope, qstr qstr);
void scope_find_local_and_close_over(scope_t *scope, id_info_t *id, qstr qst);
-#endif // __MICROPY_INCLUDED_PY_SCOPE_H__
+#endif // MICROPY_INCLUDED_PY_SCOPE_H
diff --git a/py/smallint.h b/py/smallint.h
index b9686be..b2bfc6d 100644
--- a/py/smallint.h
+++ b/py/smallint.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_SMALLINT_H__
-#define __MICROPY_INCLUDED_PY_SMALLINT_H__
+#ifndef MICROPY_INCLUDED_PY_SMALLINT_H
+#define MICROPY_INCLUDED_PY_SMALLINT_H
#include "py/mpconfig.h"
#include "py/misc.h"
@@ -65,4 +65,4 @@
mp_int_t mp_small_int_modulo(mp_int_t dividend, mp_int_t divisor);
mp_int_t mp_small_int_floor_divide(mp_int_t num, mp_int_t denom);
-#endif // __MICROPY_INCLUDED_PY_SMALLINT_H__
+#endif // MICROPY_INCLUDED_PY_SMALLINT_H
diff --git a/py/stackctrl.h b/py/stackctrl.h
index e915f50..84c0e14 100644
--- a/py/stackctrl.h
+++ b/py/stackctrl.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_STACKCTRL_H__
-#define __MICROPY_INCLUDED_PY_STACKCTRL_H__
+#ifndef MICROPY_INCLUDED_PY_STACKCTRL_H
+#define MICROPY_INCLUDED_PY_STACKCTRL_H
#include "py/mpconfig.h"
@@ -45,4 +45,4 @@
#endif
-#endif // __MICROPY_INCLUDED_PY_STACKCTRL_H__
+#endif // MICROPY_INCLUDED_PY_STACKCTRL_H
diff --git a/py/stream.h b/py/stream.h
index 01199ab..0b5fd7c 100644
--- a/py/stream.h
+++ b/py/stream.h
@@ -23,8 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_STREAM_H__
-#define __MICROPY_INCLUDED_PY_STREAM_H__
+#ifndef MICROPY_INCLUDED_PY_STREAM_H
+#define MICROPY_INCLUDED_PY_STREAM_H
#include "py/obj.h"
#include "py/mperrno.h"
@@ -103,4 +103,4 @@
#define mp_is_nonblocking_error(errno) (0)
#endif
-#endif // __MICROPY_INCLUDED_PY_STREAM_H__
+#endif // MICROPY_INCLUDED_PY_STREAM_H
diff --git a/py/unicode.h b/py/unicode.h
index 89c28ed..f99c970 100644
--- a/py/unicode.h
+++ b/py/unicode.h
@@ -23,12 +23,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_PY_UNICODE_H__
-#define __MICROPY_INCLUDED_PY_UNICODE_H__
+#ifndef MICROPY_INCLUDED_PY_UNICODE_H
+#define MICROPY_INCLUDED_PY_UNICODE_H
#include "py/mpconfig.h"
#include "py/misc.h"
mp_uint_t utf8_ptr_to_index(const byte *s, const byte *ptr);
-#endif // __MICROPY_INCLUDED_PY_UNICODE_H__
+#endif // MICROPY_INCLUDED_PY_UNICODE_H