summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-12-29 16:36:46 -0200
committerQt by Nokia <qt-info@nokia.com>2012-04-24 16:38:14 +0200
commit29d2aad30a47009e5b756a608dc9366900caf71f (patch)
treed62ceb7afa87eb93b63069bdb89dbdd3e9b94faf /src/gui/painting/qdrawhelper_p.h
parent1765329b8c15b855f787ef8079b4d021d06f7af4 (diff)
Use the C99 keyword "restrict" in compilers that support it
This allows the compiler to produce better / smaller code due to not being required to deal with two pointers possibly aliasing each other. This also enables vectorisation where otherwise the compiler wouldn't be able to do. Change-Id: Ie7db3a54a1ba22f87ac5283d5c43905707957549 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper_p.h')
-rw-r--r--src/gui/painting/qdrawhelper_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 8d67e69caa..f502533443 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -71,12 +71,15 @@ QT_BEGIN_NAMESPACE
// RVCT doesn't like static template functions
# define Q_STATIC_TEMPLATE_FUNCTION
# define Q_STATIC_INLINE_FUNCTION static __forceinline
+# define Q_DECL_RESTRICT
#elif defined(Q_CC_GNU)
# define Q_STATIC_TEMPLATE_FUNCTION static __attribute__((always_inline))
# define Q_STATIC_INLINE_FUNCTION static inline __attribute__((always_inline))
+# define Q_DECL_RESTRICT __restrict__
#else
# define Q_STATIC_TEMPLATE_FUNCTION static
# define Q_STATIC_INLINE_FUNCTION static inline
+# define Q_DECL_RESTRICT
#endif
static const uint AMASK = 0xff000000;
@@ -165,7 +168,7 @@ extern DrawHelper qDrawHelper[QImage::NImageFormats];
void qBlendTexture(int count, const QSpan *spans, void *userData);
-typedef void (QT_FASTCALL *CompositionFunction)(uint *dest, const uint *src, int length, uint const_alpha);
+typedef void (QT_FASTCALL *CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha);
typedef void (QT_FASTCALL *CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha);
struct LinearGradientValues