mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 02:51:27 +00:00
Replace calls to ALLOC() macro with malloc.
This commit is contained in:
@ -192,7 +192,7 @@ void CICmdParser::Error (const CmdTokState * state, ECmdError errorCode, const w
|
||||
// don't want to compose their own text. Normally, an application would
|
||||
// compose error text using its own localized strings.)
|
||||
unsigned chars = 256 + (arg ? StrLen(arg) : 0) + (value ? StrLen(value) : 0);
|
||||
wchar_t * buffer = (wchar_t *)ALLOC(chars * sizeof(wchar_t));
|
||||
wchar_t * buffer = (wchar_t *)malloc(chars * sizeof(wchar_t));
|
||||
switch (errorCode) {
|
||||
|
||||
case kCmdErrorInvalidArg:
|
||||
|
@ -166,7 +166,7 @@ template<class T, class K, unsigned keyOffset, class Cmp>
|
||||
typename TSkipList<T,K,keyOffset,Cmp>::Node* TSkipList<T,K,keyOffset,Cmp>::AllocNode (unsigned level) {
|
||||
|
||||
unsigned size = offsetof(Node, next) + (level + 1) * sizeof(Node);
|
||||
Node * node = (Node *)ALLOC(size);
|
||||
Node * node = (Node *)malloc(size);
|
||||
node->level = level;
|
||||
return node;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ static uint32_t s_hashValue[] = {
|
||||
template<class chartype>
|
||||
static chartype * IStrDup (const chartype str[]) {
|
||||
unsigned chars = IStrLen(str) + 1;
|
||||
chartype * buffer = (chartype *)ALLOC(chars * sizeof(chartype));
|
||||
chartype * buffer = (chartype *)malloc(chars * sizeof(chartype));
|
||||
IStrCopy(buffer, str, chars);
|
||||
return buffer;
|
||||
}
|
||||
@ -86,7 +86,7 @@ static chartype * IStrDupLen (const chartype str[], unsigned chars) {
|
||||
unsigned len = IStrLen(str) + 1;
|
||||
if (len > chars)
|
||||
len = chars;
|
||||
chartype * buffer = (chartype *)ALLOC(len * sizeof(chartype));
|
||||
chartype * buffer = (chartype *)malloc(len * sizeof(chartype));
|
||||
IStrCopy(buffer, str, len);
|
||||
return buffer;
|
||||
}
|
||||
@ -455,7 +455,7 @@ wchar_t * StrDupLen (const wchar_t str[], unsigned chars) {
|
||||
//============================================================================
|
||||
wchar_t * StrDupToUnicode (const char str[]) {
|
||||
unsigned bytes = StrBytes(str) * sizeof(wchar_t);
|
||||
wchar_t * dst = (wchar_t*)ALLOC(bytes);
|
||||
wchar_t * dst = (wchar_t*)malloc(bytes);
|
||||
StrToUnicode(dst, str, bytes / sizeof(wchar_t));
|
||||
return dst;
|
||||
}
|
||||
@ -463,7 +463,7 @@ wchar_t * StrDupToUnicode (const char str[]) {
|
||||
//============================================================================
|
||||
char * StrDupToAnsi (const wchar_t str[]) {
|
||||
unsigned bytes = StrBytes(str) / sizeof(wchar_t);
|
||||
char * dst = (char*)ALLOC(bytes);
|
||||
char * dst = (char*)malloc(bytes);
|
||||
StrToAnsi(dst, str, bytes);
|
||||
return dst;
|
||||
}
|
||||
|
Reference in New Issue
Block a user