Skip to content

Commit b8355b3

Browse files
authored
Bring Dev branch into main for v0.1.3 (#26)
1 parent b9dae17 commit b8355b3

File tree

209 files changed

+6879
-3274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+6879
-3274
lines changed

.clang-format

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
Language: Cpp
3-
BasedOnStyle: Microsoft
3+
BasedOnStyle: LLVM
44
AccessModifierOffset: -4
55
AlignConsecutiveAssignments: Consecutive
66
AlignConsecutiveMacros: Consecutive
77
AlignEscapedNewlines: Right
8-
AlignTrailingComments: Always
8+
AlignTrailingComments:
9+
Kind: Always
910
AllowShortEnumsOnASingleLine: true
1011
AllowShortCaseLabelsOnASingleLine: true
1112
AllowShortFunctionsOnASingleLine: InlineOnly
@@ -46,7 +47,7 @@ IncludeCategories:
4647
# Headers in <> with .hpp extension.
4748
- Regex: '<([A-Za-z0-9\/-_])+\.hpp>'
4849
Priority: 20
49-
# Headers in <> without extension.
50+
# Headers in <> without an extension.
5051
- Regex: '<([A-Za-z0-9\/-_])+>'
5152
Priority: 30
5253
NamespaceIndentation: All

.clang-tidy

+29-122
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,22 @@
11
---
22
Checks: '-*,
3-
bugprone-argument-comment,
4-
bugprone-assert-side-effect,
5-
bugprone-bad-signal-to-kill-thread,
6-
bugprone-branch-clone,
7-
bugprone-copy-constructor-init,
8-
bugprone-dangling-handle,
9-
bugprone-dynamic-static-initializers,
10-
bugprone-fold-init-type,
11-
bugprone-forward-declaration-namespace,
12-
bugprone-forwarding-reference-overload,
13-
bugprone-inaccurate-erase,
14-
bugprone-incorrect-roundings,
15-
bugprone-integer-division,
16-
bugprone-lambda-function-name,
17-
bugprone-macro-parentheses,
18-
bugprone-macro-repeated-side-effects,
19-
bugprone-misplaced-operator-in-strlen-in-alloc,
20-
bugprone-misplaced-pointer-arithmetic-in-alloc,
21-
bugprone-misplaced-widening-cast,
22-
bugprone-move-forwarding-reference,
23-
bugprone-multiple-statement-macro,
24-
bugprone-no-escape,
25-
bugprone-not-null-terminated-result,
26-
bugprone-parent-virtual-call,
27-
bugprone-posix-return,
28-
bugprone-reserved-identifier,
29-
bugprone-sizeof-container,
30-
bugprone-sizeof-expression,
31-
bugprone-spuriously-wake-up-functions,
32-
bugprone-string-constructor,
33-
bugprone-string-integer-assignment,
34-
bugprone-string-literal-with-embedded-nul,
35-
bugprone-suspicious-enum-usage,
36-
bugprone-suspicious-include,
37-
bugprone-suspicious-memset-usage,
38-
bugprone-suspicious-missing-comma,
39-
bugprone-suspicious-semicolon,
40-
bugprone-suspicious-string-compare,
41-
bugprone-suspicious-memory-comparison,
42-
bugprone-suspicious-realloc-usage,
43-
bugprone-swapped-arguments,
44-
bugprone-terminating-continue,
45-
bugprone-throw-keyword-missing,
46-
bugprone-too-small-loop-variable,
47-
bugprone-undefined-memory-manipulation,
48-
bugprone-undelegated-constructor,
49-
bugprone-unhandled-self-assignment,
50-
bugprone-unused-raii,
51-
bugprone-unused-return-value,
52-
bugprone-use-after-move,
53-
bugprone-virtual-near-miss,
3+
bugprone-*,
4+
-bugprone-easily-swappable-parameters,
5+
6+
modernize-*,
7+
-modernize-use-trailing-return-type,
8+
-modernize-use-constraints,
9+
10+
performance-*,
11+
-performance-avoid-endl,
12+
13+
readability-*,
14+
-readability-identifier-length,
15+
-readability-magic-numbers,
16+
17+
cppcoreguidelines-*,
18+
-cppcoreguidelines-avoid-magic-numbers,
19+
5420
cert-dcl21-cpp,
5521
cert-dcl58-cpp,
5622
cert-err34-c,
@@ -60,88 +26,29 @@ cert-flp30-c,
6026
cert-msc50-cpp,
6127
cert-msc51-cpp,
6228
cert-str34-c,
63-
cppcoreguidelines-interfaces-global-init,
64-
cppcoreguidelines-narrowing-conversions,
65-
cppcoreguidelines-pro-type-member-init,
66-
cppcoreguidelines-pro-type-static-cast-downcast,
67-
cppcoreguidelines-slicing,
6829
google-default-arguments,
6930
google-explicit-constructor,
7031
google-runtime-operator,
32+
google-readability-casting,
33+
google-upgrade-googletest-case,
34+
llvm-include-order,
35+
llvm-namespace-comment,
7136
hicpp-exception-baseclass,
7237
hicpp-multiway-paths-covered,
38+
hicpp-no-assembler,
39+
misc-const-correctness,
40+
misc-definitions-in-headers,
41+
misc-header-include-cycle,
42+
misc-include-cleaner,
7343
misc-misplaced-const,
7444
misc-new-delete-overloads,
7545
misc-no-recursion,
7646
misc-non-copyable-objects,
47+
misc-static-assert,
7748
misc-throw-by-value-catch-by-reference,
7849
misc-unconventional-assign-operator,
7950
misc-uniqueptr-reset-release,
80-
modernize-avoid-bind,
81-
modernize-concat-nested-namespaces,
82-
modernize-deprecated-headers,
83-
modernize-deprecated-ios-base-aliases,
84-
modernize-loop-convert,
85-
modernize-make-shared,
86-
modernize-make-unique,
87-
modernize-pass-by-value,
88-
modernize-raw-string-literal,
89-
modernize-redundant-void-arg,
90-
modernize-replace-auto-ptr,
91-
modernize-replace-disallow-copy-and-assign-macro,
92-
modernize-replace-random-shuffle,
93-
modernize-return-braced-init-list,
94-
modernize-shrink-to-fit,
95-
modernize-unary-static-assert,
96-
modernize-use-auto,
97-
modernize-use-bool-literals,
98-
modernize-use-emplace,
99-
modernize-use-equals-default,
100-
modernize-use-equals-delete,
101-
modernize-use-nodiscard,
102-
modernize-use-noexcept,
103-
modernize-use-nullptr,
104-
modernize-use-override,
105-
modernize-use-transparent-functors,
106-
modernize-use-uncaught-exceptions,
51+
misc-use-anonymous-namespace,
10752
mpi-buffer-deref,
10853
mpi-type-mismatch,
109-
openmp-use-default-none,
110-
performance-faster-string-find,
111-
performance-for-range-copy,
112-
performance-implicit-conversion-in-loop,
113-
performance-inefficient-algorithm,
114-
performance-inefficient-string-concatenation,
115-
performance-inefficient-vector-operation,
116-
performance-move-const-arg,
117-
performance-move-constructor-init,
118-
performance-no-automatic-move,
119-
performance-noexcept-move-constructor,
120-
performance-trivially-destructible,
121-
performance-type-promotion-in-math-fn,
122-
performance-unnecessary-copy-initialization,
123-
performance-unnecessary-value-param,
124-
portability-simd-intrinsics,
125-
readability-avoid-const-params-in-decls,
126-
readability-const-return-type,
127-
readability-container-size-empty,
128-
readability-convert-member-functions-to-static,
129-
readability-delete-null-pointer,
130-
readability-deleted-default,
131-
readability-inconsistent-declaration-parameter-name,
132-
readability-make-member-function-const,
133-
readability-misleading-indentation,
134-
readability-misplaced-array-index,
135-
readability-non-const-parameter,
136-
readability-redundant-control-flow,
137-
readability-redundant-declaration,
138-
readability-redundant-function-ptr-dereference,
139-
readability-redundant-smartptr-get,
140-
readability-redundant-string-cstr,
141-
readability-redundant-string-init,
142-
readability-simplify-subscript-expr,
143-
readability-static-accessed-through-instance,
144-
readability-static-definition-in-anonymous-namespace,
145-
readability-string-compare,
146-
readability-uniqueptr-delete-release,
147-
readability-use-anyofallof'
54+
openmp-use-default-none'

.github/CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file defines the owners of the code in this repository.
2+
# See https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners for more information.
3+
4+
# Assign @Rinzii as code owner for all files in the repository
5+
* @Rinzii

.github/ISSUE_TEMPLATE/bug_report.md

-32
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
title: '[BUG]: '
4+
labels: ['bug']
5+
body:
6+
- type: checkboxes
7+
attributes:
8+
label: Due Diligence
9+
description: Before you submit a bug report, please check the following
10+
options:
11+
- label: I have searched for similar issues before starting this bug report
12+
required: true
13+
- type: textarea
14+
id: description
15+
attributes:
16+
label: Describe the bug
17+
description: A clear and concise description of what the bug is.
18+
placeholder: e.g. ccm::sqrt(4) is incorrectly outputting 1.9999999... instead of 2.0 on clang-12 x86-64
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: reproduction
23+
attributes:
24+
label: Steps to reproduce
25+
description: Steps used to reproduce the bug.
26+
placeholder: |
27+
1. Set the compiler to clang-12 on x86-64
28+
2. Write the following code:
29+
```cpp
30+
#include <iostream> // std::cout and std::endl
31+
#include <ccmath/ccmath.hpp>
32+
int main() {
33+
std::cout << ccm::sqrt(4) << std::endl;
34+
}
35+
```
36+
3. Execute the program
37+
4. See the output
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: expected-behavior
42+
attributes:
43+
label: Expected behavior
44+
description: A clear and concise description of what you expected to happen.
45+
placeholder: The output should be outputting 2.0 as this is the square root of 4, but it is outputting 1.9999999... instead.
46+
validations:
47+
required: true
48+
- type: markdown
49+
attributes:
50+
value: '# System information'
51+
- type: input
52+
id: compiler-version-and-type
53+
attributes:
54+
label: Compiler version and type
55+
description: The name of your compile and it's version
56+
placeholder: GCC 13.2.1 (20230801)
57+
validations:
58+
required: true
59+
- type: input
60+
id: operating-system
61+
attributes:
62+
label: Operating System
63+
description:
64+
If applicable (i.e, an issue with how the code compiles for your OS) the OS version this bug is happening in
65+
placeholder: Ubuntu Linux 22.04
66+
validations:
67+
required: false
68+
- type: textarea
69+
id: screenshots
70+
attributes:
71+
label: Screenshots
72+
description: If applicable, add screenshots to help explain your problem.
73+
placeholder: As you can see here, the output is not showing up
74+
value: Not applicable
75+
validations:
76+
required: false

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Please target the "dev" branch when creating a pull request to ensure you are using the latest version of ccmath -->

CMakeLists.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.18)
22

3-
set(CCMATH_BUILD_VERSION 0.1.2)
3+
set(CCMATH_BUILD_VERSION 0.1.3)
44
set(INTERNAL_PROJ_DEFAULT_NAME ccmath)
55

66
project(${INTERNAL_PROJ_DEFAULT_NAME} VERSION ${CCMATH_BUILD_VERSION})
@@ -20,6 +20,7 @@ option(CCMATH_BUILD_EXAMPLES "Build ccmath examples" ${is_root_project})
2020
option(CCMATH_BUILD_BENCHMARKS "Build ccmath benchmarks" ${is_root_project})
2121
option(CCMATH_INSTALL "Setup install and package steps" ${is_root_project})
2222
option(CCMATH_USE_SIMD "Use SIMD instructions" OFF) # SIMD is not yet implemented.
23+
option(CCMATH_ENABLE_EXTENSIONS "Enable the extended ccmath library that adds helpful additional methods that are not defined by the standard" ON)
2324

2425
# include the global configuration file
2526
include(cmake/GlobalConfig.cmake)
@@ -31,6 +32,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
3132
target_compile_options(${PROJECT_NAME}-compile-options INTERFACE
3233
-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
3334
)
35+
3436
# TODO: Remove this later.
3537
# Some variables have been provided but are not currently being used, but it would not atm make sense to remove them.
3638
# So to clean up the warnings we are just silencing these specific cases.
@@ -52,6 +54,11 @@ add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
5254

5355
target_sources(${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${ccmath_headers}>")
5456

57+
if (CCMATH_ENABLE_EXTENSIONS)
58+
include(ccmath_extensions_headers.cmake)
59+
target_sources(${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${ccmath_extensions_headers}>")
60+
endif()
61+
5562
target_include_directories(${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>)
5663
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>)
5764

@@ -65,7 +72,7 @@ target_link_libraries(${PROJECT_NAME} INTERFACE
6572
configure_file(cmake/version.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/include/${PROJECT_NAME}/version.hpp" @ONLY)
6673

6774
if (CCMATH_BUILD_EXAMPLES OR CCMATH_BUILD_BENCHMARKS OR CCMATH_BUILD_TEST)
68-
add_subdirectory(ext)
75+
add_subdirectory(thirdparty)
6976
endif()
7077

7178
if (CCMATH_BUILD_EXAMPLES)

0 commit comments

Comments
 (0)