From 929095ab61ca93bdb89ce8bd0d4b509680b4a534 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Mon, 20 Feb 2017 09:45:58 -0600 Subject: [PATCH] removed warnings from stim::bmp --- stim/image/bmp.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/stim/image/bmp.h b/stim/image/bmp.h index 2c66e1d..855d438 100644 --- a/stim/image/bmp.h +++ b/stim/image/bmp.h @@ -172,7 +172,7 @@ namespace stim { compression = header.bV5Compression; } void read_dib() { //read the bitmap DIB information header - int header_pos = file.tellg(); + std::streamoff header_pos = file.tellg(); file.read((char*)&dib_header_size, sizeof(unsigned int)); file.seekg(header_pos); switch (dib_header_size) { @@ -235,15 +235,14 @@ namespace stim { tagBITMAPFILEHEADER file_header; memset(&file_header, 0, sizeof(tagBITMAPFILEHEADER)); //initialize the file header structure to zero file_header.bfOffBits = sizeof(tagBITMAPFILEHEADER) + sizeof(tagBITMAPCOREHEADER); //the offset includes both the file and DIB header - size_t bytes = width * height * 3; - file_header.bfSize = file_header.bfOffBits + (row_bytes + padding) * height; //calculate the size of the bitmap file - file_header.bfType = 0x4D42; + file_header.bfSize = (stim::DWORD)(file_header.bfOffBits + (row_bytes + padding) * height); //calculate the size of the bitmap file + file_header.bfType = (stim::DWORD)0x4D42; tagBITMAPCOREHEADER info_header; memset(&info_header, 0, sizeof(tagBITMAPCOREHEADER)); //initialize the info header to zero - info_header.bcBitCount = bits_per_pixel; - info_header.bcHeight = height; - info_header.bcWidth = width; + info_header.bcBitCount = (stim::DWORD)bits_per_pixel; + info_header.bcHeight = (stim::WORD)height; + info_header.bcWidth = (stim::WORD)width; info_header.bcSize = sizeof(tagBITMAPCOREHEADER); info_header.bcPlanes = 1; -- libgit2 0.21.4