Avoid all MSVC compile warnings

Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
This commit is contained in:
raysan5 2020-05-06 19:12:09 +02:00
parent 9a1e934621
commit fdad1f023b
9 changed files with 140 additions and 140 deletions

View file

@ -957,7 +957,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f
bool isGlyphSelected = false;
if ((selectStart >= 0) && (k >= selectStart) && (k < (selectStart + selectLength)))
{
DrawRectangleRec((Rectangle){ rec.x + textOffsetX - 1, rec.y + textOffsetY, glyphWidth, (int)((float)font.baseSize*scaleFactor) }, selectBackTint);
DrawRectangleRec((Rectangle){ rec.x + textOffsetX - 1, rec.y + textOffsetY, (float)glyphWidth, (float)font.baseSize*scaleFactor }, selectBackTint);
isGlyphSelected = true;
}
@ -1229,7 +1229,7 @@ char *TextReplace(char *text, const char *replace, const char *by)
while (count--)
{
insertPoint = strstr(text, replace);
lastReplacePos = insertPoint - text;
lastReplacePos = (int)(insertPoint - text);
temp = strncpy(temp, text, lastReplacePos) + lastReplacePos;
temp = strcpy(temp, by) + byLen;
text += lastReplacePos + replaceLen; // Move to next "end of replace"
@ -1346,7 +1346,7 @@ int TextFindIndex(const char *text, const char *find)
char *ptr = strstr(text, find);
if (ptr != NULL) position = ptr - text;
if (ptr != NULL) position = (int)(ptr - text);
return position;
}