Skip to content

Commit

Permalink
[all] replace legacy AXL_MEM_... macros with new/delete/allocate/deal…
Browse files Browse the repository at this point in the history
…locate
  • Loading branch information
vovkos committed Jun 29, 2023
1 parent 7241fc1 commit 7bacd37
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/CmdLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CmdLineParser::onSwitch(
break;

case CmdLineSwitchKind_Define:
Define* define = AXL_MEM_NEW(Define);
Define* define = new Define;
size_t i = value.find('=');

if (i == -1) {
Expand Down
4 changes: 2 additions & 2 deletions src/DoxyXmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DoxyXmlParser::clear() {
size_t count = m_typeStack.getCount();
for (size_t i = 0; i < count; i++) {
DoxyXmlType* type = m_typeStack[i].m_type;
AXL_MEM_DELETE(type);
delete type;
}

m_typeStack.clear();
Expand All @@ -56,7 +56,7 @@ DoxyXmlParser::popType() {

DoxyXmlType* type = m_typeStack.getBack().m_type;
type->onPopType();
AXL_MEM_DELETE(type);
delete type;

m_typeStack.pop();
}
Expand Down
4 changes: 2 additions & 2 deletions src/DoxyXmlParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class DoxyXmlParser: public xml::ExpatParser<DoxyXmlParser> {
const char* name,
const char** attributes
) {
T* type = AXL_MEM_NEW(T);
T* type = new T;
TypeStackEntry entry = { type, 0 };
m_typeStack.append(entry);
return type->create(this, name, attributes);
Expand All @@ -126,7 +126,7 @@ class DoxyXmlParser: public xml::ExpatParser<DoxyXmlParser> {
const char* name,
const char** attributes
) {
T* type = AXL_MEM_NEW(T);
T* type = new T;
TypeStackEntry entry = { type, 0 };
m_typeStack.append(entry);
return type->create(this, context, name, attributes);
Expand Down
36 changes: 18 additions & 18 deletions src/DoxyXmlType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CompoundDefType::create(
Module* module = parser->getModule();

m_parser = parser;
m_compound = AXL_MEM_NEW(Compound);
m_compound = new Compound;
module->m_compoundList.insertTail(m_compound);
parser->pushCompound(m_compound);

Expand Down Expand Up @@ -336,7 +336,7 @@ RefType::create(
const char** attributes
) {
m_parser = parser;
m_ref = AXL_MEM_NEW(Ref);
m_ref = new Ref;
list->insertTail(m_ref);

while (*attributes) {
Expand Down Expand Up @@ -426,7 +426,7 @@ MemberDefType::create(
Module* module = parser->getModule();

m_parser = parser;
m_member = AXL_MEM_NEW(Member);
m_member = new Member;
m_member->m_parentCompound = parent;
parent->m_memberList.insertTail(m_member);

Expand Down Expand Up @@ -810,7 +810,7 @@ DocSectionBlockType::create(
const char** attributes
) {
m_parser = parser;
m_sectionBlock = AXL_MEM_NEW(DocSectionBlock);
m_sectionBlock = new DocSectionBlock;
m_sectionBlock->m_blockKind = name;
list->insertTail(m_sectionBlock);

Expand Down Expand Up @@ -867,7 +867,7 @@ EnumValueType::create(
Module* module = parser->getModule();

m_parser = parser;
m_enumValue = AXL_MEM_NEW(EnumValue);
m_enumValue = new EnumValue;
m_enumValue->m_parentEnum = member;
member->m_enumValueList.insertTail(m_enumValue);

Expand Down Expand Up @@ -982,7 +982,7 @@ ParamType::create(
const char** attributes
) {
m_parser = parser;
m_param = AXL_MEM_NEW(Param);
m_param = new Param;
list->insertTail(m_param);

return true;
Expand Down Expand Up @@ -1038,7 +1038,7 @@ LinkedTextType::create(
) {
m_parser = parser;
m_linkedText = linkedText;
m_refText = AXL_MEM_NEW(RefText);
m_refText = new RefText;
m_linkedText->m_refTextList.insertTail(m_refText);

return true;
Expand All @@ -1056,7 +1056,7 @@ LinkedTextType::onStartElement(
break;
}

m_refText = AXL_MEM_NEW(RefText);
m_refText = new RefText;
m_linkedText->m_refTextList.insertTail(m_refText);
return true;
}
Expand All @@ -1071,7 +1071,7 @@ RefTextType::create(
const char** attributes
) {
m_parser = parser;
m_refText = AXL_MEM_NEW(RefText);
m_refText = new RefText;
linkedText->m_refTextList.insertTail(m_refText);

while (*attributes) {
Expand Down Expand Up @@ -1110,11 +1110,11 @@ DocParaType::create(
const char** attributes
) {
m_parser = parser;
m_paragraphBlock = AXL_MEM_NEW(DocBlock);
m_paragraphBlock = new DocBlock;
m_paragraphBlock->m_blockKind = name;
blockList->insertTail(m_paragraphBlock);

m_textBlock = AXL_MEM_NEW(DocBlock);
m_textBlock = new DocBlock;
m_paragraphBlock->m_childBlockList.insertTail(m_textBlock);

return true;
Expand Down Expand Up @@ -1155,7 +1155,7 @@ DocParaType::onStartElement(
m_parser->pushType<DocParaType>(&m_paragraphBlock->m_childBlockList, name, attributes);
}

m_textBlock = AXL_MEM_NEW(DocBlock);
m_textBlock = new DocBlock;
m_paragraphBlock->m_childBlockList.insertTail(m_textBlock);
return true;
}
Expand All @@ -1170,7 +1170,7 @@ DocRefTextType::create(
const char** attributes
) {
m_parser = parser;
m_refBlock = AXL_MEM_NEW(DocRefBlock);
m_refBlock = new DocRefBlock;
m_refBlock->m_module = m_parser->getModule();
m_refBlock->m_blockKind = name;
list->insertTail(m_refBlock);
Expand Down Expand Up @@ -1207,7 +1207,7 @@ DocAnchorType::create(
const char** attributes
) {
m_parser = parser;
m_anchorBlock = AXL_MEM_NEW(DocAnchorBlock);
m_anchorBlock = new DocAnchorBlock;
m_anchorBlock->m_blockKind = name;
list->insertTail(m_anchorBlock);

Expand Down Expand Up @@ -1240,7 +1240,7 @@ DocImageType::create(
const char** attributes
) {
m_parser = parser;
m_imageBlock = AXL_MEM_NEW(DocImageBlock);
m_imageBlock = new DocImageBlock;
m_imageBlock->m_blockKind = name;
list->insertTail(m_imageBlock);

Expand Down Expand Up @@ -1280,7 +1280,7 @@ DocUlinkType::create(
const char** attributes
) {
m_parser = parser;
m_ulinkBlock = AXL_MEM_NEW(DocUlinkBlock);
m_ulinkBlock = new DocUlinkBlock;
m_ulinkBlock->m_blockKind = name;
list->insertTail(m_ulinkBlock);

Expand Down Expand Up @@ -1310,7 +1310,7 @@ DocHeadingType::create(
const char** attributes
) {
m_parser = parser;
m_headingBlock = AXL_MEM_NEW(DocHeadingBlock);
m_headingBlock = new DocHeadingBlock;
m_headingBlock->m_blockKind = name;
list->insertTail(m_headingBlock);

Expand Down Expand Up @@ -1339,7 +1339,7 @@ DocSimpleSectionType::create(
const char** attributes
) {
m_parser = parser;
m_sectionBlock = AXL_MEM_NEW(DocSimpleSectionBlock);
m_sectionBlock = new DocSimpleSectionBlock;
m_sectionBlock->m_blockKind = name;
list->insertTail(m_sectionBlock);

Expand Down
12 changes: 6 additions & 6 deletions src/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ Compound::unspecializeName() {

Param*
Compound::createTemplateSpecParam(const sl::StringRef& name) {
Param* param = AXL_MEM_NEW(Param);
Param* param = new Param;
param->m_declarationName = name;
param->m_declarationName.trim();

Expand Down Expand Up @@ -1088,7 +1088,7 @@ GlobalNamespace::build(
for (size_t i = 0; i < count; i++) {
Compound* compound = module->m_namespaceArray[i];

Namespace* nspace = AXL_MEM_NEW(Namespace);
Namespace* nspace = new Namespace;
m_namespaceList.insertTail(nspace);
nspace->m_compound = compound;
compound->m_selfNamespace = nspace;
Expand Down Expand Up @@ -1165,7 +1165,7 @@ GlobalNamespace::build(
Compound* baseCompound;

if (refIt->m_id.isEmpty() || !refIt->m_importId.isEmpty()) { // template or imported base
baseCompound = AXL_MEM_NEW(Compound);
baseCompound = new Compound;
baseCompound->m_id = refIt->m_id;
baseCompound->m_importId = refIt->m_importId;
baseCompound->m_name = refIt->m_text;
Expand Down Expand Up @@ -1325,7 +1325,7 @@ GlobalNamespace::getGroupNamespace(
if (groupCompound->m_selfNamespace)
return groupCompound->m_selfNamespace;

Namespace* nspace = AXL_MEM_NEW(Namespace);
Namespace* nspace = new Namespace;
m_namespaceList.insertTail(nspace);
nspace->m_compound = groupCompound;
nspace->m_footnoteArray = groupCompound->m_groupFootnoteArray;
Expand All @@ -1347,14 +1347,14 @@ GlobalNamespace::createMemberCompound(
Module* module,
Member* member
) {
Compound* compound = AXL_MEM_NEW(Compound);
Compound* compound = new Compound;
compound->m_compoundKind = member->m_memberKind == MemberKind_Service ? CompoundKind_Service : CompoundKind_Interface;
compound->m_name = member->m_name;
compound->m_id = member->m_id;
compound->m_groupCompound = member->m_groupCompound;
sl::takeOver(&compound->m_briefDescription, &member->m_briefDescription);
sl::takeOver(&compound->m_detailedDescription, &member->m_detailedDescription);
compound->m_selfNamespace = AXL_MEM_NEW(Namespace);
compound->m_selfNamespace = new Namespace;
compound->m_selfNamespace->m_compound = compound;
m_namespaceList.insertTail(compound->m_selfNamespace);
module->m_compoundList.insertTail(compound);
Expand Down

0 comments on commit 7bacd37

Please sign in to comment.