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

Misc clang-tidy #6104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

openroad-robot
Copy link
Contributor

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/rcx/src/dbUtil.cpp Outdated Show resolved Hide resolved
src/rcx/src/extCC.cpp Outdated Show resolved Hide resolved
src/rcx/src/extCC.cpp Outdated Show resolved Hide resolved
src/rcx/src/grids.cpp Show resolved Hide resolved
src/rcx/src/grids.cpp Outdated Show resolved Hide resolved
src/rcx/src/wire.h Outdated Show resolved Hide resolved
src/rcx/src/wire.h Outdated Show resolved Hide resolved
src/rcx/src/wire.h Outdated Show resolved Hide resolved
src/rcx/src/wire.h Outdated Show resolved Hide resolved
src/rcx/src/wire.h Outdated Show resolved Hide resolved
@openroad-robot openroad-robot force-pushed the more-tidy branch 2 times, most recently from 89de30d to 5e147b2 Compare November 6, 2024 07:40
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

#include "odb/db.h"
#include "odb/dbShape.h"
#include "odb/dbWireCodec.h"
#include "utl/Logger.h"

namespace rcx {

using odb::Ath__array1D;
using odb::dbBPin;
using odb::dbIntProperty;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: using decl 'Array1D' is unused [misc-unused-using-decls]

using odb::Array1D;
           ^
Additional context

src/rcx/src/dbUtil.cpp:42: remove the using

using odb::Array1D;
           ^

@@ -168,89 +170,88 @@ void Ath__searchBox::set(int x1, int y1, int x2, int y2, uint l, int dir)
_otherId = 0;
_type = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]

src/rcx/src/grids.cpp:171:

- {
- }
+ = default;

@@ -391,88 +388,77 @@ class Ath__grid

bool anyTrackAvailable();

uint addWireList(Ath__box* box);
uint addWireList(Box* list);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::Grid::addWireList' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  uint addWireList(Box* box);
       ^
Additional context

src/rcx/src/grids.cpp:1600: the definition seen here

uint Grid::addWireList(Box* list)
           ^

src/rcx/src/wire.h:390: differing parameters are named here: ('box'), in definition: ('list')

  uint addWireList(Box* box);
       ^

Wire* makeWire(int* ll, int* ur, uint id, uint* m1);
Wire* makeWire(uint dir, int* ll, int* ur, uint id1, uint id2, uint type = 0);

Wire* makeWire(Wire* v, uint type = 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::Grid::makeWire' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  Wire* makeWire(Wire* w, uint type = 0);
        ^
Additional context

src/rcx/src/grids.cpp:1754: the definition seen here

Wire* Grid::makeWire(Wire* v, uint type)
            ^

src/rcx/src/wire.h:426: differing parameters are named here: ('w'), in definition: ('v')

  Wire* makeWire(Wire* w, uint type = 0);
        ^

void getBoxes(Ath__array1D<uint>* table);
uint getBoxes(uint ii, Ath__array1D<uint>* table);
void getBoxes(Array1D<uint>* table);
uint getBoxes(uint trackIndex, Array1D<uint>* table);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::Grid::getBoxes' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  uint getBoxes(uint ii, Array1D<uint>* table);
       ^
Additional context

src/rcx/src/grids.cpp:1499: the definition seen here

uint Grid::getBoxes(uint trackIndex, Array1D<uint>* table)
           ^

src/rcx/src/wire.h:452: differing parameters are named here: ('ii'), in definition: ('trackIndex')

  uint getBoxes(uint ii, Array1D<uint>* table);
       ^

int xMin();
int xMax();
int yMin();
int yMax();
uint getRowNum(int x);
uint getColNum(int y);
uint getRowNum(int y);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::GridTable::getRowNum' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  uint getRowNum(int x);
       ^
Additional context

src/rcx/src/grids.cpp:2726: the definition seen here

uint GridTable::getRowNum(int y)
                ^

src/rcx/src/wire.h:609: differing parameters are named here: ('x'), in definition: ('y')

  uint getRowNum(int x);
       ^

uint getRowNum(int x);
uint getColNum(int y);
uint getRowNum(int y);
uint getColNum(int x);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::GridTable::getColNum' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  uint getColNum(int y);
       ^
Additional context

src/rcx/src/grids.cpp:2734: the definition seen here

uint GridTable::getColNum(int x)
                ^

src/rcx/src/wire.h:610: differing parameters are named here: ('y'), in definition: ('x')

  uint getColNum(int y);
       ^

@@ -685,24 +668,24 @@
uint* id1,
uint* id2,
uint* wireType);
void getCCdist(uint wid, uint* width, uint* level, uint* id1, uint* id2);
void getCCdist(uint wid, uint* width, uint* len, uint* id1, uint* id2);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'rcx::GridTable::getCCdist' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  void getCCdist(uint wid, uint* width, uint* level, uint* id1, uint* id2);
       ^
Additional context

src/rcx/src/grids.cpp:3088: the definition seen here

void GridTable::getCCdist(uint wid,
                ^

src/rcx/src/wire.h:670: differing parameters are named here: ('level'), in definition: ('len')

  void getCCdist(uint wid, uint* width, uint* level, uint* id1, uint* id2);
       ^

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -2553,7 +2549,7 @@ int diffDefReadFile(char* inFile,
return (2);
}

res = defrRead(f, inFile, userData, 1);
const int res = defrRead(f, inFile, userData, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: Value stored to 'res' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

  const int res = defrRead(f, inFile, userData, 1);
            ^
Additional context

src/odb/src/def/defdiff/diffDefRW.cpp:2551: Value stored to 'res' during its initialization is never read

  const int res = defrRead(f, inFile, userData, 1);
            ^

@@ -2553,7 +2549,7 @@
return (2);
}

res = defrRead(f, inFile, userData, 1);
const int res = defrRead(f, inFile, userData, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: unused variable 'res' [clang-diagnostic-unused-variable]

  const int res = defrRead(f, inFile, userData, 1);
            ^

Comment on lines +1081 to 1082
if (viaCuts < 2 || viaCuts > 4)
return LEFW_BAD_DATA;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [google-readability-braces-around-statements]

Suggested change
if (viaCuts < 2 || viaCuts > 4)
return LEFW_BAD_DATA;
if (viaCuts < 2 || viaCuts > 4) {
return LEFW_BAD_DATA;
}

Comment on lines +1091 to 1092
if (viaCuts < 2 || viaCuts > 4)
return LEFW_BAD_DATA;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [google-readability-braces-around-statements]

Suggested change
if (viaCuts < 2 || viaCuts > 4)
return LEFW_BAD_DATA;
if (viaCuts < 2 || viaCuts > 4) {
return LEFW_BAD_DATA;
}

@maliberty maliberty changed the title clang-tidy across many modules and remove Ath__ prefix Misc clang-tidy Dec 27, 2024
@maliberty maliberty enabled auto-merge December 27, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants