@@ -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 ;
@@ -333,7 +333,7 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) {
333333
334334 for (; state -> y < state -> ysize ; state -> y += rows_per_block ) {
335335 img .row_offset = state -> y ;
336- rows_to_read = min (rows_per_block , img .height - state -> y );
336+ rows_to_read = MIN (rows_per_block , img .height - state -> y );
337337
338338 if (!TIFFRGBAImageGet (& img , (UINT32 * )state -> buffer , img .width , rows_to_read )) {
339339 TRACE (("Decode Error, y: %d\n" , state -> y ));
@@ -349,7 +349,7 @@ _decodeAsRGBA(Imaging im, ImagingCodecState state, TIFF *tiff) {
349349
350350 // iterate over each row in the strip and stuff data into image
351351 for (current_row = 0 ;
352- current_row < min ((INT32 )rows_per_block , state -> ysize - state -> y );
352+ current_row < MIN ((INT32 )rows_per_block , state -> ysize - state -> y );
353353 current_row ++ ) {
354354 TRACE (("Writing data into line %d ; \n" , state -> y + current_row ));
355355
@@ -452,8 +452,8 @@ _decodeTile(
452452
453453 TRACE (("Read tile at %dx%d; \n\n" , x , y ));
454454
455- current_tile_width = min ((INT32 )tile_width , state -> xsize - x );
456- current_tile_length = min ((INT32 )tile_length , state -> ysize - y );
455+ current_tile_width = MIN ((INT32 )tile_width , state -> xsize - x );
456+ current_tile_length = MIN ((INT32 )tile_length , state -> ysize - y );
457457 // iterate over each line in the tile and stuff data into image
458458 for (tile_y = 0 ; tile_y < current_tile_length ; tile_y ++ ) {
459459 TRACE (
@@ -566,7 +566,7 @@ _decodeStrip(
566566
567567 // iterate over each row in the strip and stuff data into image
568568 for (strip_row = 0 ;
569- strip_row < min ((INT32 )rows_per_strip , state -> ysize - state -> y );
569+ strip_row < MIN ((INT32 )rows_per_strip , state -> ysize - state -> y );
570570 strip_row ++ ) {
571571 TRACE (("Writing data into line %d ; \n" , state -> y + strip_row ));
572572
0 commit comments