"unsigned" keyword without a type specifer? default int?

Hey everyone,

Just been studying the Arduino MIDI Library, seeing a lot of the unsigned keyword without a type specifier. Does a missing type specifier default to an int in the arduino environment/avr compilers? Thank you! :slight_smile:

unsigned decodeSysEx(const byte* inSysEx,
                     byte* outData,
                     unsigned inLength,
                     bool inFlipHeaderBits)
{
    unsigned count  = 0;
    byte msbStorage = 0;
    byte byteIndex  = 0;

I think defaulting to int comes from the original roots of the c complier. But here's a list for your enjoyment..

-jim lee

Keystrokes must have been expensive when C was created if they wanted to save 4 of them by not having to type a space then int

These days it is as quick to type uint16_t rather than unsigned and it is more explicit as to the data type and number of bits

Nice, thanks for clarification! Good to know the origins of that a bit.

UKHeliBob:
Keystrokes must have been expensive when C was created if they wanted to save 4 of them by not having to type a space then int

Not so much keystrokes but punch cards, there was a hard limit on line length at the time before you needed to continue the line onto the next card. Must have been loads of fun getting a dropped stack of cards back in order when some of the cards only contained a half dozen characters as a continuation of a previous line. The video terminals were mostly designed around 80 characters per line, with the editors being line editors, so there may have been limitations there also, along with the fact that the computer itself had very limited memory to work with.