In fields.h, while FieldList is an array, the array elements are each a POD struct of type Field, which has no non-default constructor. Therefore, according to the specification:
The effects of default initialization are:
…
otherwise, nothing is done: the objects with automatic storage duration (and their subobjects) are initialized to indeterminate values.
Comparisons always false due to limited range of data type
Simply put, the long result from string.toInt() was placed into an uint8_t, prior to clamping the value. This change stores the conversion result in a long to perform the clamping prior to storing the value in the uint8_t field.
"warning: extra tokens at end of #include directive"
No semi-colons after #include "file.h"
"error: multi-line comment [-Werror=comment]"
Don't allow the last character of a comment line to end in a backslash character.
"warning: 'typedef' was ignored in this declaration"
There are a number of warnings building this repository. For example:
Missing field initializers
In fields.h, while FieldList is an array, the array elements are each a POD struct of type Field, which has no non-default constructor. Therefore, according to the specification:
Comparisons always false due to limited range of data type
Simply put, the
long
result fromstring.toInt()
was placed into anuint8_t
, prior to clamping the value. This change stores the conversion result in along
to perform the clamping prior to storing the value in theuint8_t
field."warning: extra tokens at end of #include directive"
No semi-colons after #include "file.h"
"error: multi-line comment [-Werror=comment]"
Don't allow the last character of a comment line to end in a backslash character.
"warning: 'typedef' was ignored in this declaration"
The
typedef
ofField
is in the wrong spot.