summaryrefslogtreecommitdiff
path: root/libs/freeimage/src/FreeImage
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
commitcddcd7483a7c472598af098e759e5d309024f606 (patch)
treeb0a227d6e087c41958cc84d27bc323353248aae5 /libs/freeimage/src/FreeImage
parent1039b2829a264280493ba0fa979214fe024dc70c (diff)
DWORD -> uint32_t
Diffstat (limited to 'libs/freeimage/src/FreeImage')
-rw-r--r--libs/freeimage/src/FreeImage/BitmapAccess.cpp10
-rw-r--r--libs/freeimage/src/FreeImage/Conversion32.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionType.cpp10
-rw-r--r--libs/freeimage/src/FreeImage/FreeImage.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/MNGHelper.cpp106
-rw-r--r--libs/freeimage/src/FreeImage/MemoryIO.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/MultiPage.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/PluginBMP.cpp42
-rw-r--r--libs/freeimage/src/FreeImage/PluginGIF.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/PluginICO.cpp28
-rw-r--r--libs/freeimage/src/FreeImage/PluginJPEG.cpp24
-rw-r--r--libs/freeimage/src/FreeImage/PluginPNG.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/PluginWebP.cpp6
-rw-r--r--libs/freeimage/src/FreeImage/ZLibInterface.cpp32
14 files changed, 140 insertions, 140 deletions
diff --git a/libs/freeimage/src/FreeImage/BitmapAccess.cpp b/libs/freeimage/src/FreeImage/BitmapAccess.cpp
index 62a1d216aa..b8a0aca68e 100644
--- a/libs/freeimage/src/FreeImage/BitmapAccess.cpp
+++ b/libs/freeimage/src/FreeImage/BitmapAccess.cpp
@@ -39,7 +39,7 @@ Constants for the BITMAPINFOHEADER::biCompression field
BI_RGB:
The bitmap is in uncompressed red green blue (RGB) format that is not compressed and does not use color masks.
BI_BITFIELDS:
-The bitmap is not compressed and the color table consists of three DWORD color masks that specify the red, green, and blue components,
+The bitmap is not compressed and the color table consists of three uint32_t color masks that specify the red, green, and blue components,
respectively, of each pixel. This is valid when used with 16 and 32-bits per pixel bitmaps.
*/
#ifndef _WINGDI_
@@ -214,7 +214,7 @@ FreeImage_GetInternalImageSize(BOOL header_only, unsigned width, unsigned height
dib_size += sizeof(RGBQUAD) * CalculateUsedPaletteEntries(bpp);
// we both add palette size and masks size if need_masks is true, since CalculateUsedPaletteEntries
// always returns 0 if need_masks is true (which is only true for 16 bit images).
- dib_size += need_masks ? sizeof(DWORD) * 3 : 0;
+ dib_size += need_masks ? sizeof(uint32_t) * 3 : 0;
dib_size += (dib_size % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - dib_size % FIBITMAP_ALIGNMENT : 0);
if(!header_only) {
@@ -332,7 +332,7 @@ FreeImage_AllocateBitmap(BOOL header_only, uint8_t *ext_bits, unsigned ext_pitch
bpp = 8 * sizeof(short);
break;
case FIT_UINT32:
- bpp = 8 * sizeof(DWORD);
+ bpp = 8 * sizeof(uint32_t);
break;
case FIT_INT32:
bpp = 8 * sizeof(LONG);
@@ -647,7 +647,7 @@ FreeImage_GetBits(FIBITMAP *dib) {
// returns the pixels aligned on a FIBITMAP_ALIGNMENT bytes alignment boundary
size_t lp = (size_t)FreeImage_GetInfoHeader(dib);
lp += sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * FreeImage_GetColorsUsed(dib);
- lp += FreeImage_HasRGBMasks(dib) ? sizeof(DWORD) * 3 : 0;
+ lp += FreeImage_HasRGBMasks(dib) ? sizeof(uint32_t) * 3 : 0;
lp += (lp % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - lp % FIBITMAP_ALIGNMENT : 0);
return (uint8_t *)lp;
}
@@ -1467,7 +1467,7 @@ FreeImage_SetMetadataKeyValue(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const cha
if(tag) {
BOOL bSuccess = TRUE;
// fill the tag
- DWORD tag_length = (DWORD)(strlen(value) + 1);
+ uint32_t tag_length = (uint32_t)(strlen(value) + 1);
bSuccess &= FreeImage_SetTagKey(tag, key);
bSuccess &= FreeImage_SetTagLength(tag, tag_length);
bSuccess &= FreeImage_SetTagCount(tag, tag_length);
diff --git a/libs/freeimage/src/FreeImage/Conversion32.cpp b/libs/freeimage/src/FreeImage/Conversion32.cpp
index 52b85d097d..f4da186dd4 100644
--- a/libs/freeimage/src/FreeImage/Conversion32.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion32.cpp
@@ -106,7 +106,7 @@ FreeImage_ConvertLine16To32_565(uint8_t *target, uint8_t *source, int width_in_p
void DLL_CALLCONV
FreeImage_ConvertLine24To32(uint8_t *target, uint8_t *source, int width_in_pixels) {
for (int cols = 0; cols < width_in_pixels; cols++) {
- *(DWORD *)target = (*(DWORD *) source & FI_RGBA_RGB_MASK) | FI_RGBA_ALPHA_MASK;
+ *(uint32_t *)target = (*(uint32_t *) source & FI_RGBA_RGB_MASK) | FI_RGBA_ALPHA_MASK;
target += 4;
source += 3;
}
diff --git a/libs/freeimage/src/FreeImage/ConversionType.cpp b/libs/freeimage/src/FreeImage/ConversionType.cpp
index be2000ce33..ff46d9041f 100644
--- a/libs/freeimage/src/FreeImage/ConversionType.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionType.cpp
@@ -182,7 +182,7 @@ CONVERT_TO_COMPLEX<Tsrc>::convert(FIBITMAP *src) {
// Convert from type uint8_t to type X
CONVERT_TYPE<unsigned short, uint8_t> convertByteToUShort;
CONVERT_TYPE<short, uint8_t> convertByteToShort;
-CONVERT_TYPE<DWORD, uint8_t> convertByteToULong;
+CONVERT_TYPE<uint32_t, uint8_t> convertByteToULong;
CONVERT_TYPE<LONG, uint8_t> convertByteToLong;
CONVERT_TYPE<float, uint8_t> convertByteToFloat;
CONVERT_TYPE<double, uint8_t> convertByteToDouble;
@@ -190,7 +190,7 @@ CONVERT_TYPE<double, uint8_t> convertByteToDouble;
// Convert from type X to type uint8_t
CONVERT_TO_BYTE<unsigned short> convertUShortToByte;
CONVERT_TO_BYTE<short> convertShortToByte;
-CONVERT_TO_BYTE<DWORD> convertULongToByte;
+CONVERT_TO_BYTE<uint32_t> convertULongToByte;
CONVERT_TO_BYTE<LONG> convertLongToByte;
CONVERT_TO_BYTE<float> convertFloatToByte;
CONVERT_TO_BYTE<double> convertDoubleToByte;
@@ -198,13 +198,13 @@ CONVERT_TO_BYTE<double> convertDoubleToByte;
// Convert from type X to type float
CONVERT_TYPE<float, unsigned short> convertUShortToFloat;
CONVERT_TYPE<float, short> convertShortToFloat;
-CONVERT_TYPE<float, DWORD> convertULongToFloat;
+CONVERT_TYPE<float, uint32_t> convertULongToFloat;
CONVERT_TYPE<float, LONG> convertLongToFloat;
// Convert from type X to type double
CONVERT_TYPE<double, unsigned short> convertUShortToDouble;
CONVERT_TYPE<double, short> convertShortToDouble;
-CONVERT_TYPE<double, DWORD> convertULongToDouble;
+CONVERT_TYPE<double, uint32_t> convertULongToDouble;
CONVERT_TYPE<double, LONG> convertLongToDouble;
CONVERT_TYPE<double, float> convertFloatToDouble;
@@ -212,7 +212,7 @@ CONVERT_TYPE<double, float> convertFloatToDouble;
CONVERT_TO_COMPLEX<uint8_t> convertByteToComplex;
CONVERT_TO_COMPLEX<unsigned short> convertUShortToComplex;
CONVERT_TO_COMPLEX<short> convertShortToComplex;
-CONVERT_TO_COMPLEX<DWORD> convertULongToComplex;
+CONVERT_TO_COMPLEX<uint32_t> convertULongToComplex;
CONVERT_TO_COMPLEX<LONG> convertLongToComplex;
CONVERT_TO_COMPLEX<float> convertFloatToComplex;
CONVERT_TO_COMPLEX<double> convertDoubleToComplex;
diff --git a/libs/freeimage/src/FreeImage/FreeImage.cpp b/libs/freeimage/src/FreeImage/FreeImage.cpp
index e2709853ec..3c2e178154 100644
--- a/libs/freeimage/src/FreeImage/FreeImage.cpp
+++ b/libs/freeimage/src/FreeImage/FreeImage.cpp
@@ -33,7 +33,7 @@ static const char *s_copyright = "This program uses FreeImage, a free, open sour
#ifndef FREEIMAGE_LIB
BOOL APIENTRY
-DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
+DllMain(HANDLE hModule, uint32_t ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH :
FreeImage_Initialise(FALSE);
@@ -89,7 +89,7 @@ FreeImage_GetCopyrightMessage() {
BOOL DLL_CALLCONV
FreeImage_IsLittleEndian() {
union {
- DWORD i;
+ uint32_t i;
uint8_t c[4];
} u;
u.i = 1;
diff --git a/libs/freeimage/src/FreeImage/MNGHelper.cpp b/libs/freeimage/src/FreeImage/MNGHelper.cpp
index 865cbe38c7..de25e7f0ed 100644
--- a/libs/freeimage/src/FreeImage/MNGHelper.cpp
+++ b/libs/freeimage/src/FreeImage/MNGHelper.cpp
@@ -53,7 +53,7 @@ http://libpng.org/pub/mng/spec/
#define JNG_SUPPORTED
/** Size of a JDAT chunk on writing */
-const DWORD JPEG_CHUNK_SIZE = 8192;
+const uint32_t JPEG_CHUNK_SIZE = 8192;
/** PNG signature */
static const uint8_t g_png_signature[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
@@ -248,7 +248,7 @@ mng_SwapShort(uint16_t *sp) {
}
inline void
-mng_SwapLong(DWORD *lp) {
+mng_SwapLong(uint32_t *lp) {
#ifndef FREEIMAGE_BIGENDIAN
SwapLong(lp);
#endif
@@ -281,7 +281,7 @@ mng_CountPNGChunks(FreeImageIO *io, fi_handle handle, long inPos, unsigned *m_To
long mLOF;
long mPos;
BOOL mEnd = FALSE;
- DWORD mLength = 0;
+ uint32_t mLength = 0;
uint8_t mChunkName[5];
*m_TotalBytesOfChunks = 0;
@@ -355,11 +355,11 @@ Retrieve the position of a chunk in a PNG stream
@return Returns TRUE if successful, returns FALSE otherwise
*/
static BOOL
-mng_FindChunk(FIMEMORY *hPngMemory, uint8_t *chunk_name, long offset, DWORD *start_pos, DWORD *next_pos) {
- DWORD mLength = 0;
+mng_FindChunk(FIMEMORY *hPngMemory, uint8_t *chunk_name, long offset, uint32_t *start_pos, uint32_t *next_pos) {
+ uint32_t mLength = 0;
uint8_t *data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
*start_pos = 0;
*next_pos = 0;
@@ -374,7 +374,7 @@ mng_FindChunk(FIMEMORY *hPngMemory, uint8_t *chunk_name, long offset, DWORD *sta
try {
// skip the signature and/or any following chunk(s)
- DWORD chunk_pos = offset;
+ uint32_t chunk_pos = offset;
while(1) {
// get chunk length
@@ -386,7 +386,7 @@ mng_FindChunk(FIMEMORY *hPngMemory, uint8_t *chunk_name, long offset, DWORD *sta
mng_SwapLong(&mLength);
chunk_pos += 4;
- const DWORD next_chunk_pos = chunk_pos + 4 + mLength + 4;
+ const uint32_t next_chunk_pos = chunk_pos + 4 + mLength + 4;
if(next_chunk_pos > size_in_bytes) {
break;
}
@@ -417,12 +417,12 @@ Remove a chunk located at (start_pos, next_pos) in the PNG stream
@return Returns TRUE if successfull, returns FALSE otherwise
*/
static BOOL
-mng_CopyRemoveChunks(FIMEMORY *hPngMemory, DWORD start_pos, DWORD next_pos) {
+mng_CopyRemoveChunks(FIMEMORY *hPngMemory, uint32_t start_pos, uint32_t next_pos) {
uint8_t *data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// length of the chunk to remove
- DWORD chunk_length = next_pos - start_pos;
+ uint32_t chunk_length = next_pos - start_pos;
if(chunk_length == 0) {
return TRUE;
}
@@ -462,12 +462,12 @@ Insert a chunk just before the inNextChunkName chunk
@return Returns TRUE if successfull, returns FALSE otherwise
*/
static BOOL
-mng_CopyInsertChunks(FIMEMORY *hPngMemory, uint8_t *inNextChunkName, uint8_t *inInsertChunk, DWORD inChunkLength, DWORD start_pos, DWORD next_pos) {
+mng_CopyInsertChunks(FIMEMORY *hPngMemory, uint8_t *inNextChunkName, uint8_t *inInsertChunk, uint32_t inChunkLength, uint32_t start_pos, uint32_t next_pos) {
uint8_t *data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// length of the chunk to check
- DWORD chunk_length = next_pos - start_pos;
+ uint32_t chunk_length = next_pos - start_pos;
if(chunk_length == 0) {
return TRUE;
}
@@ -507,8 +507,8 @@ static BOOL
mng_RemoveChunk(FIMEMORY *hPngMemory, uint8_t *chunk_name) {
BOOL bResult = FALSE;
- DWORD start_pos = 0;
- DWORD next_pos = 0;
+ uint32_t start_pos = 0;
+ uint32_t next_pos = 0;
bResult = mng_FindChunk(hPngMemory, chunk_name, 8, &start_pos, &next_pos);
if(!bResult) {
@@ -527,8 +527,8 @@ static BOOL
mng_InsertChunk(FIMEMORY *hPngMemory, uint8_t *inNextChunkName, uint8_t *inInsertChunk, unsigned chunk_length) {
BOOL bResult = FALSE;
- DWORD start_pos = 0;
- DWORD next_pos = 0;
+ uint32_t start_pos = 0;
+ uint32_t next_pos = 0;
bResult = mng_FindChunk(hPngMemory, inNextChunkName, 8, &start_pos, &next_pos);
if(!bResult) {
@@ -571,8 +571,8 @@ Write a chunk in a PNG stream from the current position.
@param hPngMemory PNG stream handle
*/
static void
-mng_WriteChunk(uint8_t *chunk_name, uint8_t *chunk_data, DWORD length, FIMEMORY *hPngMemory) {
- DWORD crc_file = 0;
+mng_WriteChunk(uint8_t *chunk_name, uint8_t *chunk_data, uint32_t length, FIMEMORY *hPngMemory) {
+ uint32_t crc_file = 0;
// write a PNG chunk ...
// - length
mng_SwapLong(&length);
@@ -610,7 +610,7 @@ The image is assumed to be a greyscale image.
@param hPngMemory Output memory stream
*/
static void
-mng_WritePNGStream(DWORD jng_width, DWORD jng_height, uint8_t jng_alpha_sample_depth, uint8_t *mChunk, DWORD mLength, FIMEMORY *hPngMemory) {
+mng_WritePNGStream(uint32_t jng_width, uint32_t jng_height, uint8_t jng_alpha_sample_depth, uint8_t *mChunk, uint32_t mLength, FIMEMORY *hPngMemory) {
// PNG grayscale IDAT format
uint8_t data[14];
@@ -675,7 +675,7 @@ mng_SetKeyValue(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, const
if(tag) {
BOOL bSuccess = TRUE;
// fill the tag
- DWORD tag_length = (DWORD)(strlen(value) + 1);
+ uint32_t tag_length = (uint32_t)(strlen(value) + 1);
bSuccess &= FreeImage_SetTagKey(tag, key);
bSuccess &= FreeImage_SetTagLength(tag, tag_length);
bSuccess &= FreeImage_SetTagCount(tag, tag_length);
@@ -700,18 +700,18 @@ Read a tEXt chunk and extract the key/value pair.
@return Returns TRUE if successful, returns FALSE otherwise
*/
static BOOL
-mng_SetMetadata_tEXt(tEXtMAP &key_value_pair, const uint8_t *mChunk, DWORD mLength) {
+mng_SetMetadata_tEXt(tEXtMAP &key_value_pair, const uint8_t *mChunk, uint32_t mLength) {
std::string key;
std::string value;
uint8_t *buffer = (uint8_t*)malloc(mLength * sizeof(uint8_t));
if(!buffer) {
return FALSE;
}
- DWORD pos = 0;
+ uint32_t pos = 0;
memset(buffer, 0, mLength * sizeof(uint8_t));
- for(DWORD i = 0; i < mLength; i++) {
+ for(uint32_t i = 0; i < mLength; i++) {
buffer[pos++] = mChunk[i];
if(mChunk[i] == '\0') {
if(key.size() == 0) {
@@ -744,14 +744,14 @@ Load a FIBITMAP from a MNG or a JNG stream
*/
FIBITMAP*
mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, int flags = 0) {
- DWORD mLength = 0;
+ uint32_t mLength = 0;
uint8_t mChunkName[5];
uint8_t *mChunk = NULL;
- DWORD crc_file;
+ uint32_t crc_file;
long LastOffset;
long mOrigPos;
uint8_t *PLTE_file_chunk = NULL; // whole PLTE chunk (lentgh, name, array, crc)
- DWORD PLTE_file_size = 0; // size of PLTE chunk
+ uint32_t PLTE_file_size = 0; // size of PLTE chunk
BOOL m_HasGlobalPalette = FALSE; // may turn to TRUE in PLTE chunk
unsigned m_TotalBytesOfChunks = 0;
@@ -763,8 +763,8 @@ mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, in
FIMEMORY *hIDATMemory = NULL;
// ---
- DWORD jng_width = 0;
- DWORD jng_height = 0;
+ uint32_t jng_width = 0;
+ uint32_t jng_height = 0;
uint8_t jng_color_type = 0;
uint8_t jng_image_sample_depth = 0;
uint8_t jng_image_compression_method = 0;
@@ -774,17 +774,17 @@ mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, in
uint8_t jng_alpha_filter_method = 0;
uint8_t jng_alpha_interlace_method = 0;
- DWORD mng_frame_width = 0;
- DWORD mng_frame_height = 0;
- DWORD mng_ticks_per_second = 0;
- DWORD mng_nominal_layer_count = 0;
- DWORD mng_nominal_frame_count = 0;
- DWORD mng_nominal_play_time = 0;
- DWORD mng_simplicity_profile = 0;
+ uint32_t mng_frame_width = 0;
+ uint32_t mng_frame_height = 0;
+ uint32_t mng_ticks_per_second = 0;
+ uint32_t mng_nominal_layer_count = 0;
+ uint32_t mng_nominal_frame_count = 0;
+ uint32_t mng_nominal_play_time = 0;
+ uint32_t mng_simplicity_profile = 0;
- DWORD res_x = 2835; // 72 dpi
- DWORD res_y = 2835; // 72 dpi
+ uint32_t res_x = 2835; // 72 dpi
+ uint32_t res_y = 2835; // 72 dpi
RGBQUAD rgbBkColor = {0, 0, 0, 0};
uint16_t bk_red, bk_green, bk_blue;
BOOL hasBkColor = FALSE;
@@ -833,7 +833,7 @@ mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, in
io->read_proc(&crc_file, 1, sizeof(crc_file), handle);
mng_SwapLong(&crc_file);
// check crc
- DWORD crc_check = FreeImage_ZLibCRC32(0, &mChunkName[0], 4);
+ uint32_t crc_check = FreeImage_ZLibCRC32(0, &mChunkName[0], 4);
crc_check = FreeImage_ZLibCRC32(crc_check, mChunk, mLength);
if(crc_check != crc_file) {
FreeImage_OutputMessageProc(format_id, "Error while parsing %s chunk: bad CRC", mChunkName);
@@ -1014,7 +1014,7 @@ mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, in
// load the PNG alpha layer
if(mHasIDAT) {
uint8_t *data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// get a pointer to the IDAT buffer
FreeImage_AcquireMemory(hIDATMemory, &data, &size_in_bytes);
@@ -1141,8 +1141,8 @@ Write a FIBITMAP to a JNG stream
*/
BOOL
mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int flags) {
- DWORD jng_width = 0;
- DWORD jng_height = 0;
+ uint32_t jng_width = 0;
+ uint32_t jng_height = 0;
uint8_t jng_color_type = 0;
uint8_t jng_image_sample_depth = 8;
uint8_t jng_image_compression_method = 8; // 8: ISO-10918-1 Huffman-coded baseline JPEG.
@@ -1194,8 +1194,8 @@ mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, in
return FALSE;
}
- jng_width = (DWORD)FreeImage_GetWidth(dib);
- jng_height = (DWORD)FreeImage_GetHeight(dib);
+ jng_width = (uint32_t)FreeImage_GetWidth(dib);
+ jng_height = (uint32_t)FreeImage_GetHeight(dib);
try {
hJngMemory = FreeImage_OpenMemory();
@@ -1232,14 +1232,14 @@ mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, in
}
{
uint8_t *jpeg_data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// get a pointer to the stream buffer
FreeImage_AcquireMemory(hJpegMemory, &jpeg_data, &size_in_bytes);
// write chunks
- for(DWORD k = 0; k < size_in_bytes;) {
- DWORD bytes_left = size_in_bytes - k;
- DWORD chunk_size = MIN(JPEG_CHUNK_SIZE, bytes_left);
+ for(uint32_t k = 0; k < size_in_bytes;) {
+ uint32_t bytes_left = size_in_bytes - k;
+ uint32_t chunk_size = MIN(JPEG_CHUNK_SIZE, bytes_left);
mng_WriteChunk(mng_JDAT, &jpeg_data[k], chunk_size, hJngMemory);
k += chunk_size;
}
@@ -1260,8 +1260,8 @@ mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, in
// get the IDAT chunk
{
BOOL bResult = FALSE;
- DWORD start_pos = 0;
- DWORD next_pos = 0;
+ uint32_t start_pos = 0;
+ uint32_t next_pos = 0;
long offset = 8;
do {
@@ -1270,7 +1270,7 @@ mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, in
if(!bResult) break;
uint8_t *png_data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
// get a pointer to the stream buffer
FreeImage_AcquireMemory(hPngMemory, &png_data, &size_in_bytes);
@@ -1292,7 +1292,7 @@ mng_WriteJNG(int format_id, FreeImageIO *io, FIBITMAP *dib, fi_handle handle, in
// write the JNG on output stream
{
uint8_t *jng_data = NULL;
- DWORD size_in_bytes = 0;
+ uint32_t size_in_bytes = 0;
FreeImage_AcquireMemory(hJngMemory, &jng_data, &size_in_bytes);
io->write_proc(jng_data, 1, size_in_bytes, handle);
}
diff --git a/libs/freeimage/src/FreeImage/MemoryIO.cpp b/libs/freeimage/src/FreeImage/MemoryIO.cpp
index bcac67d57d..c7b34c090f 100644
--- a/libs/freeimage/src/FreeImage/MemoryIO.cpp
+++ b/libs/freeimage/src/FreeImage/MemoryIO.cpp
@@ -30,7 +30,7 @@
// =====================================================================
FIMEMORY * DLL_CALLCONV
-FreeImage_OpenMemory(uint8_t *data, DWORD size_in_bytes) {
+FreeImage_OpenMemory(uint8_t *data, uint32_t size_in_bytes) {
// allocate a memory handle
FIMEMORY *stream = (FIMEMORY*)malloc(sizeof(FIMEMORY));
if(stream) {
@@ -113,7 +113,7 @@ FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, i
// =====================================================================
BOOL DLL_CALLCONV
-FreeImage_AcquireMemory(FIMEMORY *stream, uint8_t **data, DWORD *size_in_bytes) {
+FreeImage_AcquireMemory(FIMEMORY *stream, uint8_t **data, uint32_t *size_in_bytes) {
if (stream) {
FIMEMORYHEADER *mem_header = (FIMEMORYHEADER*)(stream->data);
diff --git a/libs/freeimage/src/FreeImage/MultiPage.cpp b/libs/freeimage/src/FreeImage/MultiPage.cpp
index c246692957..2d9affb21e 100644
--- a/libs/freeimage/src/FreeImage/MultiPage.cpp
+++ b/libs/freeimage/src/FreeImage/MultiPage.cpp
@@ -592,7 +592,7 @@ FreeImage_SavePageToBlock(MULTIBITMAPHEADER *header, FIBITMAP *data) {
return res;
}
- DWORD compressed_size = 0;
+ uint32_t compressed_size = 0;
uint8_t *compressed_data = NULL;
// compress the bitmap data
@@ -755,7 +755,7 @@ FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *page, BOOL changed) {
// compress the data
- DWORD compressed_size = 0;
+ uint32_t compressed_size = 0;
uint8_t *compressed_data = NULL;
// open a memory handle
diff --git a/libs/freeimage/src/FreeImage/PluginBMP.cpp b/libs/freeimage/src/FreeImage/PluginBMP.cpp
index 8734c51b9b..bdf4dd581c 100644
--- a/libs/freeimage/src/FreeImage/PluginBMP.cpp
+++ b/libs/freeimage/src/FreeImage/PluginBMP.cpp
@@ -38,7 +38,7 @@ static const uint8_t RLE_DELTA = 2;
static const uint8_t BI_ALPHABITFIELDS = 6; // compression: Bit field (this value is valid in Windows CE .NET 4.0 and later)
typedef struct tagBITMAPINFOOS2_1X_HEADER {
- DWORD biSize;
+ uint32_t biSize;
uint16_t biWidth;
uint16_t biHeight;
uint16_t biPlanes;
@@ -59,14 +59,14 @@ static int s_format_id;
static void
SwapInfoHeader(BITMAPINFOHEADER *header) {
SwapLong(&header->biSize);
- SwapLong((DWORD *)&header->biWidth);
- SwapLong((DWORD *)&header->biHeight);
+ SwapLong((uint32_t *)&header->biWidth);
+ SwapLong((uint32_t *)&header->biHeight);
SwapShort(&header->biPlanes);
SwapShort(&header->biBitCount);
SwapLong(&header->biCompression);
SwapLong(&header->biSizeImage);
- SwapLong((DWORD *)&header->biXPelsPerMeter);
- SwapLong((DWORD *)&header->biYPelsPerMeter);
+ SwapLong((uint32_t *)&header->biXPelsPerMeter);
+ SwapLong((uint32_t *)&header->biYPelsPerMeter);
SwapLong(&header->biClrUsed);
SwapLong(&header->biClrImportant);
}
@@ -537,8 +537,8 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
else if (type >= 56) use_bitfields = 4;
if (use_bitfields > 0) {
- DWORD bitfields[4];
- io->read_proc(bitfields, use_bitfields * sizeof(DWORD), 1, handle);
+ uint32_t bitfields[4];
+ io->read_proc(bitfields, use_bitfields * sizeof(uint32_t), 1, handle);
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, bitfields[0], bitfields[1], bitfields[2]);
} else {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI16_555_RED_MASK, FI16_555_GREEN_MASK, FI16_555_BLUE_MASK);
@@ -577,8 +577,8 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
else if (type >= 56) use_bitfields = 4;
if (use_bitfields > 0) {
- DWORD bitfields[4];
- io->read_proc(bitfields, use_bitfields * sizeof(DWORD), 1, handle);
+ uint32_t bitfields[4];
+ io->read_proc(bitfields, use_bitfields * sizeof(uint32_t), 1, handle);
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, bitfields[0], bitfields[1], bitfields[2]);
} else {
if( bit_count == 32 ) {
@@ -753,9 +753,9 @@ LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_
case 16 :
{
if (bih.biCompression == 3) {
- DWORD bitfields[3];
+ uint32_t bitfields[3];
- io->read_proc(bitfields, 3 * sizeof(DWORD), 1, handle);
+ io->read_proc(bitfields, 3 * sizeof(uint32_t), 1, handle);
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, bitfields[0], bitfields[1], bitfields[2]);
} else {
@@ -1051,7 +1051,7 @@ static FIBITMAP * DLL_CALLCONV
Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
if (handle != NULL) {
BITMAPFILEHEADER bitmapfileheader;
- DWORD type = 0;
+ uint32_t type = 0;
// we use this offset value to make seemingly absolute seeks relative in the file
@@ -1073,8 +1073,8 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// read the first byte of the infoheader
- io->read_proc(&type, sizeof(DWORD), 1, handle);
- io->seek_proc(handle, 0 - (long)sizeof(DWORD), SEEK_CUR);
+ io->read_proc(&type, sizeof(uint32_t), 1, handle);
+ io->seek_proc(handle, 0 - (long)sizeof(uint32_t), SEEK_CUR);
#ifdef FREEIMAGE_BIGENDIAN
SwapLong(&type);
#endif
@@ -1283,8 +1283,8 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
bool bit_fields = (dst_bpp == 16) ? true : false;
if (bit_fields) {
- bitmapfileheader.bfSize += 3 * sizeof(DWORD);
- bitmapfileheader.bfOffBits += 3 * sizeof(DWORD);
+ bitmapfileheader.bfSize += 3 * sizeof(uint32_t);
+ bitmapfileheader.bfOffBits += 3 * sizeof(uint32_t);
}
#ifdef FREEIMAGE_BIGENDIAN
@@ -1321,23 +1321,23 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// write the bit fields when we are dealing with a 16 bit BMP
if (bit_fields) {
- DWORD d;
+ uint32_t d;
d = FreeImage_GetRedMask(dib);
- if (io->write_proc(&d, sizeof(DWORD), 1, handle) != 1) {
+ if (io->write_proc(&d, sizeof(uint32_t), 1, handle) != 1) {
return FALSE;
}
d = FreeImage_GetGreenMask(dib);
- if (io->write_proc(&d, sizeof(DWORD), 1, handle) != 1) {
+ if (io->write_proc(&d, sizeof(uint32_t), 1, handle) != 1) {
return FALSE;
}
d = FreeImage_GetBlueMask(dib);
- if (io->write_proc(&d, sizeof(DWORD), 1, handle) != 1) {
+ if (io->write_proc(&d, sizeof(uint32_t), 1, handle) != 1) {
return FALSE;
}
}
@@ -1405,7 +1405,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
} else if (bpp == 24) {
int padding = dst_pitch - dst_width * sizeof(FILE_BGR);
- DWORD pad = 0;
+ uint32_t pad = 0;
FILE_BGR bgr;
for(unsigned y = 0; y < dst_height; y++) {
uint8_t *line = FreeImage_GetScanLine(dib, y);
diff --git a/libs/freeimage/src/FreeImage/PluginGIF.cpp b/libs/freeimage/src/FreeImage/PluginGIF.cpp
index 3ec9a1b280..60ce1fb042 100644
--- a/libs/freeimage/src/FreeImage/PluginGIF.cpp
+++ b/libs/freeimage/src/FreeImage/PluginGIF.cpp
@@ -144,7 +144,7 @@ static int g_GifInterlaceIncrement[GIF_INTERLACE_PASSES] = {8, 8, 4, 2};
// ==========================================================
static BOOL
-FreeImage_SetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, uint16_t id, FREE_IMAGE_MDTYPE type, DWORD count, DWORD length, const void *value)
+FreeImage_SetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, uint16_t id, FREE_IMAGE_MDTYPE type, uint32_t count, uint32_t length, const void *value)
{
BOOL bResult = FALSE;
FITAG *tag = FreeImage_CreateTag();
@@ -1025,7 +1025,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
comment.append(1, '\0');
sprintf(buf, "Comment%zd", idx);
- DWORD comment_size = (DWORD)comment.size();
+ uint32_t comment_size = (uint32_t)comment.size();
FreeImage_SetMetadataEx(FIMD_COMMENTS, dib, buf, 1, FIDT_ASCII, comment_size, comment_size, comment.c_str());
}
}
diff --git a/libs/freeimage/src/FreeImage/PluginICO.cpp b/libs/freeimage/src/FreeImage/PluginICO.cpp
index 96db02ad3c..125e9e2a35 100644
--- a/libs/freeimage/src/FreeImage/PluginICO.cpp
+++ b/libs/freeimage/src/FreeImage/PluginICO.cpp
@@ -48,8 +48,8 @@ typedef struct tagICONDIRECTORYENTRY {
uint8_t bReserved; // reserved
uint16_t wPlanes; // color Planes
uint16_t wBitCount; // bits per pixel
- DWORD dwBytesInRes; // how many bytes in this resource?
- DWORD dwImageOffset; // where in the file is this image
+ uint32_t dwBytesInRes; // how many bytes in this resource?
+ uint32_t dwImageOffset; // where in the file is this image
} ICONDIRENTRY;
#ifdef _WIN32
@@ -62,7 +62,7 @@ typedef struct tagICONDIRECTORYENTRY {
// Static helpers
// ==========================================================
-/** How wide, in bytes, would this many bits be, DWORD aligned ?
+/** How wide, in bytes, would this many bits be, uint32_t aligned ?
*/
static int
WidthBytes(int bits) {
@@ -72,9 +72,9 @@ WidthBytes(int bits) {
/** Calculates the size of a single icon image
@return Returns the size for that image
*/
-static DWORD
+static uint32_t
CalculateImageSize(FIBITMAP* icon_dib) {
- DWORD dwNumBytes = 0;
+ uint32_t dwNumBytes = 0;
unsigned colors = FreeImage_GetColorsUsed(icon_dib);
unsigned width = FreeImage_GetWidth(icon_dib);
@@ -92,14 +92,14 @@ CalculateImageSize(FIBITMAP* icon_dib) {
/** Calculates the file offset for an icon image
@return Returns the file offset for that image
*/
-static DWORD
+static uint32_t
CalculateImageOffset(std::vector<FIBITMAP*>& vPages, int nIndex ) {
- DWORD dwSize;
+ uint32_t dwSize;
// calculate the ICO header size
dwSize = sizeof(ICONHEADER);
// add the ICONDIRENTRY's
- dwSize += (DWORD)( vPages.size() * sizeof(ICONDIRENTRY) );
+ dwSize += (uint32_t)( vPages.size() * sizeof(ICONDIRENTRY) );
// add the sizes of the previous images
for(int k = 0; k < nIndex; k++) {
FIBITMAP *icon_dib = (FIBITMAP*)vPages[k];
@@ -130,14 +130,14 @@ IsPNG(FreeImageIO *io, fi_handle handle) {
static void
SwapInfoHeader(BITMAPINFOHEADER *header) {
SwapLong(&header->biSize);
- SwapLong((DWORD *)&header->biWidth);
- SwapLong((DWORD *)&header->biHeight);
+ SwapLong((uint32_t *)&header->biWidth);
+ SwapLong((uint32_t *)&header->biHeight);
SwapShort(&header->biPlanes);
SwapShort(&header->biBitCount);
SwapLong(&header->biCompression);
SwapLong(&header->biSizeImage);
- SwapLong((DWORD *)&header->biXPelsPerMeter);
- SwapLong((DWORD *)&header->biYPelsPerMeter);
+ SwapLong((uint32_t *)&header->biXPelsPerMeter);
+ SwapLong((uint32_t *)&header->biYPelsPerMeter);
SwapLong(&header->biClrUsed);
SwapLong(&header->biClrImportant);
}
@@ -744,7 +744,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// write the image bits for each image
- DWORD dwImageOffset = (DWORD)io->tell_proc(handle);
+ uint32_t dwImageOffset = (uint32_t)io->tell_proc(handle);
for(k = 0; k < icon_header->idCount; k++) {
icon_dib = (FIBITMAP*)vPages[k];
@@ -760,7 +760,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
// update ICONDIRENTRY members
- DWORD dwBytesInRes = (DWORD)io->tell_proc(handle) - dwImageOffset;
+ uint32_t dwBytesInRes = (uint32_t)io->tell_proc(handle) - dwImageOffset;
icon_list[k].dwImageOffset = dwImageOffset;
icon_list[k].dwBytesInRes = dwBytesInRes;
dwImageOffset += dwBytesInRes;
diff --git a/libs/freeimage/src/FreeImage/PluginJPEG.cpp b/libs/freeimage/src/FreeImage/PluginJPEG.cpp
index 23c13deef2..68b7b00ffb 100644
--- a/libs/freeimage/src/FreeImage/PluginJPEG.cpp
+++ b/libs/freeimage/src/FreeImage/PluginJPEG.cpp
@@ -636,8 +636,8 @@ jpeg_read_xmp_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datale
if(tag) {
FreeImage_SetTagID(tag, JPEG_APP0+1); // 0xFFE1
FreeImage_SetTagKey(tag, g_TagLib_XMPFieldName);
- FreeImage_SetTagLength(tag, (DWORD)length);
- FreeImage_SetTagCount(tag, (DWORD)length);
+ FreeImage_SetTagLength(tag, (uint32_t)length);
+ FreeImage_SetTagCount(tag, (uint32_t)length);
FreeImage_SetTagType(tag, FIDT_ASCII);
FreeImage_SetTagValue(tag, profile);
@@ -882,13 +882,13 @@ jpeg_write_xmp_profile(j_compress_ptr cinfo, FIBITMAP *dib) {
// XMP signature is 29 bytes long
unsigned int xmp_header_size = (unsigned int)strlen(xmp_signature) + 1;
- DWORD tag_length = FreeImage_GetTagLength(tag_xmp);
+ uint32_t tag_length = FreeImage_GetTagLength(tag_xmp);
uint8_t *profile = (uint8_t*)malloc((tag_length + xmp_header_size) * sizeof(uint8_t));
if(profile == NULL) return FALSE;
memcpy(profile, xmp_signature, xmp_header_size);
- for(DWORD i = 0; i < tag_length; i += 65504L) {
+ for(uint32_t i = 0; i < tag_length; i += 65504L) {
unsigned length = MIN((long)(tag_length - i), 65504L);
memcpy(profile + xmp_header_size, tag_value + i, length);
@@ -926,12 +926,12 @@ jpeg_write_exif_profile_raw(j_compress_ptr cinfo, FIBITMAP *dib) {
}
if(NULL != tag_value) {
- DWORD tag_length = FreeImage_GetTagLength(tag_exif);
+ uint32_t tag_length = FreeImage_GetTagLength(tag_exif);
uint8_t *profile = (uint8_t*)malloc(tag_length * sizeof(uint8_t));
if(profile == NULL) return FALSE;
- for(DWORD i = 0; i < tag_length; i += 65504L) {
+ for(uint32_t i = 0; i < tag_length; i += 65504L) {
unsigned length = MIN((long)(tag_length - i), 65504L);
memcpy(profile, tag_value + i, length);
@@ -982,14 +982,14 @@ jpeg_write_jfxx(j_compress_ptr cinfo, FIBITMAP *dib) {
}
uint8_t* thData = NULL;
- DWORD thSize = 0;
+ uint32_t thSize = 0;
FreeImage_AcquireMemory(stream, &thData, &thSize);
uint8_t id_length = 5; //< "JFXX"
uint8_t type = JFXX_TYPE_JPEG;
- DWORD totalsize = id_length + sizeof(type) + thSize;
+ uint32_t totalsize = id_length + sizeof(type) + thSize;
jpeg_write_m_header(cinfo, JPEG_APP0, totalsize);
jpeg_write_m_byte(cinfo, 'J');
@@ -1065,8 +1065,8 @@ store_size_info(FIBITMAP *dib, JDIMENSION width, JDIMENSION height) {
sprintf(buffer, "%d", (int)width);
length = strlen(buffer) + 1; // include the NULL/0 value
FreeImage_SetTagKey(tag, "OriginalJPEGWidth");
- FreeImage_SetTagLength(tag, (DWORD)length);
- FreeImage_SetTagCount(tag, (DWORD)length);
+ FreeImage_SetTagLength(tag, (uint32_t)length);
+ FreeImage_SetTagCount(tag, (uint32_t)length);
FreeImage_SetTagType(tag, FIDT_ASCII);
FreeImage_SetTagValue(tag, buffer);
FreeImage_SetMetadata(FIMD_COMMENTS, dib, FreeImage_GetTagKey(tag), tag);
@@ -1074,8 +1074,8 @@ store_size_info(FIBITMAP *dib, JDIMENSION width, JDIMENSION height) {
sprintf(buffer, "%d", (int)height);
length = strlen(buffer) + 1; // include the NULL/0 value
FreeImage_SetTagKey(tag, "OriginalJPEGHeight");
- FreeImage_SetTagLength(tag, (DWORD)length);
- FreeImage_SetTagCount(tag, (DWORD)length);
+ FreeImage_SetTagLength(tag, (uint32_t)length);
+ FreeImage_SetTagCount(tag, (uint32_t)length);
FreeImage_SetTagType(tag, FIDT_ASCII);
FreeImage_SetTagValue(tag, buffer);
FreeImage_SetMetadata(FIMD_COMMENTS, dib, FreeImage_GetTagKey(tag), tag);
diff --git a/libs/freeimage/src/FreeImage/PluginPNG.cpp b/libs/freeimage/src/FreeImage/PluginPNG.cpp
index 9a00c23e19..a74026d894 100644
--- a/libs/freeimage/src/FreeImage/PluginPNG.cpp
+++ b/libs/freeimage/src/FreeImage/PluginPNG.cpp
@@ -115,7 +115,7 @@ ReadMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) {
tag = FreeImage_CreateTag();
if(!tag) return FALSE;
- DWORD tag_length = (DWORD) MAX(text_ptr[i].text_length, text_ptr[i].itxt_length);
+ uint32_t tag_length = (uint32_t) MAX(text_ptr[i].text_length, text_ptr[i].itxt_length);
FreeImage_SetTagLength(tag, tag_length);
FreeImage_SetTagCount(tag, tag_length);
@@ -147,7 +147,7 @@ ReadMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) {
// convert as 'yyyy:MM:dd hh:mm:ss'
sprintf(timestamp, "%4d:%02d:%02d %2d:%02d:%02d", mod_time->year, mod_time->month, mod_time->day, mod_time->hour, mod_time->minute, mod_time->second);
- DWORD tag_length = (DWORD)strlen(timestamp) + 1;
+ uint32_t tag_length = (uint32_t)strlen(timestamp) + 1;
FreeImage_SetTagLength(tag, tag_length);
FreeImage_SetTagCount(tag, tag_length);
FreeImage_SetTagType(tag, FIDT_ASCII);
diff --git a/libs/freeimage/src/FreeImage/PluginWebP.cpp b/libs/freeimage/src/FreeImage/PluginWebP.cpp
index 1e3a265407..cb3a615742 100644
--- a/libs/freeimage/src/FreeImage/PluginWebP.cpp
+++ b/libs/freeimage/src/FreeImage/PluginWebP.cpp
@@ -383,8 +383,8 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FITAG *tag = FreeImage_CreateTag();
if(tag) {
FreeImage_SetTagKey(tag, g_TagLib_XMPFieldName);
- FreeImage_SetTagLength(tag, (DWORD)xmp_metadata.size);
- FreeImage_SetTagCount(tag, (DWORD)xmp_metadata.size);
+ FreeImage_SetTagLength(tag, (uint32_t)xmp_metadata.size);
+ FreeImage_SetTagCount(tag, (uint32_t)xmp_metadata.size);
FreeImage_SetTagType(tag, FIDT_ASCII);
FreeImage_SetTagValue(tag, xmp_metadata.bytes);
@@ -583,7 +583,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
// store the blob into the mux
uint8_t *data = NULL;
- DWORD data_size = 0;
+ uint32_t data_size = 0;
FreeImage_AcquireMemory(hmem, &data, &data_size);
webp_image.bytes = data;
webp_image.size = data_size;
diff --git a/libs/freeimage/src/FreeImage/ZLibInterface.cpp b/libs/freeimage/src/FreeImage/ZLibInterface.cpp
index 571777c278..69c8df538a 100644
--- a/libs/freeimage/src/FreeImage/ZLibInterface.cpp
+++ b/libs/freeimage/src/FreeImage/ZLibInterface.cpp
@@ -36,8 +36,8 @@ which must be at least 0.1% larger than source_size plus 12 bytes.
@return Returns the actual size of the compressed buffer, returns 0 if an error occured
@see FreeImage_ZLibUncompress
*/
-DWORD DLL_CALLCONV
-FreeImage_ZLibCompress(uint8_t *target, DWORD target_size, uint8_t *source, DWORD source_size) {
+uint32_t DLL_CALLCONV
+FreeImage_ZLibCompress(uint8_t *target, uint32_t target_size, uint8_t *source, uint32_t source_size) {
uLongf dest_len = (uLongf)target_size;
int zerr = compress(target, &dest_len, source, source_size);
@@ -68,8 +68,8 @@ compression library.
@return Returns the actual size of the uncompressed buffer, returns 0 if an error occured
@see FreeImage_ZLibCompress
*/
-DWORD DLL_CALLCONV
-FreeImage_ZLibUncompress(uint8_t *target, DWORD target_size, uint8_t *source, DWORD source_size) {
+uint32_t DLL_CALLCONV
+FreeImage_ZLibUncompress(uint8_t *target, uint32_t target_size, uint8_t *source, uint32_t source_size) {
uLongf dest_len = (uLongf)target_size;
int zerr = uncompress(target, &dest_len, source, source_size);
@@ -99,10 +99,10 @@ which must be at least 0.1% larger than source_size plus 24 bytes.
@return Returns the actual size of the compressed buffer, returns 0 if an error occured
@see FreeImage_ZLibCompress
*/
-DWORD DLL_CALLCONV
-FreeImage_ZLibGZip(uint8_t *target, DWORD target_size, uint8_t *source, DWORD source_size) {
+uint32_t DLL_CALLCONV
+FreeImage_ZLibGZip(uint8_t *target, uint32_t target_size, uint8_t *source, uint32_t source_size) {
uLongf dest_len = (uLongf)target_size - 12;
- DWORD crc = crc32(0L, NULL, 0);
+ uint32_t crc = crc32(0L, NULL, 0);
// set up header (stolen from zlib/gzio.c)
sprintf((char *)target, "%c%c%c%c%c%c%c%c", 0x1f, 0x8b,
@@ -149,7 +149,7 @@ static int get_byte(z_stream *stream) {
static int checkheader(z_stream *stream) {
int flags, c;
- DWORD len;
+ uint32_t len;
if (get_byte(stream) != 0x1f || get_byte(stream) != 0x8b)
return Z_DATA_ERROR;
@@ -158,8 +158,8 @@ static int checkheader(z_stream *stream) {
for (len = 0; len < 6; len++) (void)get_byte(stream);
if ((flags & 0x04) != 0) { /* skip the extra field */
- len = (DWORD)get_byte(stream);
- len += ((DWORD)get_byte(stream)) << 8;
+ len = (uint32_t)get_byte(stream);
+ len += ((uint32_t)get_byte(stream)) << 8;
/* len is garbage if EOF but the loop below will quit anyway */
while (len-- != 0 && get_byte(stream) != EOF) ;
}
@@ -175,10 +175,10 @@ static int checkheader(z_stream *stream) {
return Z_OK;
}
-DWORD DLL_CALLCONV
-FreeImage_ZLibGUnzip(uint8_t *target, DWORD target_size, uint8_t *source, DWORD source_size) {
- DWORD src_len = source_size;
- DWORD dest_len = target_size;
+uint32_t DLL_CALLCONV
+FreeImage_ZLibGUnzip(uint8_t *target, uint32_t target_size, uint8_t *source, uint32_t source_size) {
+ uint32_t src_len = source_size;
+ uint32_t dest_len = target_size;
int zerr = Z_DATA_ERROR;
if (src_len > 0) {
@@ -216,8 +216,8 @@ If source is NULL, this function returns the required initial value for the crc.
@param source_size Size of the source buffer, in bytes
@return Returns the new crc value
*/
-DWORD DLL_CALLCONV
-FreeImage_ZLibCRC32(DWORD crc, uint8_t *source, DWORD source_size) {
+uint32_t DLL_CALLCONV
+FreeImage_ZLibCRC32(uint32_t crc, uint8_t *source, uint32_t source_size) {
return crc32(crc, source, source_size);
}