Skip to main content
Commonmark migration
Source Link

###Using uint16_t not a problem?###

Using uint16_t not a problem?

Your comment says you want to use uint16_t, so why don't you do that? It would make the code look like this:

uint16_t wordHi = 0xaa;
uint16_t wordMi = 0xbb;
uint16_t wordLo = 0xcc;

uint64_t largeword = ((uint64_t) wordHi << 32) + ((uint64_t) wordMi << 16) + wordLo;

###Using uint16_t not a problem?###

Your comment says you want to use uint16_t, so why don't you do that? It would make the code look like this:

uint16_t wordHi = 0xaa;
uint16_t wordMi = 0xbb;
uint16_t wordLo = 0xcc;

uint64_t largeword = ((uint64_t) wordHi << 32) + ((uint64_t) wordMi << 16) + wordLo;

Using uint16_t not a problem?

Your comment says you want to use uint16_t, so why don't you do that? It would make the code look like this:

uint16_t wordHi = 0xaa;
uint16_t wordMi = 0xbb;
uint16_t wordLo = 0xcc;

uint64_t largeword = ((uint64_t) wordHi << 32) + ((uint64_t) wordMi << 16) + wordLo;
Source Link
JS1
  • 28.9k
  • 3
  • 42
  • 83

###Using uint16_t not a problem?###

Your comment says you want to use uint16_t, so why don't you do that? It would make the code look like this:

uint16_t wordHi = 0xaa;
uint16_t wordMi = 0xbb;
uint16_t wordLo = 0xcc;

uint64_t largeword = ((uint64_t) wordHi << 32) + ((uint64_t) wordMi << 16) + wordLo;