| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,7 @@ using namespace pybind11::literals; | |||
| 46 | 46 | * also. | |
| 47 | 47 | */ | |
| 48 | 48 | #define WIN32_DLL | |
| 49 | - static inline PyObject *PyErr_SetFromWindowsErr(int ierr) { | ||
| 49 | + static constexpr PyObject *PyErr_SetFromWindowsErr(int ierr) { | ||
| 50 | 50 | PyErr_SetString(PyExc_OSError, "Call to EnumProcessModules failed"); | |
| 51 | 51 | return nullptr; | |
| 52 | 52 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ namespace py = pybind11; | |||
| 38 | 38 | #define FIXED_MINOR(val) (unsigned short)(val & 0xffff) | |
| 39 | 39 | ||
| 40 | 40 | // 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) { | ||
| 42 | 42 | #undef __FTERRORS_H__ | |
| 43 | 43 | #define FT_ERROR_START_LIST switch (error) { | |
| 44 | 44 | #define FT_ERRORDEF( e, v, s ) case v: return s; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,12 +28,12 @@ | |||
| 28 | 28 | #endif | |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | - inline int mpl_round_to_int(double v) | ||
| 31 | + constexpr int mpl_round_to_int(double v) | ||
| 32 | 32 | { | |
| 33 | 33 | return (int)(v + ((v >= 0.0) ? 0.5 : -0.5)); | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - inline double mpl_round(double v) | ||
| 36 | + constexpr double mpl_round(double v) | ||
| 37 | 37 | { | |
| 38 | 38 | return (double)mpl_round_to_int(v); | |
| 39 | 39 | } | |
@@ -60,7 +60,7 @@ namespace py = pybind11; | |||
| 60 | 60 | using namespace pybind11::literals; | |
| 61 | 61 | ||
| 62 | 62 | 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) | ||
| 64 | 64 | { | |
| 65 | 65 | if (array.ndim() != 2) { | |
| 66 | 66 | throw py::value_error( | |
@@ -79,7 +79,7 @@ inline void check_trailing_shape(T array, char const* name, long d1) | |||
| 79 | 79 | } | |
| 80 | 80 | ||
| 81 | 81 | 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) | ||
| 83 | 83 | { | |
| 84 | 84 | if (array.ndim() != 3) { | |
| 85 | 85 | throw py::value_error( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ class EmbeddedQueue | |||
| 61 | 61 | { | |
| 62 | 62 | item() = default; | |
| 63 | 63 | ||
| 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_) | ||
| 65 | 65 | { | |
| 66 | 66 | cmd = cmd_; | |
| 67 | 67 | x = x_; | |
@@ -75,17 +75,17 @@ class EmbeddedQueue | |||
| 75 | 75 | int m_queue_write; | |
| 76 | 76 | item m_queue[QueueSize]; | |
| 77 | 77 | ||
| 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) | ||
| 79 | 79 | { | |
| 80 | 80 | m_queue[m_queue_write++].set(cmd, x, y); | |
| 81 | 81 | } | |
| 82 | 82 | ||
| 83 | - inline bool queue_nonempty() | ||
| 83 | + constexpr bool queue_nonempty() | ||
| 84 | 84 | { | |
| 85 | 85 | return m_queue_read < m_queue_write; | |
| 86 | 86 | } | |
| 87 | 87 | ||
| 88 | - inline bool queue_pop(unsigned *cmd, double *x, double *y) | ||
| 88 | + constexpr bool queue_pop(unsigned *cmd, double *x, double *y) | ||
| 89 | 89 | { | |
| 90 | 90 | if (queue_nonempty()) { | |
| 91 | 91 | const item &front = m_queue[m_queue_read++]; | |
@@ -102,7 +102,7 @@ class EmbeddedQueue | |||
| 102 | 102 | return false; | |
| 103 | 103 | } | |
| 104 | 104 | ||
| 105 | - inline void queue_clear() | ||
| 105 | + constexpr void queue_clear() | ||
| 106 | 106 | { | |
| 107 | 107 | m_queue_read = 0; | |
| 108 | 108 | m_queue_write = 0; | |
@@ -185,13 +185,13 @@ class PathNanRemover : protected EmbeddedQueue<4> | |||
| 185 | 185 | valid_segment_exists = false; | |
| 186 | 186 | } | |
| 187 | 187 | ||
| 188 | - inline void rewind(unsigned path_id) | ||
| 188 | + constexpr void rewind(unsigned path_id) | ||
| 189 | 189 | { | |
| 190 | 190 | queue_clear(); | |
| 191 | 191 | m_source->rewind(path_id); | |
| 192 | 192 | } | |
| 193 | 193 | ||
| 194 | - inline unsigned vertex(double *x, double *y) | ||
| 194 | + constexpr unsigned vertex(double *x, double *y) | ||
| 195 | 195 | { | |
| 196 | 196 | unsigned code; | |
| 197 | 197 | ||
@@ -373,7 +373,7 @@ class PathClipper : public EmbeddedQueue<3> | |||
| 373 | 373 | m_cliprect.y2 += 1.0; | |
| 374 | 374 | } | |
| 375 | 375 | ||
| 376 | - inline void rewind(unsigned path_id) | ||
| 376 | + constexpr void rewind(unsigned path_id) | ||
| 377 | 377 | { | |
| 378 | 378 | m_has_init = false; | |
| 379 | 379 | m_was_clipped = false; | |
@@ -621,12 +621,12 @@ class PathSnapper | |||
| 621 | 621 | source.rewind(0); | |
| 622 | 622 | } | |
| 623 | 623 | ||
| 624 | - inline void rewind(unsigned path_id) | ||
| 624 | + constexpr void rewind(unsigned path_id) | ||
| 625 | 625 | { | |
| 626 | 626 | m_source->rewind(path_id); | |
| 627 | 627 | } | |
| 628 | 628 | ||
| 629 | - inline unsigned vertex(double *x, double *y) | ||
| 629 | + constexpr unsigned vertex(double *x, double *y) | ||
| 630 | 630 | { | |
| 631 | 631 | unsigned code; | |
| 632 | 632 | code = m_source->vertex(x, y); | |
@@ -637,7 +637,7 @@ class PathSnapper | |||
| 637 | 637 | return code; | |
| 638 | 638 | } | |
| 639 | 639 | ||
| 640 | - inline bool is_snapping() | ||
| 640 | + constexpr bool is_snapping() | ||
| 641 | 641 | { | |
| 642 | 642 | return m_snap; | |
| 643 | 643 | } | |
@@ -710,7 +710,7 @@ class PathSimplifier : protected EmbeddedQueue<9> | |||
| 710 | 710 | // empty | |
| 711 | 711 | } | |
| 712 | 712 | ||
| 713 | - inline void rewind(unsigned path_id) | ||
| 713 | + constexpr void rewind(unsigned path_id) | ||
| 714 | 714 | { | |
| 715 | 715 | queue_clear(); | |
| 716 | 716 | m_moveto = true; | |
@@ -985,7 +985,7 @@ class PathSimplifier : protected EmbeddedQueue<9> | |||
| 985 | 985 | double m_currVecStartX; | |
| 986 | 986 | double m_currVecStartY; | |
| 987 | 987 | ||
| 988 | - inline void _push(double *x, double *y) | ||
| 988 | + constexpr void _push(double *x, double *y) | ||
| 989 | 989 | { | |
| 990 | 990 | bool needToPushBack = (m_dnorm2BackwardMax > 0.0); | |
| 991 | 991 | ||
@@ -1136,7 +1136,7 @@ class Sketch | |||
| 1136 | 1136 | return code; | |
| 1137 | 1137 | } | |
| 1138 | 1138 | ||
| 1139 | - inline void rewind(unsigned path_id) | ||
| 1139 | + constexpr void rewind(unsigned path_id) | ||
| 1140 | 1140 | { | |
| 1141 | 1141 | m_has_last = false; | |
| 1142 | 1142 | m_p = 0.0; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments