@@ -163,10 +163,10 @@ putlong(outf, val)
163163{
164164 unsigned char buf [4 ];
165165
166- buf [0 ] = (val >> 24 );
167- buf [1 ] = (val >> 16 );
168- buf [2 ] = (val >> 8 );
169- buf [3 ] = (val >> 0 );
166+ buf [0 ] = (unsigned char ) ( val >> 24 );
167+ buf [1 ] = (unsigned char ) ( val >> 16 );
168+ buf [2 ] = (unsigned char ) ( val >> 8 );
169+ buf [3 ] = (unsigned char ) ( val >> 0 );
170170 return fwrite (buf , 4 , 1 , outf );
171171}
172172
@@ -314,7 +314,7 @@ longimagedata(self, args)
314314 tablen = ysize * zsize * sizeof (long );
315315 starttab = (long * )malloc (tablen );
316316 lengthtab = (long * )malloc (tablen );
317- rlebuflen = 1.05 * xsize + 10 ;
317+ rlebuflen = ( int ) ( 1.05 * xsize + 10 ) ;
318318 rledat = (unsigned char * )malloc (rlebuflen );
319319 if (!starttab || !lengthtab || !rledat ) {
320320 PyErr_NoMemory ();
@@ -603,7 +603,7 @@ longstoimage(self, args)
603603
604604 starttab = (long * )malloc (tablen );
605605 lengthtab = (long * )malloc (tablen );
606- rlebuflen = 1.05 * xsize + 10 ;
606+ rlebuflen = ( int ) ( 1.05 * xsize + 10 ) ;
607607 rlebuf = (unsigned char * )malloc (rlebuflen );
608608 lumbuf = (unsigned char * )malloc (xsize * sizeof (long ));
609609 if (!starttab || !lengthtab || !rlebuf || !lumbuf ) {
@@ -714,7 +714,7 @@ compressrow(lbuf, rlebuf, z, cnt)
714714 iptr -= 8 ;
715715 count = (iptr - sptr ) / 4 ;
716716 while (count ) {
717- todo = count > 126 ? 126 : count ;
717+ todo = count > 126 ? 126 : ( short ) count ;
718718 count -= todo ;
719719 * optr ++ = 0x80 | todo ;
720720 while (todo > 8 ) {
@@ -742,10 +742,10 @@ compressrow(lbuf, rlebuf, z, cnt)
742742 iptr += 4 ;
743743 count = (iptr - sptr ) / 4 ;
744744 while (count ) {
745- todo = count > 126 ? 126 : count ;
745+ todo = count > 126 ? 126 : ( short ) count ;
746746 count -= todo ;
747- * optr ++ = todo ;
748- * optr ++ = cc ;
747+ * optr ++ = ( unsigned char ) todo ;
748+ * optr ++ = ( unsigned char ) cc ;
749749 }
750750 }
751751 * optr ++ = 0 ;
0 commit comments