Commit 929095ab61ca93bdb89ce8bd0d4b509680b4a534
1 parent
d9b2b2a8
removed warnings from stim::bmp
Showing
1 changed file
with
6 additions
and
7 deletions
Show diff stats
stim/image/bmp.h
... | ... | @@ -172,7 +172,7 @@ namespace stim { |
172 | 172 | compression = header.bV5Compression; |
173 | 173 | } |
174 | 174 | void read_dib() { //read the bitmap DIB information header |
175 | - int header_pos = file.tellg(); | |
175 | + std::streamoff header_pos = file.tellg(); | |
176 | 176 | file.read((char*)&dib_header_size, sizeof(unsigned int)); |
177 | 177 | file.seekg(header_pos); |
178 | 178 | switch (dib_header_size) { |
... | ... | @@ -235,15 +235,14 @@ namespace stim { |
235 | 235 | tagBITMAPFILEHEADER file_header; |
236 | 236 | memset(&file_header, 0, sizeof(tagBITMAPFILEHEADER)); //initialize the file header structure to zero |
237 | 237 | file_header.bfOffBits = sizeof(tagBITMAPFILEHEADER) + sizeof(tagBITMAPCOREHEADER); //the offset includes both the file and DIB header |
238 | - size_t bytes = width * height * 3; | |
239 | - file_header.bfSize = file_header.bfOffBits + (row_bytes + padding) * height; //calculate the size of the bitmap file | |
240 | - file_header.bfType = 0x4D42; | |
238 | + file_header.bfSize = (stim::DWORD)(file_header.bfOffBits + (row_bytes + padding) * height); //calculate the size of the bitmap file | |
239 | + file_header.bfType = (stim::DWORD)0x4D42; | |
241 | 240 | |
242 | 241 | tagBITMAPCOREHEADER info_header; |
243 | 242 | memset(&info_header, 0, sizeof(tagBITMAPCOREHEADER)); //initialize the info header to zero |
244 | - info_header.bcBitCount = bits_per_pixel; | |
245 | - info_header.bcHeight = height; | |
246 | - info_header.bcWidth = width; | |
243 | + info_header.bcBitCount = (stim::DWORD)bits_per_pixel; | |
244 | + info_header.bcHeight = (stim::WORD)height; | |
245 | + info_header.bcWidth = (stim::WORD)width; | |
247 | 246 | info_header.bcSize = sizeof(tagBITMAPCOREHEADER); |
248 | 247 | info_header.bcPlanes = 1; |
249 | 248 | ... | ... |