@@ -69,7 +69,7 @@ _tiffReadProc(thandle_t hdata, tdata_t buf, tsize_t size) {
6969 );
7070 return 0 ;
7171 }
72- to_read = min (size , min (state -> size , (tsize_t )state -> eof ) - (tsize_t )state -> loc );
72+ to_read = MIN (size , MIN (state -> size , (tsize_t )state -> eof ) - (tsize_t )state -> loc );
7373 TRACE (("to_read: %d\n" , (int )to_read ));
7474
7575 _TIFFmemcpy (buf , (UINT8 * )state -> data + state -> loc , to_read );
@@ -87,7 +87,7 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) {
8787 TRACE (("_tiffWriteProc: %d \n" , (int )size ));
8888 dump_state (state );
8989
90- to_write = min (size , state -> size - (tsize_t )state -> loc );
90+ to_write = MIN (size , state -> size - (tsize_t )state -> loc );
9191 if (state -> flrealloc && size > to_write ) {
9292 tdata_t new_data ;
9393 tsize_t newsize = state -> size ;
@@ -114,7 +114,7 @@ _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) {
114114
115115 _TIFFmemcpy ((UINT8 * )state -> data + state -> loc , buf , to_write );
116116 state -> loc += (toff_t )to_write ;
117- state -> eof = max (state -> loc , state -> eof );
117+ state -> eof = MAX (state -> loc , state -> eof );
118118
119119 dump_state (state );
120120 return to_write ;
@@ -346,7 +346,7 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) {
346346
347347 for (; state -> y < state -> ysize ; state -> y += rows_per_block ) {
348348 img .row_offset = state -> y ;
349- rows_to_read = min (rows_per_block , img .height - state -> y );
349+ rows_to_read = MIN (rows_per_block , img .height - state -> y );
350350
351351 if (!TIFFRGBAImageGet (& img , (UINT32 * )state -> buffer , img .width , rows_to_read )) {
352352 TRACE (("Decode Error, y: %d\n" , state -> y ));
@@ -362,7 +362,7 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) {
362362
363363 // iterate over each row in the strip and stuff data into image
364364 for (current_row = 0 ;
365- current_row < min ((INT32 )rows_per_block , state -> ysize - state -> y );
365+ current_row < MIN ((INT32 )rows_per_block , state -> ysize - state -> y );
366366 current_row ++ ) {
367367 TRACE (("Writing data into line %d ; \n" , state -> y + current_row ));
368368
@@ -465,8 +465,8 @@ _decodeTile(
465465
466466 TRACE (("Read tile at %dx%d; \n\n" , x , y ));
467467
468- current_tile_width = min ((INT32 )tile_width , state -> xsize - x );
469- current_tile_length = min ((INT32 )tile_length , state -> ysize - y );
468+ current_tile_width = MIN ((INT32 )tile_width , state -> xsize - x );
469+ current_tile_length = MIN ((INT32 )tile_length , state -> ysize - y );
470470 // iterate over each line in the tile and stuff data into image
471471 for (tile_y = 0 ; tile_y < current_tile_length ; tile_y ++ ) {
472472 TRACE (
@@ -580,7 +580,7 @@ _decodeStrip(
580580
581581 // iterate over each row in the strip and stuff data into image
582582 for (strip_row = 0 ;
583- strip_row < min ((INT32 )rows_per_strip , state -> ysize - state -> y );
583+ strip_row < MIN ((INT32 )rows_per_strip , state -> ysize - state -> y );
584584 strip_row ++ ) {
585585 TRACE (("Writing data into line %d ; \n" , state -> y + strip_row ));
586586
0 commit comments