--- a/tiff.c
+++ b/tiff.c
@@ -45,7 +45,7 @@
 int readplanarTIFF(Image * im, TIFF * tif)
 {
     UCHAR *buf;
-    pt_int32 y;
+    int32_t y;
     short SamplesPerPixel;
 
     TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &SamplesPerPixel);
@@ -84,7 +84,7 @@
 int readtif(Image * im, TIFF * tif)
 {
     short BitsPerSample, tPhotoMetric, config;
-    pt_int32 w, h;
+    uint32_t w, h;
     unsigned long **hdl_raster;
 
     if (tif == NULL || im == NULL)
@@ -372,7 +372,7 @@
         setCropInformationInTiff(tif, crop_info);
 
     bufsize = TIFFScanlineSize(tif);
-    if ((pt_int32)bufsize < im->bytesPerLine)
+    if ((uint32_t)bufsize < im->bytesPerLine)
         bufsize = im->bytesPerLine;
     buf = (UCHAR *) malloc(bufsize);
     if (buf == NULL)
@@ -381,7 +381,7 @@
         return -1;
     }
 
-    for (y = 0; (pt_int32) y < im->height; y++)
+    for (y = 0; (uint32_t) y < im->height; y++)
     {
         memcpy(buf, *(im->data) + y * im->bytesPerLine,
                (size_t) im->bytesPerLine);
@@ -1107,7 +1107,7 @@
         return 0;
     }
 
-    for (row = 0; (pt_int32) row < im->height; row++) {
+    for (row = 0; row < im->height; row++) {
         if (TIFFReadScanline(tif->tiff, buf, row, 0) != 1) {
             PrintError("Error reading TIFF file");
             goto error;
@@ -1364,7 +1364,7 @@
 
     bufsize = TIFFScanlineSize(tif->tiff);
 
-    if ((pt_int32)bufsize < im->bytesPerLine)
+    if ((uint32_t)bufsize < im->bytesPerLine)
         bufsize = im->bytesPerLine;
 
     buf = calloc(bufsize, 1);
@@ -1373,7 +1373,7 @@
         goto error;
     }
 
-    for (y = 0; (pt_int32) y < im->height; y++) {
+    for (y = 0; (uint32_t) y < im->height; y++) {
 	//	printf("Here 1 buffsize %d bytesperline %d width %d\n", bufsize, im->bytesPerLine, im->width);
         memcpy(buf, *(im->data) + y * im->bytesPerLine,
                (size_t) im->bytesPerLine);