Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
luqasz committed Oct 2, 2023
1 parent ead43e3 commit 528426f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ BraceWrapping:
CompactNamespaces: false
NamespaceIndentation: All
BreakBeforeConceptDeclarations: Always
RequiresExpressionIndentation: OuterScope
RequiresClausePosition: OwnLine
IndentRequiresClause: false
10 changes: 5 additions & 5 deletions include/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ namespace buffer {
};

template <typename CT, usize BUFFER_SIZE>
requires(BUFFER_SIZE > 1)
requires(BUFFER_SIZE > 1)
struct Circular {
using ContainedType = CT;
using IndexType = usize;
Expand Down Expand Up @@ -407,7 +407,7 @@ namespace buffer {
};

template <typename T, typename U>
requires Assignable<T, U>
requires Assignable<T, U>
constexpr usize
copy(const Span<T> src, Span<U> dst)
{
Expand All @@ -421,7 +421,7 @@ namespace buffer {
}

template <typename T, Writer W>
requires Assignable<T, typename W::ContainedType>
requires Assignable<T, typename W::ContainedType>
constexpr usize
copy(const Span<T> src, W & dst)
{
Expand All @@ -435,7 +435,7 @@ namespace buffer {
}

template <Reader R, typename T>
requires Assignable<typename R::ContainedType, T>
requires Assignable<typename R::ContainedType, T>
constexpr usize
copy(R & src, Span<T> dst)
{
Expand All @@ -449,7 +449,7 @@ namespace buffer {
}

template <Reader R, Writer W>
requires Assignable<typename R::ContainedType, typename W::ContainedType>
requires Assignable<typename R::ContainedType, typename W::ContainedType>
constexpr usize
copy(R & src, W & dst)
{
Expand Down
2 changes: 1 addition & 1 deletion include/cobs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace cobs {
}

template <Writer DST>
requires Assignable<u8, typename DST::ContainedType>
requires Assignable<u8, typename DST::ContainedType>
constexpr usize
encode(const buffer::Span<const u8> in, DST & out)
{
Expand Down
4 changes: 2 additions & 2 deletions include/drivers/mcp4xxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ namespace mcp4xxx {

// Return bits ready to be sent over SPI bus.
template <const usize bits>
requires(bits == 10 or bits == 12 or bits == 8)
requires(bits == 10 or bits == 12 or bits == 8)
CONSTFN constexpr u16
cmd(const CtrllBits & ctrl, u16 value)
cmd(const CtrllBits & ctrl, u16 value)
{
if constexpr (bits == 10) {
value <<= 2;
Expand Down
2 changes: 1 addition & 1 deletion include/mcu/common/atmega/gpio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace gpio {
// Takes at least 2 pins and forms a N bit bus.
// Pins must share same port address.
template <Pin F, Pin... O>
requires(F.port.port_address == (O.port.port_address | ...))
requires(F.port.port_address == (O.port.port_address | ...))
struct PortPins {
constexpr static u16 ddr_address = F.port.ddr_address;
constexpr static u16 pin_address = F.port.pin_address;
Expand Down
10 changes: 5 additions & 5 deletions include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#include "traits.hpp"

template <typename T>
requires is_unsigned<T> bool
constexpr CONSTFN
requires is_unsigned<T>
bool constexpr CONSTFN
is_power_of_two(T number)
{
return (number != 0) and (number & (number - 1)) == 0;
}

// Return first bit position starting from LSB and counting from 0.
template <typename T>
requires is_unsigned<T>
requires is_unsigned<T>
usize constexpr CONSTFN
first_lsbit(T n)
{
Expand All @@ -32,7 +32,7 @@ first_lsbit(T n)
}

template <typename T>
requires is_unsigned<T>
requires is_unsigned<T>
constexpr T CONSTFN
countSetBits(T number)
{
Expand All @@ -45,7 +45,7 @@ countSetBits(T number)
}

template <typename T>
requires is_unsigned<T>
requires is_unsigned<T>
constexpr T CONSTFN
inverted(T value)
{
Expand Down

0 comments on commit 528426f

Please sign in to comment.