From 89c3c5f952739b11aeb455f767696daf75a7b6bc Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 18 Oct 2019 20:28:59 -0400 Subject: [PATCH] Internals: Style cleanup. No functional change. --- include/verilated.h | 4 ++-- src/V3Ast.cpp | 2 +- src/V3Clock.cpp | 2 +- src/V3File.cpp | 10 +++++----- src/V3PreProc.cpp | 12 ++++++------ test_regress/t/t_func_wide_out_bad.v | 2 +- test_regress/t/t_struct_param.v | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/verilated.h b/include/verilated.h index b638f0b2a..d2c6bbb30 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -1658,7 +1658,7 @@ static inline IData VL_REPLICATE_III(int, int lbits, int, IData ld, IData rep) V returndata = returndata << lbits; returndata |= ld; } - return (returndata); + return returndata; } static inline QData VL_REPLICATE_QII(int, int lbits, int, IData ld, IData rep) VL_PURE { QData returndata = ld; @@ -1666,7 +1666,7 @@ static inline QData VL_REPLICATE_QII(int, int lbits, int, IData ld, IData rep) V returndata = returndata << lbits; returndata |= static_cast(ld); } - return (returndata); + return returndata; } static inline WDataOutP VL_REPLICATE_WII(int obits, int lbits, int, WDataOutP owp, IData ld, IData rep) VL_MT_SAFE { diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 5b1ea5ddc..c925020df 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -258,7 +258,7 @@ AstNode* AstNode::addNext(AstNode* nodep, AstNode* newp) { nodep->debugTreeChange("-addNextThs: ", __LINE__, false); newp->debugTreeChange("-addNextNew: ", __LINE__, true); if (!nodep) { // verilog.y and lots of other places assume this - return (newp); + return newp; } else { // Find end of old list AstNode* oldtailp = nodep; diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index 66594fbc3..8cd3192fa 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -181,7 +181,7 @@ private: AstNode* senEqnp = createSenseEquation(sensesp->sensesp()); UASSERT_OBJ(senEqnp, sensesp, "No sense equation, shouldn't be in sequent activation."); AstIf* newifp = new AstIf(sensesp->fileline(), senEqnp, NULL, NULL); - return (newifp); + return newifp; } void clearLastSen() { m_lastSenp = NULL; diff --git a/src/V3File.cpp b/src/V3File.cpp index 65c2f617e..36584052b 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -616,7 +616,7 @@ const string V3OutFormatter::indentSpaces(int num) { } *cp++ = '\0'; string st (str); - return (st); + return st; } bool V3OutFormatter::tokenStart(const char* cp, const char* cmp) { @@ -639,9 +639,9 @@ int V3OutFormatter::endLevels(const char *strg) { while (isspace(*cp)) cp++; switch (*cp) { case '\n': // Newlines.. No need for whitespace before it - return (0); + return 0; case '#': // Preproc directive - return (0); + return 0; } { // label/public/private: Deindent by 2 spaces @@ -671,10 +671,10 @@ int V3OutFormatter::endLevels(const char *strg) { case ' ': break; // Continue default: - return (levels); // Letter + return levels; // Letter } } - return (levels); + return levels; } void V3OutFormatter::puts(const char *strg) { diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 51e490286..68ba04253 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -859,7 +859,7 @@ int V3PreProcImp::getRawToken() { m_rawAtBol = true; yyourtext("\n", 1); if (debug()>=5) debugToken(VP_WHITE, "LNA"); - return (VP_WHITE); + return VP_WHITE; } if (m_lineCmt!="") { // We have some `line directive or other processed data to return to the user. @@ -877,10 +877,10 @@ int V3PreProcImp::getRawToken() { goto next_tok; } else { if (debug()>=5) debugToken(VP_TEXT, "LCM"); - return (VP_TEXT); + return VP_TEXT; } } - if (isEof()) return (VP_EOF); + if (isEof()) return VP_EOF; // Snarf next token from the file m_lexp->curFilelinep()->startToken(); @@ -929,7 +929,7 @@ int V3PreProcImp::getStateToken() { int tok = getRawToken(); // Most states emit white space and comments between tokens. (Unless collecting a string) - if (tok==VP_WHITE && state() !=ps_STRIFY) return (tok); + if (tok==VP_WHITE && state() !=ps_STRIFY) return tok; if (tok==VP_BACKQUOTE && state() !=ps_STRIFY) { tok = VP_TEXT; } if (tok==VP_COMMENT) { if (!m_off) { @@ -939,7 +939,7 @@ int V3PreProcImp::getStateToken() { // Need to ensure "foo/**/bar" becomes two tokens insertUnreadback(" "); } else if (m_lexp->m_keepComments) { - return (tok); + return tok; } else { // Need to ensure "foo/**/bar" becomes two tokens insertUnreadback(" "); @@ -1369,7 +1369,7 @@ int V3PreProcImp::getStateToken() { if (m_off) { goto next_tok; } else { - return (VP_TEXT); + return VP_TEXT; } } else { diff --git a/test_regress/t/t_func_wide_out_bad.v b/test_regress/t/t_func_wide_out_bad.v index 6bf3a7e80..f63f21676 100644 --- a/test_regress/t/t_func_wide_out_bad.v +++ b/test_regress/t/t_func_wide_out_bad.v @@ -23,7 +23,7 @@ module t (); function integer func (output bit [PAYLOAD_MAX_BITS-1:0] data); /*verilator no_inline_task*/ data = {PAYLOAD_MAX_BITS{1'b1}}; - return (1); + return 1; endfunction endmodule diff --git a/test_regress/t/t_struct_param.v b/test_regress/t/t_struct_param.v index 604b2ee4f..a4cedb878 100644 --- a/test_regress/t/t_struct_param.v +++ b/test_regress/t/t_struct_param.v @@ -26,7 +26,7 @@ package config_pkg; case (selector) 1: return_config.mac.USE_QUAD1 = 5; endcase - return (return_config); + return return_config; endfunction endpackage : config_pkg