- hdr[HDR_BYTESPERLINE] = bytesperline % 256;
- hdr[HDR_BYTESPERLINE + 1] = bytesperline / 256;
- hdr[HDR_XMAX] = (width - 1) % 256;
- hdr[HDR_XMAX + 1] = (width - 1) / 256;
- hdr[HDR_YMAX] = (height - 1) % 256;
- hdr[HDR_YMAX + 1] = (height - 1) / 256;
+ hdr[HDR_BYTESPERLINE] = (unsigned char)(bytesperline % 256);
+ hdr[HDR_BYTESPERLINE + 1] = (unsigned char)(bytesperline / 256);
+ hdr[HDR_XMAX] = (unsigned char)((width - 1) % 256);
+ hdr[HDR_XMAX + 1] = (unsigned char)((width - 1) / 256);
+ hdr[HDR_YMAX] = (unsigned char)((height - 1) % 256);
+ hdr[HDR_YMAX + 1] = (unsigned char)((height - 1) / 256);