BAGEL: rename bofCAlloc to bofCleanAlloc, remove second useless parameter (always 1 element)

This commit is contained in:
Strangerke 2024-05-24 08:19:16 +01:00
parent a913965e8b
commit 23ef244d3d
4 changed files with 4 additions and 4 deletions

View File

@ -121,7 +121,7 @@ ErrorCode CBagHelp::attach() {
CBofFile file(_textFile, CBF_BINARY | CBF_READONLY);
uint32 size = file.getLength();
char *buffer = (char *)bofCAlloc(size + 1, 1);
char *buffer = (char *)bofCleanAlloc(size + 1);
file.read(buffer, size);

View File

@ -141,7 +141,7 @@ ErrorCode CBagTextObject::attach() {
if (!fpTextFile.errorOccurred()) {
// Allocate the buffers
uint32 nFileLen = fpTextFile.getLength();
char *pTextBuff = (char *)bofCAlloc(nFileLen + 1, 1);
char *pTextBuff = (char *)bofCleanAlloc(nFileLen + 1);
// Read the text file into buffers
fpTextFile.read(pTextBuff, nFileLen);

View File

@ -81,7 +81,7 @@ extern void *bofMemAlloc(uint32 nSize, const char *pFile, int nLine, bool bClear
extern void bofMemFree(void *pBuf);
#define bofAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, false)
#define bofCAlloc(n, m) bofMemAlloc((uint32)(n) * (m), __FILE__, __LINE__, true)
#define bofCleanAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, true)
#define bofFree(p) bofMemFree((p))
inline uint32 getFreePhysMem() {

View File

@ -141,7 +141,7 @@ ErrorCode CBagCreditsDialog::loadNextTextFile() {
if (!cFile.errorOccurred()) {
// Read in text file
uint32 lSize = cFile.getLength();
_pszText = (char *)bofCAlloc(lSize + 1, 1);
_pszText = (char *)bofCleanAlloc(lSize + 1);
cFile.read(_pszText, lSize);