@@ -25,12 +25,12 @@ constants under a common name:
25
25
26
26
Most of the time and for the vast majority of usual C code, this practice should
27
27
be applied.
28
- Enumerations also have the advantage of beeing true C symbols from the compiler
28
+ Enumerations also have the advantage of being true C symbols from the compiler
29
29
and debugger point of view.
30
30
31
31
However, there are a few situations where manipulating integer constants as
32
32
enumerations should not be considered, or at least should be taken really
33
- carrefully .
33
+ carefully .
34
34
These situations happen when enumerations are manipulated as l-values on
35
35
specific architectures.
36
36
@@ -55,7 +55,7 @@ A consequence on binary interfacing
55
55
-----------------------------------
56
56
57
57
The first consequence of the C specification is that ``enum `` constants don't
58
- have a fixed size accross different architectures, as the size of an ``int ``
58
+ have a fixed size across different architectures, as the size of an ``int ``
59
59
varies between architectures/compilers.
60
60
This is quite a well-know fact amongst C programmers.
61
61
@@ -67,8 +67,8 @@ An argument against *specific* uses of enumerations
67
67
---------------------------------------------------
68
68
69
69
Let's now introduce a sneaky pitfall, that happens *under specific conditions *.
70
- Lazuli RTOS is targetting embedded systems. It is written in ANSI C and aims to
71
- be easily portable accross different architectures.
70
+ Lazuli RTOS is targeting embedded systems. It is written in ANSI C and aims to
71
+ be easily portable across different architectures.
72
72
73
73
We take here the example of the AVR architecture, which is a target for the
74
74
Lazuli RTOS.
@@ -90,7 +90,7 @@ are often dealing with tiny machines.
90
90
It is much more difficult to see these problems and their consequences when
91
91
using enumerations rather than integers, because we often rely on standard
92
92
header ``<stdint.h> `` when declaring integer variables. We then have a
93
- convinient way to master the size of integer variables right from their
93
+ convenient way to master the size of integer variables right from their
94
94
declaration.
95
95
Unfortunately no equivalent exists for enumerations, and its not easy to spot
96
96
their size at a glance when reviewing the source code.
0 commit comments