@@ -345,8 +345,8 @@ cupsRasterInitHeader(
345345 h -> PageSize [1 ] = (unsigned )(72 * media -> length / 2540 );
346346
347347 // This never gets written but is needed for some applications
348- h -> cupsPageSize [0 ] = 72.0f * media -> width / 2540.0f ;
349- h -> cupsPageSize [1 ] = 72.0f * media -> length / 2540.0f ;
348+ h -> cupsPageSize [0 ] = 72.0f * ( float ) media -> width / 2540.0f ;
349+ h -> cupsPageSize [1 ] = 72.0f * ( float ) media -> length / 2540.0f ;
350350
351351 h -> ImagingBoundingBox [0 ] = (unsigned )(72 * media -> left / 2540 );
352352 h -> ImagingBoundingBox [1 ] = (unsigned )(72 * media -> bottom / 2540 );
@@ -568,8 +568,8 @@ _cupsRasterInitPWGHeader(
568568 h -> PageSize [1 ] = (unsigned )(72 * media -> length / 2540 );
569569
570570 // This never gets written but is needed for some applications
571- h -> cupsPageSize [0 ] = 72.0f * media -> width / 2540.0f ;
572- h -> cupsPageSize [1 ] = 72.0f * media -> length / 2540.0f ;
571+ h -> cupsPageSize [0 ] = 72.0f * ( float ) media -> width / 2540.0f ;
572+ h -> cupsPageSize [1 ] = 72.0f * ( float ) media -> length / 2540.0f ;
573573
574574 h -> ImagingBoundingBox [2 ] = h -> PageSize [0 ];
575575 h -> ImagingBoundingBox [3 ] = h -> PageSize [1 ];
@@ -1322,10 +1322,10 @@ _cupsRasterWriteHeader(
13221322 fh .cupsInteger [0 ] = htonl (r -> header .cupsInteger [0 ]);
13231323 fh .cupsInteger [1 ] = htonl (r -> header .cupsInteger [1 ]);
13241324 fh .cupsInteger [2 ] = htonl (r -> header .cupsInteger [2 ]);
1325- fh .cupsInteger [3 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [0 ] * r -> header .HWResolution [0 ] / 72.0 ));
1326- fh .cupsInteger [4 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [1 ] * r -> header .HWResolution [1 ] / 72.0 ));
1327- fh .cupsInteger [5 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [2 ] * r -> header .HWResolution [0 ] / 72.0 ));
1328- fh .cupsInteger [6 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [3 ] * r -> header .HWResolution [1 ] / 72.0 ));
1325+ fh .cupsInteger [3 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [0 ] * ( double ) r -> header .HWResolution [0 ] / 72.0 ));
1326+ fh .cupsInteger [4 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [1 ] * ( double ) r -> header .HWResolution [1 ] / 72.0 ));
1327+ fh .cupsInteger [5 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [2 ] * ( double ) r -> header .HWResolution [0 ] / 72.0 ));
1328+ fh .cupsInteger [6 ] = htonl ((unsigned )(r -> header .cupsImagingBBox [3 ] * ( double ) r -> header .HWResolution [1 ] / 72.0 ));
13291329 fh .cupsInteger [7 ] = htonl (0xffffff );
13301330
13311331 return (cups_raster_io (r , (unsigned char * )& fh , sizeof (fh )) == sizeof (fh ));
0 commit comments