Commit 87ad2693 authored by hrchilds's avatar hrchilds
Browse files

Issue a warning when a function is marked as replacing a builtin, but not

builting function can be found to replace it with.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@1919 18c085ea-50e0-402c-830e-de6fd14e8384
parent f0a7abb8
......@@ -55,6 +55,9 @@
// Jeremy Meredith, Fri Apr 19 15:32:51 PDT 2002
// Renamed some stuff. Pulled most of the code into CodeFile.h.
//
// Hank Childs, Tue Aug 28 14:36:10 PDT 2007
// Add a Boolean to indicate whether the function was used.
//
// ****************************************************************************
class Function
{
......@@ -64,10 +67,12 @@ class Function
QString def;
bool user;
bool member;
bool usedThisFunction;
public:
Function(const QString &n, const QString &dc, const QString &df, bool u, bool m)
: name(n), decl(dc), def(df), user(u), member(m)
{
usedThisFunction = false;
}
void Print(ostream &out)
{
......
......@@ -173,6 +173,10 @@ using std::vector;
// Added support for some AVT enums and for public/protected/private members.
// I also changed the names of the generated access methods for attVectors.
//
// Hank Childs, Tue Aug 28 14:46:34 PDT 2007
// Print out a warning if someone declares a builtin function that is
// being ignored.
//
// ****************************************************************************
// ----------------------------------------------------------------------------
......@@ -1635,7 +1639,10 @@ class AttsGeneratorAttribute
{
for (int i=0; i<functions.size(); i++)
if (functions[i]->name == f && functions[i]->user == false)
{
out << functions[i]->def;
functions[i]->usedThisFunction = true;
}
}
void DeleteFunction(ostream &out, const QString &f)
{
......@@ -2863,6 +2870,23 @@ class AttsGeneratorAttribute
c << endl;
}
}
for (i=0; i<functions.size(); i++)
{
if (!functions[i]->user)
{
if (!functions[i]->usedThisFunction)
{
cerr << "\n\n!!! WARNING !!!\n\n";
cerr << "You declared the function \"" << functions[i]->name
<< "\" as replacing a builtin. But the xml2atts\n"
<< "program could not find a builtin to replace it "
<< "with. It is being ignored.\n\n"
<< "You might want to declare it as a \"New Function"
<< "\" instead.\n\n" << endl;
}
}
}
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment