Aus dem obigen "Listing" kommt leider der Datentyp nicht raus. Prinzipiell kann das durchaus sein, das deine Variable auch ein 2 byte Integer ist und kein Byte. Wie sind deine Variable definiert?

result = ((returnvar << 16) + (lsb_srf << 8 ) + msb_srf);


würde ich so schreiben:

Code:
uint32_t result = returnvar; // convertion to 32 bit
result = result << 16; // shift by 16 bit and build result
result |= uint32_t(lsb_srf) << 8; // conversion to 32 bit and shift by 8 bit and build result
result |= uint32_t(msb_srf); // conversion to 32 bit and build result
Gruß
Georg

EDIT: Code