Skip to content

Commit

Permalink
clang
Browse files Browse the repository at this point in the history
  • Loading branch information
kaihsin committed Dec 3, 2024
1 parent a58d828 commit c030ccb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
with:
clang-format-version: '19'
check-path: 'src'
fallback-style: 'Google' # optional
16 changes: 8 additions & 8 deletions src/cpp/include/cytnx_core/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace cytnx_core {

class MyClass {
public:
int num;
MyClass(int num);
int get_num();
};
class MyClass {
public:
int num;
MyClass(int num);
int get_num();
};

std::string test();
std::string test();

} // namespace cytnx_core
} // namespace cytnx_core
6 changes: 3 additions & 3 deletions src/cpp/pybind/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PYBIND11_MODULE(_core, m) {
)pbdoc");

py::class_<cytnx_core::MyClass>(m, "MyClass")
// construction
.def(py::init<int>(), py::arg("num"))
.def("get_num", &cytnx_core::MyClass::get_num);
// construction
.def(py::init<int>(), py::arg("num"))
.def("get_num", &cytnx_core::MyClass::get_num);
}
8 changes: 4 additions & 4 deletions src/cpp/src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <string>

namespace cytnx_core {
std::string test() { return "Hello from test"; }
std::string test() { return "Hello from test"; }

MyClass::MyClass(int num) : num(num) {}
int MyClass::get_num() { return this->num; }
MyClass::MyClass(int num) : num(num) {}
int MyClass::get_num() { return this->num; }

} // namespace cytnx_core
} // namespace cytnx_core

0 comments on commit c030ccb

Please sign in to comment.