typedef struct { uint8_t hb; uint8_t mb; uint8_t lb; }BunchOBytes; BunchOBytes Add(BunchOBytes in0, BuncOBytes in1) { BunchOBytes result; uint16_t sum; sum = in0.lb + in1.lb; result.lb = sum; sum >>= 8; sum += in0.mb + in1.mb; result.mb = sum; sum >>= 8; sum += in0.hb + in0.hb; result.hb = sum; return(result); // handle overflow }
enum
typedef struct { unsigned hb; unsigned mb; unsigned lb; }BunchOBytes;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)