3681: std::max -> maximum r=Jupeyy a=def-

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2021-03-07 14:15:45 +00:00 committed by GitHub
commit 41cb1488fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -529,7 +529,7 @@ void CDemoPlayer::ScanFile()
}
// copy all the frames to an array instead for fast access
m_pKeyFrames = (CKeyFrame *)calloc(std::max(m_Info.m_SeekablePoints, 1), sizeof(CKeyFrame));
m_pKeyFrames = (CKeyFrame *)calloc(maximum(m_Info.m_SeekablePoints, 1), sizeof(CKeyFrame));
for(pCurrentKey = pFirstKey, i = 0; pCurrentKey; pCurrentKey = pCurrentKey->m_pNext, i++)
m_pKeyFrames[i] = pCurrentKey->m_Frame;

View file

@ -270,7 +270,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
Size += str_length(m_lSettings[i].m_aCommand) + 1;
}
char *pSettings = (char *)malloc(std::max(Size, 1));
char *pSettings = (char *)malloc(maximum(Size, 1));
char *pNext = pSettings;
for(int i = 0; i < m_lSettings.size(); i++)
{
@ -536,7 +536,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
// save points
int TotalSize = sizeof(CEnvPoint) * PointCount;
CEnvPoint *pPoints = (CEnvPoint *)calloc(std::max(PointCount, 1), sizeof(*pPoints));
CEnvPoint *pPoints = (CEnvPoint *)calloc(maximum(PointCount, 1), sizeof(*pPoints));
PointCount = 0;
for(int e = 0; e < m_lEnvelopes.size(); e++)