spark/core-firmware — pull request #292 by m-mcgowan (2014-09-06 15:06:20+00:00)
Title: create type-safe radix constants

The `HEX`, `DEC`, `OCT` and `BIN` constants defined in `spark_wiring_print.h` were previously #defines

e.g. #define DEC 10

This meant their values were implicitly typed integer. The various print methods in `Print` use an `int` for the radix, so no problem, but in `String`, the corresponding methods use an `unsigned char`, causing the compiler error.

Ideally we would change the `String` interface to use `int`s for the radix, but without more testing that could break code.

This fix gives an explicit type to the constants. An alternative way would be to change the `String` interface, but that's more invasive and might break compiling code.