diff options
author | Roger Leigh <rleigh@codelibre.net> | 2021-01-01 20:14:07 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@codelibre.net> | 2021-01-21 23:14:13 +0000 |
commit | 39a74eede0455ec8ee334dcddf71f5354d508d8b (patch) | |
tree | 3f6515dfaa192da54d5dd731b9f90d32908b3cd5 /tools/tiffmedian.c | |
parent | af604f119a7b23d0b14dc5940fc84e45616dee69 (diff) | |
download | libtiff-git-39a74eede0455ec8ee334dcddf71f5354d508d8b.tar.gz |
Use standard C99 integer types
Diffstat (limited to 'tools/tiffmedian.c')
-rw-r--r-- | tools/tiffmedian.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c index a7f9a923..d3726bc3 100644 --- a/tools/tiffmedian.c +++ b/tools/tiffmedian.c @@ -79,7 +79,7 @@ typedef struct colorbox { int rmin, rmax; int gmin, gmax; int bmin, bmax; - uint32 total; + uint32_t total; } Colorbox; typedef struct { @@ -87,20 +87,20 @@ typedef struct { int entries[MAX_CMAP_SIZE][2]; } C_cell; -static uint16 rm[MAX_CMAP_SIZE], gm[MAX_CMAP_SIZE], bm[MAX_CMAP_SIZE]; +static uint16_t rm[MAX_CMAP_SIZE], gm[MAX_CMAP_SIZE], bm[MAX_CMAP_SIZE]; static int num_colors; -static uint32 histogram[B_LEN][B_LEN][B_LEN]; +static uint32_t histogram[B_LEN][B_LEN][B_LEN]; static Colorbox *freeboxes; static Colorbox *usedboxes; static C_cell **ColorCells; static TIFF *in, *out; -static uint32 rowsperstrip = (uint32) -1; -static uint16 compression = (uint16) -1; -static uint16 bitspersample = 1; -static uint16 samplesperpixel; -static uint32 imagewidth; -static uint32 imagelength; -static uint16 predictor = 0; +static uint32_t rowsperstrip = (uint32_t) -1; +static uint16_t compression = (uint16_t) -1; +static uint16_t bitspersample = 1; +static uint16_t samplesperpixel; +static uint32_t imagewidth; +static uint32_t imagelength; +static uint16_t predictor = 0; static void get_histogram(TIFF*, Colorbox*); static void splitbox(Colorbox*); @@ -120,10 +120,10 @@ int main(int argc, char* argv[]) { int i, dither = 0; - uint16 shortv, config, photometric; + uint16_t shortv, config, photometric; Colorbox *box_list, *ptr; float floatv; - uint32 longv; + uint32_t longv; int c; #if !HAVE_DECL_OPTARG extern int optind; @@ -257,7 +257,7 @@ main(int argc, char* argv[]) CopyField(TIFFTAG_SUBFILETYPE, longv); CopyField(TIFFTAG_IMAGEWIDTH, longv); TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (short)COLOR_DEPTH); - if (compression != (uint16)-1) { + if (compression != (uint16_t)-1) { TIFFSetField(out, TIFFTAG_COMPRESSION, compression); switch (compression) { case COMPRESSION_LZW: @@ -364,7 +364,7 @@ get_histogram(TIFF* in, Colorbox* box) { register unsigned char *inptr; register int red, green, blue; - register uint32 j, i; + register uint32_t j, i; unsigned char *inputline; inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); @@ -376,7 +376,7 @@ get_histogram(TIFF* in, Colorbox* box) box->rmax = box->gmax = box->bmax = -1; box->total = imagewidth * imagelength; - { register uint32 *ptr = &histogram[0][0][0]; + { register uint32_t *ptr = &histogram[0][0][0]; for (i = B_LEN*B_LEN*B_LEN; i-- > 0;) *ptr++ = 0; } @@ -416,7 +416,7 @@ static Colorbox * largest_box(void) { register Colorbox *p, *b; - register uint32 size; + register uint32_t size; b = NULL; size = 0; @@ -430,13 +430,13 @@ largest_box(void) static void splitbox(Colorbox* ptr) { - uint32 hist2[B_LEN]; + uint32_t hist2[B_LEN]; int first=0, last=0; register Colorbox *new; - register uint32 *iptr, *histp; + register uint32_t *iptr, *histp; register int i, j; register int ir,ig,ib; - register uint32 sum, sum1, sum2; + register uint32_t sum, sum1, sum2; enum { RED, GREEN, BLUE } axis; /* @@ -552,7 +552,7 @@ splitbox(Colorbox* ptr) static void shrinkbox(Colorbox* box) { - register uint32 *histp; + register uint32_t *histp; register int ir, ig, ib; if (box->rmax > box->rmin) { @@ -725,7 +725,7 @@ create_colorcell(int red, int green, int blue) static void map_colortable(void) { - register uint32 *histp = &histogram[0][0][0]; + register uint32_t *histp = &histogram[0][0][0]; register C_cell *cell; register int j, tmp, d2, dist; int ir, ig, ib, i; @@ -774,7 +774,7 @@ quant(TIFF* in, TIFF* out) { unsigned char *outline, *inputline; register unsigned char *outptr, *inptr; - register uint32 i, j; + register uint32_t i, j; register int red, green, blue; inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); @@ -829,8 +829,8 @@ quant_fsdither(TIFF* in, TIFF* out) short *thisline, *nextline; register unsigned char *outptr; register short *thisptr, *nextptr; - register uint32 i, j; - uint32 imax, jmax; + register uint32_t i, j; + uint32_t imax, jmax; int lastline, lastpixel; imax = imagelength - 1; |