summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--compat/macros.hpp30
-rw-r--r--pose-widget/pose-widget.cpp14
2 files changed, 9 insertions, 35 deletions
diff --git a/compat/macros.hpp b/compat/macros.hpp
index 7c017d3e..df71b1f3 100644
--- a/compat/macros.hpp
+++ b/compat/macros.hpp
@@ -21,28 +21,14 @@
# define never_inline
#endif
-#if defined __GNUG__
+#if defined __cplusplus
# define restrict_ptr __restrict
-#elif defined _MSC_VER
-# define restrict_ptr __restrict
-#else
-# define restrict_ptr
-#endif
-
-#if defined _MSC_VER
-# define restrict_ref restrict_ptr
-#elif defined __GNUG__
-# define restrict_ref restrict_ptr
-#else
-# define restrict_ref
#endif
#if defined _MSC_VER
# define force_inline __forceinline
-#elif defined __GNUG__
-# define force_inline __attribute__((always_inline, gnu_inline)) inline
#else
-# define force_inline inline
+# define force_inline __attribute__((always_inline, gnu_inline)) inline
#endif
#ifdef Q_CREATOR_RUN
@@ -53,18 +39,6 @@
# define warn_result_unused __attribute__((warn_unused_result))
#endif
-#if defined __GNUG__
-# define unused(t, i) t __attribute__((unused)) i
-#else
-# define unused(t, i) t
-#endif
-
-#if defined _MSC_VER
-# define aligned_struct(x) struct __declspec(align(x))
-#else
-# define aligned_struct(x) struct __attribute__((__aligned__(x)))
-#endif
-
#if defined __GNUC__
# define likely(x) __builtin_expect(!!(x),1)
# define unlikely(x) __builtin_expect(!!(x),0)
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index 0880fd1e..60d41aa5 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -304,9 +304,9 @@ void pose_transform::project_quad_texture()
for (int y = 0; y < dist.y(); y++)
for (int x = 0; x < dist.x(); x++)
{
- uv_& restrict_ref uv = uv_vec[y * dist.x() + x];
- if (!t.barycentric_coords(vec2(x + min.x(), y + min.y()), uv.coords, uv.i))
- uv.i = -1;
+ uv_* restrict_ptr uv = &uv_vec[y * dist.x() + x];
+ if (!t.barycentric_coords(vec2(x + min.x(), y + min.y()), uv->coords, uv->i))
+ uv->i = -1;
}
const int ow = tex.width(), oh = tex.height();
@@ -330,14 +330,14 @@ void pose_transform::project_quad_texture()
for (int x_ = 0, dx = dist.x(); x_ < dx; x_++)
{
const int y = y_ + min.y(), x = x_ + min.x();
- uv_ const& restrict_ref uv__ = uv_vec[y_ * dx + x_];
+ const uv_* restrict_ptr uv__ = &uv_vec[y_ * dx + x_];
- if (uv__.i != -1)
+ if (uv__->i != -1)
{
using uc = unsigned char;
- vec2 const& uv = uv__.coords;
- int const i = uv__.i;
+ vec2 const& uv = uv__->coords;
+ int const i = uv__->i;
float fx = origs[i][0].x()
+ uv.x() * origs[i][2].x()