• Using unsigned with signed int
    I have a signed integer which I have to assign to an unsigned one after addition with unsigned one. Like int16_t x = -9; uint16_t y = 11; if(x < y) { y = y+x; } How to ensure that...
  • initialization of packed unsigned int
    I am trying to implement Mass storage device class using nxpusblib and got stuck in initialization of a packed structure. The structure is typedef ATTR_IAR_PACKED struct { unsigned DeviceType : 5;...
  • Array indexing with unsigned int
    C251 v3.12 The C251 compiler does not handle arithmetic for array indices consistently. Consider char tt[30] ; char test ; unsigned char aaa = 27 ; unsigned int bbb = 27 ; test = tt[aaa - 20] ;...
  • char to unsigned int
    Hi all Here is some code char prev_ch; unsigned int chksum_read; chksum_read += (WORD)prev_ch*256; chksum_read += (unsigned int)prev_ch<<8; if prev_ch has a value of 0xDB after one of of...
  • Conversion (unsigned int)double incorrect.
    I'm calculate sin by table. Example fragment code bellow .... #define Tabl_acos 0x80000000 ... ... double tsin (double arg) { double argout; unsigned int *adr; adr = (unsigned int ...