FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Restrict constexpr to fewer functions · matplotlib/matplotlib@6b1521a · GitHub

Repository navigation

Commit 6b1521a

Browse files
committed
Restrict constexpr to fewer functions
1 parent 16edb0c commit 6b1521a

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎src/_tkagg.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ using namespace pybind11::literals;
4646
* also.
4747
*/
4848
#define WIN32_DLL
49-
static inline PyObject *PyErr_SetFromWindowsErr(int ierr) {
49+
static constexpr PyObject *PyErr_SetFromWindowsErr(int ierr) {
5050
PyErr_SetString(PyExc_OSError, "Call to EnumProcessModules failed");
5151
return nullptr;
5252
}

‎src/ft2font.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace py = pybind11;
3838
#define FIXED_MINOR(val) (unsigned short)(val & 0xffff)
3939

4040
// Error handling (error codes are loaded as described in fterror.h).
41-
inline char const* ft_error_string(FT_Error error) {
41+
constexpr char const* ft_error_string(FT_Error error) {
4242
#undef __FTERRORS_H__
4343
#define FT_ERROR_START_LIST switch (error) {
4444
#define FT_ERRORDEF( e, v, s ) case v: return s;

‎src/mplutils.h‎

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

3030

31-
inline int mpl_round_to_int(double v)
31+
constexpr int mpl_round_to_int(double v)
3232
{
3333
return (int)(v + ((v >= 0.0) ? 0.5 : -0.5));
3434
}
3535

36-
inline double mpl_round(double v)
36+
constexpr double mpl_round(double v)
3737
{
3838
return (double)mpl_round_to_int(v);
3939
}
@@ -60,7 +60,7 @@ namespace py = pybind11;
6060
using namespace pybind11::literals;
6161

6262
template<typename T>
63-
inline void check_trailing_shape(T array, char const* name, long d1)
63+
constexpr void check_trailing_shape(T array, char const* name, long d1)
6464
{
6565
if (array.ndim() != 2) {
6666
throw py::value_error(
@@ -79,7 +79,7 @@ inline void check_trailing_shape(T array, char const* name, long d1)
7979
}
8080

8181
template<typename T>
82-
inline void check_trailing_shape(T array, char const* name, long d1, long d2)
82+
constexpr void check_trailing_shape(T array, char const* name, long d1, long d2)
8383
{
8484
if (array.ndim() != 3) {
8585
throw py::value_error(

‎src/path_converters.h‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class EmbeddedQueue
6161
{
6262
item() = default;
6363

64-
inline void set(const unsigned cmd_, const double x_, const double y_)
64+
constexpr void set(const unsigned cmd_, const double x_, const double y_)
6565
{
6666
cmd = cmd_;
6767
x = x_;
@@ -75,17 +75,17 @@ class EmbeddedQueue
7575
int m_queue_write;
7676
item m_queue[QueueSize];
7777

78-
inline void queue_push(const unsigned cmd, const double x, const double y)
78+
constexpr void queue_push(const unsigned cmd, const double x, const double y)
7979
{
8080
m_queue[m_queue_write++].set(cmd, x, y);
8181
}
8282

83-
inline bool queue_nonempty()
83+
constexpr bool queue_nonempty()
8484
{
8585
return m_queue_read < m_queue_write;
8686
}
8787

88-
inline bool queue_pop(unsigned *cmd, double *x, double *y)
88+
constexpr bool queue_pop(unsigned *cmd, double *x, double *y)
8989
{
9090
if (queue_nonempty()) {
9191
const item &front = m_queue[m_queue_read++];
@@ -102,7 +102,7 @@ class EmbeddedQueue
102102
return false;
103103
}
104104

105-
inline void queue_clear()
105+
constexpr void queue_clear()
106106
{
107107
m_queue_read = 0;
108108
m_queue_write = 0;
@@ -185,13 +185,13 @@ class PathNanRemover : protected EmbeddedQueue<4>
185185
valid_segment_exists = false;
186186
}
187187

188-
inline void rewind(unsigned path_id)
188+
constexpr void rewind(unsigned path_id)
189189
{
190190
queue_clear();
191191
m_source->rewind(path_id);
192192
}
193193

194-
inline unsigned vertex(double *x, double *y)
194+
constexpr unsigned vertex(double *x, double *y)
195195
{
196196
unsigned code;
197197

@@ -373,7 +373,7 @@ class PathClipper : public EmbeddedQueue<3>
373373
m_cliprect.y2 += 1.0;
374374
}
375375

376-
inline void rewind(unsigned path_id)
376+
constexpr void rewind(unsigned path_id)
377377
{
378378
m_has_init = false;
379379
m_was_clipped = false;
@@ -621,12 +621,12 @@ class PathSnapper
621621
source.rewind(0);
622622
}
623623

624-
inline void rewind(unsigned path_id)
624+
constexpr void rewind(unsigned path_id)
625625
{
626626
m_source->rewind(path_id);
627627
}
628628

629-
inline unsigned vertex(double *x, double *y)
629+
constexpr unsigned vertex(double *x, double *y)
630630
{
631631
unsigned code;
632632
code = m_source->vertex(x, y);
@@ -637,7 +637,7 @@ class PathSnapper
637637
return code;
638638
}
639639

640-
inline bool is_snapping()
640+
constexpr bool is_snapping()
641641
{
642642
return m_snap;
643643
}
@@ -710,7 +710,7 @@ class PathSimplifier : protected EmbeddedQueue<9>
710710
// empty
711711
}
712712

713-
inline void rewind(unsigned path_id)
713+
constexpr void rewind(unsigned path_id)
714714
{
715715
queue_clear();
716716
m_moveto = true;
@@ -985,7 +985,7 @@ class PathSimplifier : protected EmbeddedQueue<9>
985985
double m_currVecStartX;
986986
double m_currVecStartY;
987987

988-
inline void _push(double *x, double *y)
988+
constexpr void _push(double *x, double *y)
989989
{
990990
bool needToPushBack = (m_dnorm2BackwardMax > 0.0);
991991

@@ -1136,7 +1136,7 @@ class Sketch
11361136
return code;
11371137
}
11381138

1139-
inline void rewind(unsigned path_id)
1139+
constexpr void rewind(unsigned path_id)
11401140
{
11411141
m_has_last = false;
11421142
m_p = 0.0;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL