@@ -199,11 +199,11 @@ extern void LoadFontDefault(void)
199
199
// Re-construct image from defaultFontData and generate OpenGL texture
200
200
//----------------------------------------------------------------------
201
201
Image imFont = {
202
- .data = calloc (128 * 128 , 2 ), // 2 bytes per pixel (gray + alpha)
202
+ .data = RL_CALLOC (128 * 128 , 2 ), // 2 bytes per pixel (gray + alpha)
203
203
.width = 128 ,
204
204
.height = 128 ,
205
- .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA ,
206
- .mipmaps = 1
205
+ .mipmaps = 1 ,
206
+ .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA
207
207
};
208
208
209
209
// Fill image.data with defaultFontData (convert from bit to pixel!)
@@ -454,8 +454,8 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
454
454
.data = pixels ,
455
455
.width = image .width ,
456
456
.height = image .height ,
457
- .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 ,
458
- .mipmaps = 1
457
+ .mipmaps = 1 ,
458
+ .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
459
459
};
460
460
461
461
// Set font with all data parsed from image
@@ -620,11 +620,11 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz
620
620
if (ch == 32 )
621
621
{
622
622
Image imSpace = {
623
- .data = calloc (chars [i ].advanceX * fontSize , 2 ),
623
+ .data = RL_CALLOC (chars [i ].advanceX * fontSize , 2 ),
624
624
.width = chars [i ].advanceX ,
625
625
.height = fontSize ,
626
- .format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE ,
627
- .mipmaps = 1
626
+ .mipmaps = 1 ,
627
+ .format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
628
628
};
629
629
630
630
chars [i ].image = imSpace ;
@@ -896,7 +896,7 @@ bool ExportFontAsCode(Font font, const char *fileName)
896
896
897
897
// Compress font image data
898
898
int compDataSize = 0 ;
899
- unsigned char * compData = CompressData (image .data , imageDataSize , & compDataSize );
899
+ unsigned char * compData = CompressData (( const unsigned char * ) image .data , imageDataSize , & compDataSize );
900
900
901
901
// Save font image data (compressed)
902
902
byteCount += sprintf (txtData + byteCount , "#define COMPRESSED_DATA_SIZE_FONT_%s %i\n\n" , TextToUpper (fileNamePascal ), compDataSize );
@@ -1665,7 +1665,7 @@ int *LoadCodepoints(const char *text, int *count)
1665
1665
int codepointCount = 0 ;
1666
1666
1667
1667
// Allocate a big enough buffer to store as many codepoints as text bytes
1668
- int * codepoints = RL_CALLOC (textLength , sizeof (int ));
1668
+ int * codepoints = ( int * ) RL_CALLOC (textLength , sizeof (int ));
1669
1669
1670
1670
for (int i = 0 ; i < textLength ; codepointCount ++ )
1671
1671
{
@@ -1674,7 +1674,7 @@ int *LoadCodepoints(const char *text, int *count)
1674
1674
}
1675
1675
1676
1676
// Re-allocate buffer to the actual number of codepoints loaded
1677
- void * temp = RL_REALLOC (codepoints , codepointCount * sizeof (int ));
1677
+ int * temp = ( int * ) RL_REALLOC (codepoints , codepointCount * sizeof (int ));
1678
1678
if (temp != NULL ) codepoints = temp ;
1679
1679
1680
1680
* count = codepointCount ;
@@ -1992,7 +1992,7 @@ static Font LoadBMFont(const char *fileName)
1992
1992
if (lastSlash != NULL )
1993
1993
{
1994
1994
// NOTE: We need some extra space to avoid memory corruption on next allocations!
1995
- imPath = RL_CALLOC (TextLength (fileName ) - TextLength (lastSlash ) + TextLength (imFileName ) + 4 , 1 );
1995
+ imPath = ( char * ) RL_CALLOC (TextLength (fileName ) - TextLength (lastSlash ) + TextLength (imFileName ) + 4 , 1 );
1996
1996
memcpy (imPath , fileName , TextLength (fileName ) - TextLength (lastSlash ) + 1 );
1997
1997
memcpy (imPath + TextLength (fileName ) - TextLength (lastSlash ) + 1 , imFileName , TextLength (imFileName ));
1998
1998
}
@@ -2006,11 +2006,11 @@ static Font LoadBMFont(const char *fileName)
2006
2006
{
2007
2007
// Convert image to GRAYSCALE + ALPHA, using the mask as the alpha channel
2008
2008
Image imFontAlpha = {
2009
- .data = calloc (imFont .width * imFont .height , 2 ),
2009
+ .data = RL_CALLOC (imFont .width * imFont .height , 2 ),
2010
2010
.width = imFont .width ,
2011
2011
.height = imFont .height ,
2012
- .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA ,
2013
- .mipmaps = 1
2012
+ .mipmaps = 1 ,
2013
+ .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA
2014
2014
};
2015
2015
2016
2016
for (int p = 0 , i = 0 ; p < (imFont .width * imFont .height * 2 ); p += 2 , i ++ )
0 commit comments