mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-06 18:06:28 +00:00
Fix lgtm warnings (#2477)
* Comparison is always true because finalSample >= 1 * Comparison is always false because keyCount >= 0
This commit is contained in:
@@ -1999,7 +1999,6 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode)
|
|||||||
{
|
{
|
||||||
keyCount--;
|
keyCount--;
|
||||||
text[keyCount] = '\0';
|
text[keyCount] = '\0';
|
||||||
if (keyCount < 0) keyCount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2177,7 +2176,6 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i
|
|||||||
{
|
{
|
||||||
keyCount--;
|
keyCount--;
|
||||||
textValue[keyCount] = '\0';
|
textValue[keyCount] = '\0';
|
||||||
if (keyCount < 0) keyCount = 0;
|
|
||||||
valueHasChanged = true;
|
valueHasChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1206,8 +1206,7 @@ Wave WaveCopy(Wave wave)
|
|||||||
// NOTE: Security check in case of out-of-range
|
// NOTE: Security check in case of out-of-range
|
||||||
void WaveCrop(Wave *wave, int initSample, int finalSample)
|
void WaveCrop(Wave *wave, int initSample, int finalSample)
|
||||||
{
|
{
|
||||||
if ((initSample >= 0) && (initSample < finalSample) &&
|
if ((initSample >= 0) && (initSample < finalSample) && ((unsigned int)finalSample < (wave->frameCount*wave->channels)))
|
||||||
(finalSample > 0) && ((unsigned int)finalSample < (wave->frameCount*wave->channels)))
|
|
||||||
{
|
{
|
||||||
int sampleCount = finalSample - initSample;
|
int sampleCount = finalSample - initSample;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user