Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseTools: Blackbox header cleanup #10601

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions BaseTools/Source/C/VfrCompile/Pccts/h/PBlackBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DllExportPCCTS ParserBlackBox {

// no copy assignment allowed
ParserBlackBox & operator=(ParserBlackBox const &);

protected:
DLGFileInput *in;
Lexer *scan;
Expand All @@ -65,7 +65,7 @@ class DllExportPCCTS ParserBlackBox {
FILE *file;
int openByBlackBox; /* MR21 Don't close what we haven't opened */
public:

ParserBlackBox(FILE *f)
: in(0)
, scan(0)
Expand All @@ -77,7 +77,7 @@ class DllExportPCCTS ParserBlackBox {
{
if (f == NULL)
{
cerr << "invalid file pointer\n";
std::cerr << "invalid file pointer\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the PCCTS_NAMESPACE_STD on line 38 be dropped as well then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pccts is from third party project. The general rule is to only do the necessary changes for it. Seemly, these changes are for code clean up, not for functionality. So, I don't suggest to merge them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pccts is a code graveyard that I would recommend replacing with a first party implementation that uses modern language tools if you're not willing to take clean-up changes.
Trying to integrate software analysis with the codebase leads to alarms on code like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deeglaze Since the project to migrate all BaseTools C tools to Python has been abandoned, I want to take a look at modernizing all the code including replacing pccts.

}
else
{
Expand All @@ -104,7 +104,7 @@ class DllExportPCCTS ParserBlackBox {
FILE *f = fopen(fname, "r");
if ( f==NULL ) {
openByBlackBox = 0;
cerr << "cannot open " << fname << "\n"; return;
std::cerr << "cannot open " << fname << "\n"; return;
}
else {
openByBlackBox = 1;
Expand All @@ -118,7 +118,7 @@ class DllExportPCCTS ParserBlackBox {
_parser->init();
}
}

~ParserBlackBox()
{
delete in; delete scan; delete pipe; delete _parser; delete tok;
Expand Down
Loading