kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

6_5_07_shift_u8_promote.c (283B)


      1 typedef unsigned char u8;
      2 
      3 static int get2(const u8* x) { return (x[0] << 8) | x[1]; }
      4 
      5 int test_main(void) {
      6   u8 page[2];
      7   page[0] = 0x10;
      8   page[1] = 0x00;
      9   if (get2(page) != 4096) return 1;
     10   page[0] = 0x0f;
     11   page[1] = 0x94;
     12   if (get2(page) != 3988) return 2;
     13   return 42;
     14 }