Skip to content

Commit

Permalink
Merge pull request #3636 from rettinghaus/update-clang-action
Browse files Browse the repository at this point in the history
Update clang-format-action
  • Loading branch information
lpugin authored Mar 23, 2024
2 parents 24c3b85 + b541da8 commit fa32d17
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.9.0
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: "15"
clang-format-version: "18"
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
6 changes: 3 additions & 3 deletions include/vrv/bboxdevicecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BBoxDeviceContext : public DeviceContext {
*/
///@{
void SetBackground(int color, int style = AxSOLID) override;
void SetBackgroundImage(void *image, double opacity = 1.0) override{};
void SetBackgroundImage(void *image, double opacity = 1.0) override {};
void SetBackgroundMode(int mode) override;
void SetTextForeground(int color) override;
void SetTextBackground(int color) override;
Expand Down Expand Up @@ -87,7 +87,7 @@ class BBoxDeviceContext : public DeviceContext {
void DrawSpline(int n, Point points[]) override;
void DrawGraphicUri(int x, int y, int width, int height, const std::string &uri) override;
void DrawSvgShape(int x, int y, int width, int height, double scale, pugi::xml_node svg) override;
void DrawBackgroundImage(int x = 0, int y = 0) override{};
void DrawBackgroundImage(int x = 0, int y = 0) override {};
///@}

/**
Expand Down Expand Up @@ -150,7 +150,7 @@ class BBoxDeviceContext : public DeviceContext {
* @name Method for adding description element
*/
///@{
void AddDescription(const std::string &text) override{};
void AddDescription(const std::string &text) override {};
///@}

private:
Expand Down
10 changes: 5 additions & 5 deletions include/vrv/devicecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class DeviceContext {
* Special method for forcing bounding boxes to be updated
* Used for invisible elements (e.g., <space>) that needs to be take into account in spacing
*/
virtual void DrawPlaceholder(int x, int y){};
virtual void DrawPlaceholder(int x, int y) {};

/**
* @name Method for starting and ending a text
Expand Down Expand Up @@ -258,14 +258,14 @@ class DeviceContext {
* For example, the method can be used for grouping shapes in <g></g> in SVG
*/
///@{
virtual void StartCustomGraphic(const std::string &name, std::string gClass = "", std::string gId = ""){};
virtual void EndCustomGraphic(){};
virtual void StartCustomGraphic(const std::string &name, std::string gClass = "", std::string gId = "") {};
virtual void EndCustomGraphic() {};
///@}

/**
* Method for changing the color of a custom graphic
*/
virtual void SetCustomGraphicColor(const std::string &color){};
virtual void SetCustomGraphicColor(const std::string &color) {};

/**
* @name Methods for re-starting and ending a graphic for objects drawn in separate steps
Expand Down Expand Up @@ -308,7 +308,7 @@ class DeviceContext {
* @name Method for adding description element
*/
///@{
virtual void AddDescription(const std::string &text){};
virtual void AddDescription(const std::string &text) {};
///@}

/**
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/layerelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class LayerElement : public Object,
/**
* Helper function to set shortening for elements with beam interface
*/
virtual void SetElementShortening(int shortening){};
virtual void SetElementShortening(int shortening) {};

/**
* Get the stem mod for the element (if any)
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/lb.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Lb : public TextElement {
/**
* Lb is an empty element
*/
void AddChild(Object *object) override{};
void AddChild(Object *object) override {};

/**
* Interface for class functor visitation
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class View {
virtual void DoRefresh() {}
virtual void DoResize() {}
virtual void DoReset() {}
virtual void OnPageChange(){};
virtual void OnPageChange() {};
///@}

/**
Expand Down
10 changes: 4 additions & 6 deletions src/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ std::pair<int, int> BeamSegment::GetMinimalStemLength(const BeamDrawingInterface
const auto [topOffset, bottomOffset] = this->GetVerticalOffset(beamInterface);

// lambda check whether coord has element set and whether that element is CHORD or NOTE
const auto isNoteOrChord = [](BeamElementCoord *coord) {
return (coord->m_element && coord->m_element->Is({ CHORD, NOTE }));
};
const auto isNoteOrChord
= [](BeamElementCoord *coord) { return (coord->m_element && coord->m_element->Is({ CHORD, NOTE })); };

using CoordIt = ArrayOfBeamElementCoords::const_iterator;
for (CoordIt it = m_beamElementCoordRefs.begin(); it != m_beamElementCoordRefs.end(); ++it) {
Expand Down Expand Up @@ -460,9 +459,8 @@ void BeamSegment::AdjustBeamToFrenchStyle(const BeamDrawingInterface *beamInterf
// set to store durations of relevant notes (it's ordered, so min duration is going to be first)
std::set<int> noteDurations;
// lambda check whether coord has element set and whether that element is CHORD or NOTE
const auto isNoteOrChord = [](BeamElementCoord *coord) {
return (coord->m_element && coord->m_element->Is({ CHORD, NOTE }));
};
const auto isNoteOrChord
= [](BeamElementCoord *coord) { return (coord->m_element && coord->m_element->Is({ CHORD, NOTE })); };
// iterators
using CoordIt = ArrayOfBeamElementCoords::iterator;
using CoordReverseIt = ArrayOfBeamElementCoords::reverse_iterator;
Expand Down
18 changes: 6 additions & 12 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,11 @@ jsonxx::Object Option::ToJson() const
const OptionBool *optBool = dynamic_cast<const OptionBool *>(this);

if (optBool) {
opt << "type"
<< "bool";
opt << "type" << "bool";
opt << "default" << optBool->GetDefault();
}
else if (optDbl) {
opt << "type"
<< "double";
opt << "type" << "double";
jsonxx::Value value(optDbl->GetDefault());
value.precision_ = 2;
opt << "default" << value;
Expand All @@ -129,20 +127,17 @@ jsonxx::Object Option::ToJson() const
opt << "max" << value;
}
else if (optInt) {
opt << "type"
<< "int";
opt << "type" << "int";
opt << "default" << optInt->GetDefault();
opt << "min" << optInt->GetMin();
opt << "max" << optInt->GetMax();
}
else if (optString) {
opt << "type"
<< "std::string";
opt << "type" << "std::string";
opt << "default" << optString->GetDefault();
}
else if (optArray) {
opt << "type"
<< "array";
opt << "type" << "array";
std::vector<std::string> strValues = optArray->GetDefault();
std::vector<std::string>::iterator strIter;
jsonxx::Array values;
Expand All @@ -152,8 +147,7 @@ jsonxx::Object Option::ToJson() const
opt << "default" << values;
}
else if (optIntMap) {
opt << "type"
<< "std::string-list";
opt << "type" << "std::string-list";
opt << "default" << optIntMap->GetDefaultStrValue();
std::vector<std::string> strValues = optIntMap->GetStrValues(false);
std::vector<std::string>::iterator strIter;
Expand Down

0 comments on commit fa32d17

Please sign in to comment.