Skip to content

Commit 9e2954f

Browse files
committed
[utils] Remove unnecessary use of modm_always_inline
1 parent 6e96bb0 commit 9e2954f

Some content is hidden

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

64 files changed

+260
-297
lines changed

ext/microchip/device.hpp.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
%% endfor
1919

2020
#include <stdint.h>
21-
// Defines for example the modm_always_inline macro
2221
#include <modm/architecture/utils.hpp>
2322

2423
// Include external device headers:

ext/nxp/device.hpp.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
%% endfor
2222

2323
#include <stdint.h>
24-
// Defines for example the modm_always_inline macro
2524
#include <modm/architecture/utils.hpp>
2625

2726
// Include external device headers:

ext/rp/device.hpp.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
%% endfor
2222

2323
#include <stdint.h>
24-
// Defines for example the modm_always_inline macro
2524
#include <modm/architecture/utils.hpp>
2625

2726
// Include external device headers:

ext/st/device.hpp.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
%% endfor
2323

2424
#include <stdint.h>
25-
// Defines for example the modm_always_inline macro
2625
#include <modm/architecture/utils.hpp>
2726

2827
%% if target.family == "l5"

src/modm/architecture/driver/atomic/queue.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ namespace modm
3333
*
3434
* \todo This implementation should work but could be improved
3535
*/
36-
template<typename T,
37-
std::size_t N>
36+
template<typename T, std::size_t N>
3837
class Queue
3938
{
4039
public:
@@ -46,10 +45,10 @@ namespace modm
4645
public:
4746
Queue();
4847

49-
modm_always_inline bool
48+
bool
5049
isFull() const;
5150

52-
modm_always_inline bool
51+
bool
5352
isNotFull() const { return not isFull(); }
5453

5554
/**
@@ -61,10 +60,10 @@ namespace modm
6160
bool
6261
isNearlyFull() const;
6362

64-
modm_always_inline bool
63+
bool
6564
isEmpty() const;
6665

67-
modm_always_inline bool
66+
bool
6867
isNotEmpty() const { return not isEmpty(); }
6968

7069
/**
@@ -79,7 +78,7 @@ namespace modm
7978
bool
8079
isNearlyEmpty() const;
8180

82-
modm_always_inline Size
81+
Size
8382
getMaxSize() const;
8483

8584
Size

src/modm/architecture/driver/atomic/queue_impl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ modm::atomic::Queue<T, N>::Queue() :
2626
}
2727

2828
template<typename T, std::size_t N>
29-
modm_always_inline bool
29+
bool
3030
modm::atomic::Queue<T, N>::isFull() const
3131
{
3232
Index tmphead = this->head + 1;
@@ -46,7 +46,7 @@ modm::atomic::Queue<T, N>::isNearlyFull() const
4646
}
4747

4848
template<typename T, std::size_t N>
49-
modm_always_inline bool
49+
bool
5050
modm::atomic::Queue<T, N>::isEmpty() const
5151
{
5252
return (this->head == this->tail);
@@ -62,7 +62,7 @@ modm::atomic::Queue<T, N>::isNearlyEmpty() const
6262

6363

6464
template<typename T, std::size_t N>
65-
modm_always_inline typename modm::atomic::Queue<T, N>::Size
65+
typename modm::atomic::Queue<T, N>::Size
6666
modm::atomic::Queue<T, N>::getMaxSize() const
6767
{
6868
return N;
@@ -87,14 +87,14 @@ modm::atomic::Queue<T, N>::getSize() const
8787
}
8888

8989
template<typename T, std::size_t N>
90-
modm_always_inline const T&
90+
const T&
9191
modm::atomic::Queue<T, N>::get() const
9292
{
9393
return this->buffer[this->tail];
9494
}
9595

9696
template<typename T, std::size_t N>
97-
modm_always_inline bool
97+
bool
9898
modm::atomic::Queue<T, N>::push(const T& value)
9999
{
100100
Index tmphead = this->head + 1;
@@ -112,7 +112,7 @@ modm::atomic::Queue<T, N>::push(const T& value)
112112
}
113113

114114
template<typename T, std::size_t N>
115-
modm_always_inline void
115+
void
116116
modm::atomic::Queue<T, N>::pop()
117117
{
118118
Index tmptail = this->tail + 1;

src/modm/architecture/interface/accessor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace accessor
2828
* @ingroup modm_architecture_accessor
2929
*/
3030
template<typename T>
31-
modm_always_inline volatile T&
31+
volatile T&
3232
asVolatile(T& value)
3333
{
3434
return (volatile T&) value;

src/modm/architecture/interface/accessor_flash.hpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,42 +67,36 @@ template<typename T>
6767
class Flash
6868
{
6969
public:
70-
modm_always_inline
7170
explicit Flash(const T* addr = 0) :
7271
address(addr)
7372
{
7473
}
7574

7675
template <typename U>
77-
modm_always_inline
7876
explicit Flash(const Flash<U>& rhs) :
7977
address((T*) rhs.address)
8078
{
8179
}
8280

83-
modm_always_inline
8481
const T
8582
operator *() const
8683
{
8784
return FlashReader<T, sizeof(T)>::read(address);
8885
}
8986

90-
modm_always_inline
9187
const T
9288
operator [](size_t index) const
9389
{
9490
return FlashReader<T, sizeof(T)>::read(address + index);
9591
}
9692

97-
modm_always_inline
9893
Flash&
9994
operator++()
10095
{
10196
*this += 1;
10297
return *this;
10398
}
10499

105-
modm_always_inline
106100
Flash
107101
operator++(int)
108102
{
@@ -111,15 +105,13 @@ class Flash
111105
return ret;
112106
}
113107

114-
modm_always_inline
115108
Flash&
116109
operator--()
117110
{
118111
*this -= 1;
119112
return *this;
120113
}
121114

122-
modm_always_inline
123115
Flash&
124116
operator--(int)
125117
{
@@ -128,30 +120,26 @@ class Flash
128120
return ret;
129121
}
130122

131-
modm_always_inline
132123
Flash&
133124
operator+=(size_t rhs)
134125
{
135126
address += rhs;
136127
return *this;
137128
}
138129

139-
modm_always_inline
140130
Flash&
141131
operator-=(size_t rhs)
142132
{
143133
address -= rhs;
144134
return *this;
145135
}
146136

147-
modm_always_inline
148137
bool
149138
isValid() const
150139
{
151140
return (address != 0);
152141
}
153142

154-
modm_always_inline
155143
const T*
156144
getPointer() const
157145
{
@@ -170,8 +158,7 @@ class Flash
170158

171159
/// Convert a normal pointer to a accessor::Flash
172160
/// @ingroup modm_architecture_accessor
173-
template<typename T>
174-
modm_always_inline ::modm::accessor::Flash<T>
161+
template<typename T> ::modm::accessor::Flash<T>
175162
asFlash(const T* ptr)
176163
{
177164
return ::modm::accessor::Flash<T>(ptr);

src/modm/architecture/interface/accessor_ram.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,36 @@ template<typename T>
3333
class Ram
3434
{
3535
public:
36-
modm_always_inline
3736
Ram(const T* addr = 0) :
3837
address(addr)
3938
{
4039
}
4140

4241
template <typename U>
43-
modm_always_inline
4442
explicit Ram(const Ram<U>& rhs) :
4543
address((T*) rhs.address)
4644
{
4745
}
4846

49-
modm_always_inline
5047
const T
5148
operator *() const
5249
{
5350
return *address;
5451
}
5552

56-
modm_always_inline
5753
const T
5854
operator [](std::size_t index) const
5955
{
6056
return *(address + index);
6157
}
6258

63-
modm_always_inline
6459
Ram&
6560
operator ++ ()
6661
{
6762
*this += 1;
6863
return *this;
6964
}
7065

71-
modm_always_inline
7266
Ram
7367
operator ++ (int)
7468
{
@@ -77,15 +71,13 @@ class Ram
7771
return ret;
7872
}
7973

80-
modm_always_inline
8174
Ram&
8275
operator -- ()
8376
{
8477
*this -= 1;
8578
return *this;
8679
}
8780

88-
modm_always_inline
8981
Ram&
9082
operator -- (int)
9183
{
@@ -94,23 +86,20 @@ class Ram
9486
return ret;
9587
}
9688

97-
modm_always_inline
9889
Ram&
9990
operator += (std::size_t rhs)
10091
{
10192
address += rhs;
10293
return *this;
10394
}
10495

105-
modm_always_inline
10696
Ram&
10797
operator -= (std::size_t rhs)
10898
{
10999
address -= rhs;
110100
return *this;
111101
}
112102

113-
modm_always_inline
114103
const T*
115104
getPointer() const
116105
{

src/modm/architecture/interface/atomic_lock.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ namespace atomic
4949
class Lock
5050
{
5151
public:
52-
modm_always_inline
5352
Lock();
5453
};
5554

@@ -66,7 +65,6 @@ class Lock
6665
class Unlock
6766
{
6867
public:
69-
modm_always_inline
7068
Unlock();
7169
};
7270

0 commit comments

Comments
 (0)