Fix codacity warnings
This commit is contained in:
parent
4dc1f40856
commit
bf17bb4648
|
|
@ -335,9 +335,9 @@ AstVar::VlArgTypeRecursed AstVar::vlArgTypeRecurse(bool forFunc, const AstNodeDT
|
||||||
} else if (const AstBasicDType* bdtypep = dtypep->basicp()) {
|
} else if (const AstBasicDType* bdtypep = dtypep->basicp()) {
|
||||||
string otype;
|
string otype;
|
||||||
string oarray;
|
string oarray;
|
||||||
bool strtype = bdtypep && bdtypep->keyword() == AstBasicDTypeKwd::STRING;
|
bool strtype = bdtypep->keyword() == AstBasicDTypeKwd::STRING;
|
||||||
string bitvec;
|
string bitvec;
|
||||||
if (bdtypep && !bdtypep->isOpaque() && !v3Global.opt.protectIds()) {
|
if (!bdtypep->isOpaque() && !v3Global.opt.protectIds()) {
|
||||||
// We don't print msb()/lsb() as multidim packed would require recursion,
|
// We don't print msb()/lsb() as multidim packed would require recursion,
|
||||||
// and may confuse users as C++ data is stored always with bit 0 used
|
// and may confuse users as C++ data is stored always with bit 0 used
|
||||||
bitvec += "/*"+cvtToStr(dtypep->width()-1)+":0*/";
|
bitvec += "/*"+cvtToStr(dtypep->width()-1)+":0*/";
|
||||||
|
|
@ -345,13 +345,13 @@ AstVar::VlArgTypeRecursed AstVar::vlArgTypeRecurse(bool forFunc, const AstNodeDT
|
||||||
if ((forFunc && isReadOnly())
|
if ((forFunc && isReadOnly())
|
||||||
|| bdtypep->keyword() == AstBasicDTypeKwd::CHARPTR
|
|| bdtypep->keyword() == AstBasicDTypeKwd::CHARPTR
|
||||||
|| bdtypep->keyword() == AstBasicDTypeKwd::SCOPEPTR) otype += "const ";
|
|| bdtypep->keyword() == AstBasicDTypeKwd::SCOPEPTR) otype += "const ";
|
||||||
if (bdtypep && bdtypep->keyword() == AstBasicDTypeKwd::CHARPTR) {
|
if (bdtypep->keyword() == AstBasicDTypeKwd::CHARPTR) {
|
||||||
otype += "char*";
|
otype += "char*";
|
||||||
} else if (bdtypep && bdtypep->keyword() == AstBasicDTypeKwd::SCOPEPTR) {
|
} else if (bdtypep->keyword() == AstBasicDTypeKwd::SCOPEPTR) {
|
||||||
otype += "VerilatedScope*";
|
otype += "VerilatedScope*";
|
||||||
} else if (bdtypep && bdtypep->keyword() == AstBasicDTypeKwd::DOUBLE) {
|
} else if (bdtypep->keyword() == AstBasicDTypeKwd::DOUBLE) {
|
||||||
otype += "double";
|
otype += "double";
|
||||||
} else if (bdtypep && bdtypep->keyword() == AstBasicDTypeKwd::FLOAT) {
|
} else if (bdtypep->keyword() == AstBasicDTypeKwd::FLOAT) {
|
||||||
otype += "float";
|
otype += "float";
|
||||||
} else if (strtype) {
|
} else if (strtype) {
|
||||||
otype += "std::string";
|
otype += "std::string";
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,6 @@ void EmitCInlines::emitInt() {
|
||||||
// EmitC class functions
|
// EmitC class functions
|
||||||
|
|
||||||
void V3EmitC::emitcInlines() {
|
void V3EmitC::emitcInlines() {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||||
EmitCInlines syms (v3Global.rootp());
|
EmitCInlines(v3Global.rootp());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -874,6 +874,6 @@ void EmitCSyms::emitDpiImp() {
|
||||||
// EmitC class functions
|
// EmitC class functions
|
||||||
|
|
||||||
void V3EmitC::emitcSyms(bool dpiHdrOnly) {
|
void V3EmitC::emitcSyms(bool dpiHdrOnly) {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||||
EmitCSyms syms (v3Global.rootp(), dpiHdrOnly);
|
EmitCSyms(v3Global.rootp(), dpiHdrOnly);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -992,7 +992,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
||||||
UINFO(4,"DupVar: "<<nodep<<" ;; "<<foundp->nodep()<<endl);
|
UINFO(4,"DupVar: "<<nodep<<" ;; "<<foundp->nodep()<<endl);
|
||||||
UINFO(4," found cur=se"<<cvtToHex(m_curSymp)
|
UINFO(4," found cur=se"<<cvtToHex(m_curSymp)
|
||||||
<<" ;; parent=se"<<cvtToHex(foundp->parentp())<<endl);
|
<<" ;; parent=se"<<cvtToHex(foundp->parentp())<<endl);
|
||||||
if (foundp && foundp->parentp() == m_curSymp // Only when on same level
|
if (foundp->parentp() == m_curSymp // Only when on same level
|
||||||
&& !foundp->imported()) { // and not from package
|
&& !foundp->imported()) { // and not from package
|
||||||
bool nansiBad = ((findvarp->isDeclTyped() && nodep->isDeclTyped())
|
bool nansiBad = ((findvarp->isDeclTyped() && nodep->isDeclTyped())
|
||||||
|| (findvarp->isIO() && nodep->isIO())); // e.g. !(output && output)
|
|| (findvarp->isIO() && nodep->isIO())); // e.g. !(output && output)
|
||||||
|
|
|
||||||
|
|
@ -452,6 +452,6 @@ class ProtectVisitor : public AstNVisitor {
|
||||||
// ProtectLib class functions
|
// ProtectLib class functions
|
||||||
|
|
||||||
void V3ProtectLib::protect() {
|
void V3ProtectLib::protect() {
|
||||||
UINFO(2,__FUNCTION__<<": "<<endl);
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
||||||
ProtectVisitor visitor(v3Global.rootp());
|
ProtectVisitor(v3Global.rootp());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ int main(int argc, char** argv, char** env) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
ap->clk = false;
|
|
||||||
ap->clk = false;
|
ap->clk = false;
|
||||||
main_time += 10;
|
main_time += 10;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue