Library: move Library::alloc and Library::dealloc from header to cpp file and use the functionName utility function
This commit is contained in:
parent
30c7b58e4c
commit
a70c57daa2
|
@ -679,6 +679,21 @@ static std::string functionName(const Token *ftok)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/** get allocation id for function */
|
||||
int Library::alloc(const Token *tok) const
|
||||
{
|
||||
const std::string funcname = functionName(tok);
|
||||
return isNotLibraryFunction(tok) && argumentChecks.find(funcname) != argumentChecks.end() ? 0 : getid(_alloc, funcname);
|
||||
}
|
||||
|
||||
/** get deallocation id for function */
|
||||
int Library::dealloc(const Token *tok) const
|
||||
{
|
||||
const std::string funcname = functionName(tok);
|
||||
return isNotLibraryFunction(tok) && argumentChecks.find(funcname) != argumentChecks.end() ? 0 : getid(_dealloc, funcname);
|
||||
}
|
||||
|
||||
|
||||
const Library::ArgumentChecks * Library::getarg(const Token *ftok, int argnr) const
|
||||
{
|
||||
if (isNotLibraryFunction(ftok))
|
||||
|
|
|
@ -63,22 +63,18 @@ public:
|
|||
/** this is primarily meant for unit tests. it only returns true/false */
|
||||
bool loadxmldata(const char xmldata[], std::size_t len);
|
||||
|
||||
/** get allocation id for function by name */
|
||||
/** get allocation id for function by name (deprecated, use other alloc) */
|
||||
int alloc(const char name[]) const {
|
||||
return getid(_alloc, name);
|
||||
}
|
||||
|
||||
/** get allocation id for function */
|
||||
int alloc(const Token *tok) const {
|
||||
return isNotLibraryFunction(tok) && argumentChecks.find(tok->str()) != argumentChecks.end() ? 0 : getid(_alloc, tok->str());
|
||||
}
|
||||
int alloc(const Token *tok) const;
|
||||
|
||||
/** get deallocation id for function */
|
||||
int dealloc(const Token *tok) const {
|
||||
return isNotLibraryFunction(tok) && argumentChecks.find(tok->str()) != argumentChecks.end() ? 0 : getid(_dealloc, tok->str());
|
||||
}
|
||||
int dealloc(const Token *tok) const;
|
||||
|
||||
/** get deallocation id for function by name */
|
||||
/** get deallocation id for function by name (deprecated, use other alloc) */
|
||||
int dealloc(const char name[]) const {
|
||||
return getid(_dealloc, name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue