We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b026134 commit 16ef60fCopy full SHA for 16ef60f
1 file changed
CODECONVENTIONS.md
@@ -40,6 +40,17 @@ Header files:
40
Type names and declarations:
41
- When defining a type, put '_t' after it.
42
43
+Integer types: Micro Python runs on 32 and 64 bit machines (and one day
44
+maybe 16 bit), so it's important to use the correctly-sized (and signed)
45
+integer types. The general guidelines are:
46
+- For most cases use mp_int_t for signed and mp_uint_t for unsigned
47
+ integer values. These are guaranteed to be machine-word sized and
48
+ therefore big enough to hold the value from a Micro Python small-int
49
+ object.
50
+- Use size_t for things that count bytes / sizes of objects.
51
+- You can use int/uint, but remember that they may be 16-bits wide.
52
+- If in doubt, use mp_int_t/mp_uint_t.
53
+
54
Examples
55
--------
56
0 commit comments