Skip to content

Commit 9f58e93

Browse files
committed
add stuff
1 parent a43aca3 commit 9f58e93

File tree

15 files changed

+36
-88
lines changed

15 files changed

+36
-88
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ modernize-use-bool-literals,
9797
modernize-use-emplace,
9898
modernize-use-equals-default,
9999
modernize-use-equals-delete,
100-
# modernize-use-nodiscard,
100+
modernize-use-nodiscard,
101101
modernize-use-noexcept,
102102
modernize-use-nullptr,
103103
modernize-use-override,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ _deps
1313

1414
cmake-build-*/
1515
build-*/
16+
builds/
1617
*_include.cmake
1718
bin/
1819

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
1919
endif()
2020

2121
# Enable ASAN and UBSAN
22+
# TODO: Fix sanitizers for Windows and Linux
2223
if (MSVC)
2324
add_compile_options(/fsanitize=address,undefined)
2425
add_link_options(/fsanitize=address,undefined)

build.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ IF "%#%" "-eq" "0" (
1717
)
1818

1919
IF "%build_debug%" "-eq" "1" (
20-
cmake "-DCMAKE_BUILD_TYPE=Debug" "-S" "." "-B" "build-debug"
21-
cmake "--build" "build-debug"
20+
cmake "-DCMAKE_BUILD_TYPE=Debug" "-S" "." "-B" "builds/debug"
21+
cmake "--build" "builds/debug"
2222
)
2323
IF "%build_release%" "-eq" "1" (
24-
cmake "-DCMAKE_BUILD_TYPE=Release" "-S" "." "-B" "build-release"
25-
cmake "--build" "build-release"
24+
cmake "-DCMAKE_BUILD_TYPE=Release" "-S" "." "-B" "builds/release"
25+
cmake "--build" "builds/release"
2626
)

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ fi
2828

2929
# Build the debug version if specified
3030
if [ $build_debug -eq 1 ]; then
31-
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build-debug
32-
cmake --build build-debug
31+
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B builds/debug
32+
cmake --build builds/debug
3333
fi
3434

3535
# Build the release version if specified
3636
if [ $build_release -eq 1 ]; then
37-
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build-release
38-
cmake --build build-release
37+
cmake -DCMAKE_BUILD_TYPE=Release -S . -B builds/release
38+
cmake --build builds/release
3939
fi

cas/include/cas/data/ExpressionProperties.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

cas/include/cas/latex/LatexRenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class LatexRenderer {
2626

2727
private:
2828
const std::string prefix = "lr_";
29-
const std::string resFolder = "../res/latex";
29+
const std::string resFolder = "../../res/latex";
3030
};
3131

3232
CAS_NAMESPACE_END

cas/include/cas/node/Expression.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,27 @@
77

88
#include "IMath.h"
99
#include "IRepresentableMath.h"
10-
#include "cas/data/ExpressionProperties.h"
1110
#include "cas/data/ExpressionType.h"
1211
#include <memory>
1312

1413
CAS_NAMESPACE
1514

15+
struct ExpressionProperties {
16+
public:
17+
ExpressionProperties(ExpressionType type, std::string name, std::string shortName)
18+
: order(static_cast<uint8_t>(type)), type(type), name(std::move(name)), shortName(std::move(shortName)) {}
19+
20+
uint16_t order;
21+
ExpressionType type;
22+
std::string name;
23+
std::string shortName;
24+
25+
uint16_t getOrder() const { return order; }
26+
ExpressionType getType() const { return type; }
27+
std::string getName() const { return name; }
28+
std::string getShortName() const { return shortName; }
29+
};
30+
1631
class Const;
1732
class Var;
1833

cas/include/cas/plot/Function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CAS_NAMESPACE
1212
class Function : public IMath<Function*>, public IRepresentableMath {
1313
public:
1414
explicit Function(std::string strFunction, const std::string& name = "z", bool simplify = true);
15-
~Function() = default;
15+
virtual ~Function() = default;
1616

1717
double evaluate(const VariableMap& vars) override;
1818
Function* derivative(char var) override;

cas/include/cas/util/StringUtils.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
#include <locale>
1111
#include <vector>
1212

13-
inline std::wstring toWstring(const std::string& string) {
14-
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
15-
return converter.from_bytes(string);
16-
}
17-
18-
inline std::string toString(const std::wstring& wString) {
19-
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
20-
return converter.to_bytes(wString);
21-
}
22-
2313
inline void replaceAll(std::string& str, const std::string& from, const std::string& to) {
2414
size_t start_pos = 0;
2515
while ((start_pos = str.find(from, start_pos)) != std::string::npos) {

0 commit comments

Comments
 (0)