diff options
author | David du Colombier <0intro@gmail.com> | 2013-01-19 10:05:12 +0100 |
---|---|---|
committer | David du Colombier <0intro@gmail.com> | 2013-01-19 10:05:12 +0100 |
commit | d5baaf984f95dd79f58c7a17c57cc6cccca9f8a2 (patch) | |
tree | 10fa175f55fb8b3ff9034fb5e8b5c2fa23eb897f /src/cmd/jpg | |
parent | 23efb34d47df2cb993547995a532a6bf7333f08b (diff) | |
download | plan9port-d5baaf984f95dd79f58c7a17c57cc6cccca9f8a2.tar.gz plan9port-d5baaf984f95dd79f58c7a17c57cc6cccca9f8a2.tar.bz2 plan9port-d5baaf984f95dd79f58c7a17c57cc6cccca9f8a2.zip |
jpegdump: fix build and warnings
R=rsc
https://codereview.appspot.com/7070070
Diffstat (limited to 'src/cmd/jpg')
-rw-r--r-- | src/cmd/jpg/jpegdump.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmd/jpg/jpegdump.c b/src/cmd/jpg/jpegdump.c index ee94d07f..6a0a7a00 100644 --- a/src/cmd/jpg/jpegdump.c +++ b/src/cmd/jpg/jpegdump.c @@ -5,6 +5,7 @@ #include <string.h> #include <math.h> #include <ctype.h> +#include <stdarg.h> /* subroutines done by macros */ #define min(A,B) ((A)<(B) ? (A) : (B)) @@ -90,7 +91,7 @@ int get2 (void) { } void eatmarker (int kind) { - int l, c; + int l; l = get2(); printf ("%02x len=%d\n", kind, l); for (l -= 2; l > 0; l--) @@ -198,7 +199,7 @@ int get1dqt (void) { tab[i] = p ? get2() : get1(); if (toption) { for (i = 0; i < 64; i++) - printf ("\t%q[%02d] = %d\n", i, tab[i]); + printf ("\t%%q[%02d] = %d\n", i, tab[i]); } return p ? 65 : 129; } @@ -211,7 +212,7 @@ void get_dqt (int kind) { } int get1dht (void) { - int l, tcth, p, i, j, v[16], vv[16][256]; + int l, tcth, i, j, v[16], vv[16][256]; tcth = get1(); printf ("DHT:\tclass = %d, table = %d\n", tcth >> 4, tcth & 0xf); for (i = 0; i < 16; i++) @@ -224,10 +225,10 @@ int get1dht (void) { } if (toption) { for (i = 0; i < 16; i++) - printf ("\t%l[%02d] = %d\n", i+1, v[i]); + printf ("\t%%l[%02d] = %d\n", i+1, v[i]); for (i = 0; i < 16; i++) for (j = 0; j < v[i]; j++) - printf ("\t%v[%02d,%02d] = %d\n", i+1, j+1, vv[i][j]); + printf ("\t%%v[%02d,%02d] = %d\n", i+1, j+1, vv[i][j]); } return l; } @@ -255,8 +256,8 @@ void get_sos (int kind) { printf ("\tah = %d, al = %d\n", ahal >> 4, ahal &0xf); } -main (int argc, char *argv[]) { - int l, stuff, i, j, c; +int main (int argc, char *argv[]) { + int l, stuff, c; while (argc > 1 && argv[1][0] == '-') { switch (argv[1][1]) { case 't': |