mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #3681
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:
commit
41cb1488fc
|
@ -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;
|
||||
|
||||
|
|
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue