1. 07 Jun, 2017 1 commit
  2. 06 Jun, 2017 4 commits
  3. 02 Jun, 2017 1 commit
  4. 01 Jun, 2017 3 commits
  5. 31 May, 2017 3 commits
  6. 30 May, 2017 3 commits
  7. 26 May, 2017 7 commits
  8. 25 May, 2017 11 commits
  9. 22 May, 2017 2 commits
  10. 20 May, 2017 5 commits
    • Radim Krčmář's avatar
      use %# instead of 0x% in all format strings · fd6aada0
      Radim Krčmář authored
      
      
      It's one character shorter, properly prefixed, and also provides error
      detection: %#d triggers a warning.
      
      Done with `sed -i 's/0x%/%#/g' **/*.[ch]` to motivate the use of %#,
      existing padding was raised by 2 to account for the counted "0x" (output
      should be the same).
      
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      fd6aada0
    • Radim Krčmář's avatar
      libcflat: support # flag in printf · c9af8739
      Radim Krčmář authored
      
      
      The only use is with %#x, where we'll automatically get 0x prefix.
      Advantage over 0x%x can be seen with padding.
      
      A simple test:
      
        printf(".%#08x.\n", 0);
        printf(".%#8x.\n",  0);
        printf(".%#-8x.\n", 0);
      
        printf(".%#08x.\n", 1);
        printf(".%#8x.\n",  1);
        printf(".%#-8x.\n", 1);
      
        printf(".%#08x.\n", 0x123456);
        printf(".%#8x.\n",  0x123456);
        printf(".%#-8x.\n", 0x123456);
      
        printf(".%#02x.\n", 0);
        printf(".%#2x.\n",  0);
        printf(".%#-2x.\n", 0);
      
        printf(".%#02x.\n", 1);
        printf(".%#2x.\n",  1);
        printf(".%#-2x.\n", 1);
      
      looks just like glibc:
      
        .00000000.
        .       0.
        .0       .
        .0x000001.
        .     0x1.
        .0x1     .
        .0x123456.
        .0x123456.
        .0x123456.
        .00.
        . 0.
        .0 .
        .0x1.
        .0x1.
        .0x1.
      
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      c9af8739
    • Radim Krčmář's avatar
      5687a966
    • Radim Krčmář's avatar
      libcflat: fix padding in printf · 8ef44442
      Radim Krčmář authored
      
      
      A simple test:
      
        printf(".%8p.\n",  (void *)0);
        printf(".%-8p.\n", (void *)0);
        printf(".%8p.\n",  (void *)1);
        printf(".%-8p.\n", (void *)1);
        printf(".%8p.\n",  (void *)0x123456);
        printf(".%-8p.\n", (void *)0x123456);
      
        printf(".%2p.\n",  (void *)0);
        printf(".%-2p.\n", (void *)0);
        printf(".%2p.\n",  (void *)1);
        printf(".%-2p.\n", (void *)1);
      
      glibc:
      
        .   (nil).
        .(nil)   .
        .     0x1.
        .0x1     .
        .0x123456.
        .0x123456.
        .(nil).
        .(nil).
        .0x1.
        .0x1.
      
      before patch:
      
        .      0x       0.
        .0x      0       .
        .      0x       1.
        .0x      1       .
        .      0x  123456.
        .0x      123456  .
        .0x 0.
        .0x0 .
        .0x 1.
        .0x1 .
      
      after patch:
      
        .       0.
        .0       .
        .     0x1.
        .0x1     .
        .0x123456.
        .0x123456.
        . 0.
        .0 .
        .0x1.
        .0x1.
      
      (nil) would be possible with a small change, but the standard leaves it
      to the implementation and 0 is acceptable, IMO.
      
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      8ef44442
    • Radim Krčmář's avatar
      libcflat: add format checking to report() · 4a3245a1
      Radim Krčmář authored
      
      
      report() is a wrapper for printf(), but the compiler was not aware.
      
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      4a3245a1