summaryrefslogtreecommitdiff
path: root/DevIL
diff options
context:
space:
mode:
authorDenton Woods <denton.woods@gmail.com>2016-12-28 18:19:16 -0600
committerDenton Woods <denton.woods@gmail.com>2016-12-28 18:19:16 -0600
commit3e2e3eaac80b9c0b8aab904d6ef5272bb198cf05 (patch)
treee7bafa7c17a7bd68614f0bea0c5b39d4ddee643d /DevIL
parentf35b4bd18f8cd4d7c4aed34d4905bc8d6931e5d5 (diff)
downloaddevil-3e2e3eaac80b9c0b8aab904d6ef5272bb198cf05.tar.gz
- Fixes for C++ changes
Diffstat (limited to 'DevIL')
-rw-r--r--DevIL/src-IL/include/il_dds.h2
-rwxr-xr-xDevIL/src-IL/src/il_blp.cpp4
-rw-r--r--DevIL/src-IL/src/il_convbuff.cpp2
-rw-r--r--DevIL/src-IL/src/il_dds.cpp8
-rw-r--r--DevIL/src-IL/src/il_dicom.cpp8
-rw-r--r--DevIL/src-IL/src/il_hdr.cpp2
-rw-r--r--DevIL/src-IL/src/il_icns.cpp2
-rwxr-xr-xDevIL/src-IL/src/il_iff.cpp8
-rw-r--r--DevIL/src-IL/src/il_ilbm.cpp3
-rw-r--r--DevIL/src-IL/src/il_iwi.cpp8
-rw-r--r--DevIL/src-IL/src/il_jpeg.cpp5
-rwxr-xr-xDevIL/src-IL/src/il_mp3.cpp4
-rw-r--r--DevIL/src-IL/src/il_rot.cpp16
-rw-r--r--DevIL/src-IL/src/il_stack.cpp16
-rw-r--r--DevIL/src-IL/src/il_vtf.cpp18
15 files changed, 60 insertions, 46 deletions
diff --git a/DevIL/src-IL/include/il_dds.h b/DevIL/src-IL/include/il_dds.h
index 045c29ec..c43ea5f3 100644
--- a/DevIL/src-IL/include/il_dds.h
+++ b/DevIL/src-IL/include/il_dds.h
@@ -176,7 +176,7 @@ ILboolean ReadData();
ILboolean AllocImage(ILuint CompFormat);
ILboolean DdsDecompress(ILuint CompFormat);
ILboolean ReadMipmaps(ILuint CompFormat);
-ILuint DecodePixelFormat();
+ILuint DecodePixelFormat(ILuint *CompFormat);
void DxtcReadColor(ILushort Data, Color8888* Out);
void DxtcReadColors(const ILubyte* Data, Color8888* Out);
ILboolean DecompressARGB(ILuint CompFormat);
diff --git a/DevIL/src-IL/src/il_blp.cpp b/DevIL/src-IL/src/il_blp.cpp
index 24044519..157c45e8 100755
--- a/DevIL/src-IL/src/il_blp.cpp
+++ b/DevIL/src-IL/src/il_blp.cpp
@@ -155,7 +155,7 @@ ILboolean iIsValidBlp2(void)
ILboolean iCheckBlp2(BLP2HEAD *Header)
{
// The file signature is 'BLP2'.
- if (strncmp(Header->Sig, "BLP2", 4))
+ if (strncmp((char*)Header->Sig, "BLP2", 4))
return IL_FALSE;
// Valid types are JPEG and DXTC. JPEG is not common, though.
// WoW only uses DXTC.
@@ -531,7 +531,7 @@ ILboolean iGetBlp1Head(BLP1HEAD *Header)
ILboolean iCheckBlp1(BLP1HEAD *Header)
{
// The file signature is 'BLP1'.
- if (strncmp(Header->Sig, "BLP1", 4))
+ if (strncmp((char*)Header->Sig, "BLP1", 4))
return IL_FALSE;
// Valid types are JPEG and RAW. JPEG is not common, though.
if (Header->Compression != BLP_TYPE_JPG && Header->Compression != BLP_RAW)
diff --git a/DevIL/src-IL/src/il_convbuff.cpp b/DevIL/src-IL/src/il_convbuff.cpp
index c9e0d508..6dbafeab 100644
--- a/DevIL/src-IL/src/il_convbuff.cpp
+++ b/DevIL/src-IL/src/il_convbuff.cpp
@@ -86,7 +86,7 @@ ILAPI void* ILAPIENTRY ilConvertBuffer(ILuint SizeOfData, ILenum SrcFormat, ILen
PalImage->Depth = 1;
PalImage->Format = IL_COLOUR_INDEX;
PalImage->Type = IL_UNSIGNED_BYTE;
- PalImage->Data = Buffer;
+ PalImage->Data = (ILubyte*)Buffer;
PalImage->Bpp = 1;
PalImage->SizeOfData = SizeOfData;
diff --git a/DevIL/src-IL/src/il_dds.cpp b/DevIL/src-IL/src/il_dds.cpp
index 02978c7b..1eb53893 100644
--- a/DevIL/src-IL/src/il_dds.cpp
+++ b/DevIL/src-IL/src/il_dds.cpp
@@ -2053,7 +2053,7 @@ ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface()
}
if (iCurImage->Data == NULL) {
- iCurImage->Data = ialloc(iCurImage->SizeOfData);
+ iCurImage->Data = (ILubyte*)ialloc(iCurImage->SizeOfData);
}
Image = iCurImage;
@@ -2122,7 +2122,7 @@ ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData(ILenum Format)
ilGetDXTCData(Data, Size, Format);
//These have to be after the call to ilGetDXTCData()
- iCurImage->DxtcData = Data;
+ iCurImage->DxtcData = (ILubyte*)Data;
iCurImage->DxtcFormat = Format;
iCurImage->DxtcSize = Size;
@@ -2218,7 +2218,7 @@ ILAPI ILboolean ILAPIENTRY ilTexImageDxtc(ILint w, ILint h, ILint d, ILenum DxtF
Image->DxtcFormat = DxtFormat;
Image->DxtcSize = DataSize;
- Image->DxtcData = ialloc(DataSize);
+ Image->DxtcData = (ILubyte*)ialloc(DataSize);
if (Image->DxtcData == NULL) {
return IL_FALSE;
@@ -2372,7 +2372,7 @@ ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData()
}
LineSize = numXBlocks * BlockSize;
- Temp = ialloc(LineSize);
+ Temp = (ILubyte*)ialloc(LineSize);
if (Temp == NULL)
return;
diff --git a/DevIL/src-IL/src/il_dicom.cpp b/DevIL/src-IL/src/il_dicom.cpp
index 9fc087de..5f27ae79 100644
--- a/DevIL/src-IL/src/il_dicom.cpp
+++ b/DevIL/src-IL/src/il_dicom.cpp
@@ -145,11 +145,11 @@ ILboolean iGetDicomHead(DICOMHEAD *Header)
//@TODO: Look at pg. 60 of 07_05pu.pdf (PS 3.5) for more UIDs.
if (!GetUID(UID))
return IL_FALSE;
- if (!strncmp(UID, "1.2.840.10008.1.2.2", 64)) // Explicit big endian
+ if (!strncmp((char*)UID, "1.2.840.10008.1.2.2", 64)) // Explicit big endian
Header->BigEndian = IL_TRUE;
- else if (!strncmp(UID, "1.2.840.10008.1.2.1", 64)) // Explicit little endian
+ else if (!strncmp((char*)UID, "1.2.840.10008.1.2.1", 64)) // Explicit little endian
Header->BigEndian = IL_FALSE;
- else if (!strncmp(UID, "1.2.840.10008.1.2", 64)) // Implicit little endian
+ else if (!strncmp((char*)UID, "1.2.840.10008.1.2", 64)) // Implicit little endian
Header->BigEndian = IL_FALSE;
else
return IL_FALSE; // Unrecognized UID.
@@ -440,7 +440,7 @@ ILboolean GetUID(ILubyte *UID)
ILboolean iCheckDicom(DICOMHEAD *Header)
{
// Always has the signature "DICM" at position 0x80.
- if (strncmp(Header->Signature, "DICM", 4))
+ if (strncmp((char*)Header->Signature, "DICM", 4))
return IL_FALSE;
// Does not make sense to have any dimension = 0.
if (Header->Width == 0 || Header->Height == 0 || Header->Depth == 0)
diff --git a/DevIL/src-IL/src/il_hdr.cpp b/DevIL/src-IL/src/il_hdr.cpp
index 55b9bd16..37bd6d89 100644
--- a/DevIL/src-IL/src/il_hdr.cpp
+++ b/DevIL/src-IL/src/il_hdr.cpp
@@ -468,7 +468,7 @@ ILboolean RGBE_WriteHeader(ILuint width, ILuint height, rgbe_header_info *info)
char *programtype = "RGBE";
if (info && (info->valid & RGBE_VALID_PROGRAMTYPE))
- programtype = info->programtype;
+ programtype = (char*)info->programtype;
if (ilprintf("#?%s\n",programtype) < 0)
return IL_FALSE;
/* The #? is to identify file type, the programtype is optional. */
diff --git a/DevIL/src-IL/src/il_icns.cpp b/DevIL/src-IL/src/il_icns.cpp
index e316f2fb..7361b01b 100644
--- a/DevIL/src-IL/src/il_icns.cpp
+++ b/DevIL/src-IL/src/il_icns.cpp
@@ -252,7 +252,7 @@ ILboolean iIcnsReadData(ILboolean *BaseCreated, ILboolean IsAlpha, ILint Width,
}
}
- Data = ialloc(Entry->Size - 8);
+ Data = (ILubyte*)ialloc(Entry->Size - 8);
if (Data == NULL)
return IL_FALSE;
diff --git a/DevIL/src-IL/src/il_iff.cpp b/DevIL/src-IL/src/il_iff.cpp
index e4ad8070..588becb4 100755
--- a/DevIL/src-IL/src/il_iff.cpp
+++ b/DevIL/src-IL/src/il_iff.cpp
@@ -343,7 +343,7 @@ void iff_end_read_chunk()
char * iff_read_data(int size)
{
- char *buffer = ialloc(size * sizeof(char));
+ char *buffer = (char*)ialloc(size * sizeof(char));
if (buffer == NULL)
return NULL;
@@ -368,7 +368,7 @@ char *iffReadUncompressedTile(ILushort width, ILushort height, ILbyte depth)
int i, j;
int tam = width* height * depth * sizeof(char);
- data = ialloc(tam);
+ data = (char*)ialloc(tam);
if (data == NULL)
return NULL;
@@ -414,7 +414,7 @@ char *iff_decompress_tile_rle(ILushort width, ILushort height, ILushort depth,
}
// Build all the channels from the decompression into an RGBA array.
- data = ialloc(width * height * depth * sizeof(char));
+ data = (char*)ialloc(width * height * depth * sizeof(char));
if (data == NULL)
return NULL;
@@ -435,7 +435,7 @@ char *iff_decompress_rle(ILuint numBytes, char *compressedData,
ILuint *compressedStartIndex)
{
- char *data = ialloc(numBytes * sizeof(char));
+ char *data = (char*)ialloc(numBytes * sizeof(char));
unsigned char nextChar, count;
int i;
ILuint byteCount = 0;
diff --git a/DevIL/src-IL/src/il_ilbm.cpp b/DevIL/src-IL/src/il_ilbm.cpp
index 810383cd..a16da706 100644
--- a/DevIL/src-IL/src/il_ilbm.cpp
+++ b/DevIL/src-IL/src/il_ilbm.cpp
@@ -399,7 +399,8 @@ static ILboolean load_ilbm(void)
/* Allocate memory for a temporary buffer ( used for
decompression/deinterleaving ) */
- if ( ( MiniBuf = (void *)malloc( bytesperline * nbplanes ) ) == NULL )
+ //@TODO: Why do we have a malloc here instead of ialloc?
+ if ( ( MiniBuf = (ILubyte*)malloc( bytesperline * nbplanes ) ) == NULL )
{
ilSetError( IL_OUT_OF_MEMORY );
error="no enough memory for temporary buffer";
diff --git a/DevIL/src-IL/src/il_iwi.cpp b/DevIL/src-IL/src/il_iwi.cpp
index dac2dfcf..6ac4a069 100644
--- a/DevIL/src-IL/src/il_iwi.cpp
+++ b/DevIL/src-IL/src/il_iwi.cpp
@@ -311,7 +311,7 @@ ILboolean IwiReadImage(ILimage *BaseImage, IWIHEAD *Header, ILuint NumMips)
case IWI_ARGB4: //@TODO: Find some test images for this.
// Data is in ARGB4 format - 4 bits per component.
SizeOfData = Image->Width * Image->Height * 2;
- CompData = ialloc(SizeOfData); // Not really compressed - just in ARGB4 format.
+ CompData = (ILubyte*)ialloc(SizeOfData); // Not really compressed - just in ARGB4 format.
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -330,7 +330,7 @@ ILboolean IwiReadImage(ILimage *BaseImage, IWIHEAD *Header, ILuint NumMips)
case IWI_DXT1:
// DXT1 data has at least 8 bytes, even for one pixel.
SizeOfData = IL_MAX(Image->Width * Image->Height / 2, 8);
- CompData = ialloc(SizeOfData); // Gives a 6:1 compression ratio (or 8:1 for DXT1 with alpha)
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 6:1 compression ratio (or 8:1 for DXT1 with alpha)
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -357,7 +357,7 @@ ILboolean IwiReadImage(ILimage *BaseImage, IWIHEAD *Header, ILuint NumMips)
case IWI_DXT3:
// DXT3 data has at least 16 bytes, even for one pixel.
SizeOfData = IL_MAX(Image->Width * Image->Height, 16);
- CompData = ialloc(SizeOfData); // Gives a 4:1 compression ratio
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 4:1 compression ratio
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -375,7 +375,7 @@ ILboolean IwiReadImage(ILimage *BaseImage, IWIHEAD *Header, ILuint NumMips)
case IWI_DXT5:
// DXT5 data has at least 16 bytes, even for one pixel.
SizeOfData = IL_MAX(Image->Width * Image->Height, 16);
- CompData = ialloc(SizeOfData); // Gives a 4:1 compression ratio
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 4:1 compression ratio
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
diff --git a/DevIL/src-IL/src/il_jpeg.cpp b/DevIL/src-IL/src/il_jpeg.cpp
index 54e18756..42682ce5 100644
--- a/DevIL/src-IL/src/il_jpeg.cpp
+++ b/DevIL/src-IL/src/il_jpeg.cpp
@@ -152,7 +152,8 @@ ILboolean ilIsValidJpegL(const void *Lump, ILuint Size)
#ifndef IL_USE_IJL // Use libjpeg instead of the IJL.
// Overrides libjpeg's stupid error/warning handlers. =P
-void ExitErrorHandle (struct jpeg_common_struct *JpegInfo)
+//void ExitErrorHandle (struct jpeg_common_struct *JpegInfo)
+void ExitErrorHandle(j_common_ptr cinfo)
{
ilSetError(IL_LIB_JPEG_ERROR);
jpgErrorOccured = IL_TRUE;
@@ -925,7 +926,7 @@ ILboolean ilSaveFromJpegStruct(void *_JpegInfo)
{
#ifndef IL_NO_JPG
#ifndef IL_USE_IJL
- void (*errorHandler)();
+ void (*errorHandler)(j_common_ptr);
JSAMPROW row_pointer[1];
ILimage *TempImage;
ILubyte *TempData;
diff --git a/DevIL/src-IL/src/il_mp3.cpp b/DevIL/src-IL/src/il_mp3.cpp
index d75711b9..5e12a4c0 100755
--- a/DevIL/src-IL/src/il_mp3.cpp
+++ b/DevIL/src-IL/src/il_mp3.cpp
@@ -167,9 +167,9 @@ ILuint iFindMp3Pic(MP3HEAD *Header)
// The MimeType must be terminated by 0 in the file by the specs.
if (MimeType[i] != 0)
return MP3_NONE;
- if (!strcmp(MimeType, "image/jpeg"))
+ if (!strcmp((char*)MimeType, "image/jpeg"))
Type = MP3_JPG;
- else if (!strcmp(MimeType, "image/png"))
+ else if (!strcmp((char*)MimeType, "image/png"))
Type = MP3_PNG;
else
Type = MP3_NONE;
diff --git a/DevIL/src-IL/src/il_rot.cpp b/DevIL/src-IL/src/il_rot.cpp
index 38cf3067..9601f6b3 100644
--- a/DevIL/src-IL/src/il_rot.cpp
+++ b/DevIL/src-IL/src/il_rot.cpp
@@ -89,7 +89,7 @@ ILboolean iLoadRotInternal(void)
iread(Form, 1, 4);
FormLen = GetBigUInt();
iread(FormName, 1, 4);
- if (strncmp(Form, "FORM", 4) || FormLen != 0x14 || strncmp(FormName, "HEAD", 4)) {
+ if (strncmp((char*)Form, "FORM", 4) || FormLen != 0x14 || strncmp((char*)FormName, "HEAD", 4)) {
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
@@ -118,7 +118,7 @@ ILboolean iLoadRotInternal(void)
FormatIL = IL_RGBA;
// Allocates the maximum needed (the first width/height given in the file).
CompSize = ((Width + 3) / 4) * ((Height + 3) / 4) * 16;
- CompData = ialloc(CompSize);
+ CompData = (ILubyte*)ialloc(CompSize);
if (CompData == NULL)
return IL_FALSE;
break;
@@ -141,7 +141,7 @@ ILboolean iLoadRotInternal(void)
FormLen = GetBigUInt();
iread(FormName, 1, 4);
//@TODO: Not sure if the FormLen has to be anything specific here.
- if (strncmp(Form, "FORM", 4) || strncmp(FormName, "MIPS", 4)) {
+ if (strncmp((char*)Form, "FORM", 4) || strncmp((char*)FormName, "MIPS", 4)) {
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
@@ -154,7 +154,7 @@ ILboolean iLoadRotInternal(void)
// This is the size of the mipmap data.
MipSize = GetBigUInt();
iread(FormName, 1, 4);
- if (strncmp(Form, "FORM", 4)) {
+ if (strncmp((char*)Form, "FORM", 4)) {
if (!BaseCreated) { // Our file is malformed.
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
@@ -162,7 +162,7 @@ ILboolean iLoadRotInternal(void)
// We have reached the end of the mipmap data.
break;
}
- if (strncmp(FormName, "MLVL", 4)) {
+ if (strncmp((char*)FormName, "MLVL", 4)) {
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
@@ -204,7 +204,7 @@ ILboolean iLoadRotInternal(void)
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
- CompData = ialloc(CompSize);
+ CompData = (ILubyte*)ialloc(CompSize);
if (CompData == NULL)
return IL_FALSE;
@@ -231,7 +231,7 @@ ILboolean iLoadRotInternal(void)
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
- CompData = ialloc(CompSize);
+ CompData = (ILubyte*)ialloc(CompSize);
if (CompData == NULL)
return IL_FALSE;
@@ -258,7 +258,7 @@ ILboolean iLoadRotInternal(void)
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
- CompData = ialloc(CompSize);
+ CompData = (ILubyte*)ialloc(CompSize);
if (CompData == NULL)
return IL_FALSE;
diff --git a/DevIL/src-IL/src/il_stack.cpp b/DevIL/src-IL/src/il_stack.cpp
index 3d36c81e..4bfca68d 100644
--- a/DevIL/src-IL/src/il_stack.cpp
+++ b/DevIL/src-IL/src/il_stack.cpp
@@ -544,6 +544,12 @@ void* ILAPIENTRY ilRecalloc(void *Ptr, ILuint OldSize, ILuint NewSize)
}
+// To keep Visual Studio happy with its unhappiness with ILAPIENTRY for atexit
+void ilShutDownInternal()
+{
+ ilShutDown();
+}
+
// Internal function to enlarge the image stack by I_STACK_INCREMENT members.
ILboolean iEnlargeStack()
{
@@ -554,7 +560,7 @@ ILboolean iEnlargeStack()
AddToAtexit(); // So iFreeMem doesn't get called after unfreed information.
#endif//_MEM_DEBUG
#if (!defined(_WIN32_WCE)) && (!defined(IL_STATIC_LIB))
- atexit((void*)ilShutDown);
+ atexit(ilShutDownInternal);
#endif
OnExit = IL_TRUE;
}
@@ -569,6 +575,12 @@ ILboolean iEnlargeStack()
static ILboolean IsInit = IL_FALSE;
+// To keep Visual Studio happy with its unhappiness with ILAPIENTRY for atexit
+void ilRemoveRegisteredInternal()
+{
+ ilRemoveRegistered();
+}
+
// ONLY call at startup.
void ILAPIENTRY ilInit()
{
@@ -583,7 +595,7 @@ void ILAPIENTRY ilInit()
ilResetRead();
ilResetWrite();
#if (!defined(_WIN32_WCE)) && (!defined(IL_STATIC_LIB))
- atexit((void*)ilRemoveRegistered);
+ atexit(ilRemoveRegisteredInternal);
#endif
//_WIN32_WCE
//ilShutDown();
diff --git a/DevIL/src-IL/src/il_vtf.cpp b/DevIL/src-IL/src/il_vtf.cpp
index c49a614b..664f7584 100644
--- a/DevIL/src-IL/src/il_vtf.cpp
+++ b/DevIL/src-IL/src/il_vtf.cpp
@@ -399,7 +399,7 @@ ILboolean iLoadVtfInternal(void)
case IMAGE_FORMAT_DXT1_ONEBITALPHA:
// The block size is 8.
SizeOfData = IL_MAX(Image->Width * Image->Height * Image->Depth / 2, 8);
- CompData = ialloc(SizeOfData); // Gives a 6:1 compression ratio (or 8:1 for DXT1 with alpha)
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 6:1 compression ratio (or 8:1 for DXT1 with alpha)
if (CompData == NULL)
return IL_FALSE;
iread(CompData, 1, SizeOfData);
@@ -417,7 +417,7 @@ ILboolean iLoadVtfInternal(void)
case IMAGE_FORMAT_DXT3:
// The block size is 16.
SizeOfData = IL_MAX(Image->Width * Image->Height * Image->Depth, 16);
- CompData = ialloc(SizeOfData); // Gives a 4:1 compression ratio
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 4:1 compression ratio
if (CompData == NULL)
return IL_FALSE;
iread(CompData, 1, SizeOfData);
@@ -435,7 +435,7 @@ ILboolean iLoadVtfInternal(void)
case IMAGE_FORMAT_DXT5:
// The block size is 16.
SizeOfData = IL_MAX(Image->Width * Image->Height * Image->Depth, 16);
- CompData = ialloc(SizeOfData); // Gives a 4:1 compression ratio
+ CompData = (ILubyte*)ialloc(SizeOfData); // Gives a 4:1 compression ratio
if (CompData == NULL)
return IL_FALSE;
iread(CompData, 1, SizeOfData);
@@ -477,7 +477,7 @@ ILboolean iLoadVtfInternal(void)
// Uncompressed 24-bit data with an unused alpha channel (we discard it)
case IMAGE_FORMAT_BGRX8888:
SizeOfData = Image->Width * Image->Height * Image->Depth * 3;
- Temp = CompData = ialloc(SizeOfData / 3 * 4); // Not compressed data
+ Temp = CompData = (ILubyte*)ialloc(SizeOfData / 3 * 4); // Not compressed data
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData / 3 * 4) != SizeOfData / 3 * 4) {
@@ -496,7 +496,7 @@ ILboolean iLoadVtfInternal(void)
// Uncompressed 16-bit floats (must be converted to 32-bit)
case IMAGE_FORMAT_RGBA16161616F:
SizeOfData = Image->Width * Image->Height * Image->Depth * Image->Bpp * 2;
- CompData = ialloc(SizeOfData); // Not compressed data
+ CompData = (ILubyte*)ialloc(SizeOfData); // Not compressed data
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -534,7 +534,7 @@ ILboolean iLoadVtfInternal(void)
case IMAGE_FORMAT_RGB565:
case IMAGE_FORMAT_BGR565:
SizeOfData = Image->Width * Image->Height * Image->Depth * 2;
- Data16Bit = CompData = ialloc(SizeOfData); // Not compressed data
+ Data16Bit = CompData = (ILubyte*)ialloc(SizeOfData); // Not compressed data
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -555,7 +555,7 @@ ILboolean iLoadVtfInternal(void)
// The data is in the file as: gggbbbbb arrrrrgg
case IMAGE_FORMAT_BGRA5551:
SizeOfData = Image->Width * Image->Height * Image->Depth * 2;
- Data16Bit = CompData = ialloc(SizeOfData); // Not compressed data
+ Data16Bit = CompData = (ILubyte*)ialloc(SizeOfData); // Not compressed data
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
@@ -575,7 +575,7 @@ ILboolean iLoadVtfInternal(void)
// Same as above, but the alpha channel is unused.
case IMAGE_FORMAT_BGRX5551:
SizeOfData = Image->Width * Image->Height * Image->Depth * 2;
- Data16Bit = CompData = ialloc(SizeOfData); // Not compressed data
+ Data16Bit = CompData = (ILubyte*)ialloc(SizeOfData); // Not compressed data
if (iread(CompData, 1, SizeOfData) != SizeOfData) {
bVtf = IL_FALSE;
break;
@@ -591,7 +591,7 @@ ILboolean iLoadVtfInternal(void)
// Data is reduced to a 4-bits per channel format.
case IMAGE_FORMAT_BGRA4444:
SizeOfData = Image->Width * Image->Height * Image->Depth * 4;
- Temp = CompData = ialloc(SizeOfData / 2); // Not compressed data
+ Temp = CompData = (ILubyte*)ialloc(SizeOfData / 2); // Not compressed data
if (CompData == NULL)
return IL_FALSE;
if (iread(CompData, 1, SizeOfData / 2) != SizeOfData / 2) {