[cairo-commit] 3 commits - pixman/src src/cairoint.h

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Apr 3 17:02:50 PDT 2007


 pixman/src/fbcompose.c   |   10 ++++++----
 pixman/src/fbedge.c      |    8 ++++++--
 pixman/src/fbmmx.c       |   45 +++++++++++++++++++++++----------------------
 pixman/src/fbpict.c      |    1 +
 pixman/src/fbpict.h      |    6 ------
 pixman/src/fbtrap.c      |    4 ++++
 pixman/src/icblt.c       |    4 ++++
 pixman/src/icbltone.c    |    4 ++++
 pixman/src/iccolor.c     |    4 ++++
 pixman/src/icformat.c    |    4 ++++
 pixman/src/icimage.c     |    8 ++++++--
 pixman/src/icint.h       |   12 +-----------
 pixman/src/icpixels.c    |    4 ++++
 pixman/src/icrect.c      |    4 ++++
 pixman/src/icstipple.c   |    4 ++++
 pixman/src/ictransform.c |    4 ++++
 pixman/src/ictrap.c      |    4 ++++
 pixman/src/ictri.c       |    4 ++++
 pixman/src/icutil.c      |    4 ++++
 pixman/src/pixregion.c   |   14 ++++++--------
 pixman/src/renderedge.c  |    4 ++++
 src/cairoint.h           |    2 --
 22 files changed, 101 insertions(+), 57 deletions(-)

New commits:
diff-tree 174ebc43fe84854876d642e67fc3a442d280b59e (from 208c32b245d7f50e1e9d71695269128b28a675fc)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 3 20:01:32 2007 -0400

    [pixman] Make sure all source files include config.h
    as their first include.

diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index a6a55aa..66bbe30 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -23,9 +23,11 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include "pixman-xserver-compat.h"
 #include "fbpict.h"
 
diff --git a/pixman/src/fbpict.c b/pixman/src/fbpict.c
index 0bd989f..5afcd05 100644
--- a/pixman/src/fbpict.c
+++ b/pixman/src/fbpict.c
@@ -24,6 +24,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include "pixman-xserver-compat.h"
 
 #ifdef RENDER
diff --git a/pixman/src/fbtrap.c b/pixman/src/fbtrap.c
index 2fbfbe4..fd2493c 100644
--- a/pixman/src/fbtrap.c
+++ b/pixman/src/fbtrap.c
@@ -22,6 +22,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 #ifdef RENDER
diff --git a/pixman/src/icblt.c b/pixman/src/icblt.c
index 4f0c98e..4f3bdeb 100644
--- a/pixman/src/icblt.c
+++ b/pixman/src/icblt.c
@@ -22,6 +22,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 #define InitializeShifts(sx,dx,ls,rs) { \
diff --git a/pixman/src/icbltone.c b/pixman/src/icbltone.c
index d67e75d..2101f88 100644
--- a/pixman/src/icbltone.c
+++ b/pixman/src/icbltone.c
@@ -22,6 +22,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 /*
diff --git a/pixman/src/iccolor.c b/pixman/src/iccolor.c
index 9dd8f5e..e0cb764 100644
--- a/pixman/src/iccolor.c
+++ b/pixman/src/iccolor.c
@@ -21,6 +21,10 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 #ifdef ICINT_NEED_IC_ONES
diff --git a/pixman/src/icformat.c b/pixman/src/icformat.c
index bf93a6c..5d880ec 100644
--- a/pixman/src/icformat.c
+++ b/pixman/src/icformat.c
@@ -21,6 +21,10 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 #define Mask(n)	((n) == 32 ? 0xffffffff : (unsigned) ((1 << (n))-1))
diff --git a/pixman/src/icpixels.c b/pixman/src/icpixels.c
index 605214e..2e52d0f 100644
--- a/pixman/src/icpixels.c
+++ b/pixman/src/icpixels.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 static void
diff --git a/pixman/src/icrect.c b/pixman/src/icrect.c
index e4d0c12..5b64f96 100644
--- a/pixman/src/icrect.c
+++ b/pixman/src/icrect.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 typedef void	(*FillFunc) (pixman_image_t *dst,
diff --git a/pixman/src/icstipple.c b/pixman/src/icstipple.c
index 8074d7a..900551f 100644
--- a/pixman/src/icstipple.c
+++ b/pixman/src/icstipple.c
@@ -22,6 +22,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 #ifndef ICNOPIXADDR
diff --git a/pixman/src/ictransform.c b/pixman/src/ictransform.c
index 013c8ca..d2a678e 100644
--- a/pixman/src/ictransform.c
+++ b/pixman/src/ictransform.c
@@ -21,6 +21,10 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 #define MAX_FIXED_48_16	    ((xFixed_48_16) 0x7fffffff)
diff --git a/pixman/src/ictrap.c b/pixman/src/ictrap.c
index 5a33ab8..3e0186a 100644
--- a/pixman/src/ictrap.c
+++ b/pixman/src/ictrap.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 pixman_image_t *
diff --git a/pixman/src/ictri.c b/pixman/src/ictri.c
index 4080239..b590c12 100644
--- a/pixman/src/ictri.c
+++ b/pixman/src/ictri.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "icint.h"
 
 static void
diff --git a/pixman/src/icutil.c b/pixman/src/icutil.c
index 55ee293..8bf1ce3 100644
--- a/pixman/src/icutil.c
+++ b/pixman/src/icutil.c
@@ -22,6 +22,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 pixman_bits_t
diff --git a/pixman/src/renderedge.c b/pixman/src/renderedge.c
index 563a4e2..183443a 100644
--- a/pixman/src/renderedge.c
+++ b/pixman/src/renderedge.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 /*
diff-tree 208c32b245d7f50e1e9d71695269128b28a675fc (from 313a6f732112ca88fa4d590a604ce8219065655c)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 3 19:56:29 2007 -0400

    [cairoint.h] Remove inline definition for MS compilers
    
    Such things should go to config.h.  For one thing, cairoint.h is not
    included in pixman.

diff --git a/src/cairoint.h b/src/cairoint.h
index c462975..8ba2882 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -67,8 +67,6 @@
 
 #ifdef _MSC_VER
 #define snprintf _snprintf
-#undef inline
-#define inline __inline
 #endif
 
 CAIRO_BEGIN_DECLS
diff-tree 313a6f732112ca88fa4d590a604ce8219065655c (from 88dc0c5f19475888c19db437661b290f3a8902f8)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 3 19:53:28 2007 -0400

    [pixman] Cleanup inline mess (#10150)
    
    Simply use "inline" instead of "INLINE" or "__inline__" and let
    configure figure out what to use.

diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index 233b90c..a6a55aa 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -1741,7 +1741,7 @@ fbCombineSaturateU (CARD32 *dest, const 
 #define CombineXor	(CombineAOut|CombineBOut)
 
 /* portion covered by a but not b */
-static INLINE CARD8
+static inline CARD8
 fbCombineDisjointOutPart (CARD8 a, CARD8 b)
 {
     /* min (1, (1-b) / a) */
@@ -1753,7 +1753,7 @@ fbCombineDisjointOutPart (CARD8 a, CARD8
 }
 
 /* portion covered by both a and b */
-static INLINE CARD8
+static inline CARD8
 fbCombineDisjointInPart (CARD8 a, CARD8 b)
 {
     /* max (1-(1-b)/a,0) */
@@ -1881,7 +1881,7 @@ fbCombineDisjointXorU (CARD32 *dest, con
 }
 
 /* portion covered by a but not b */
-static INLINE CARD8
+static inline CARD8
 fbCombineConjointOutPart (CARD8 a, CARD8 b)
 {
     /* max (1-b/a,0) */
@@ -1895,7 +1895,7 @@ fbCombineConjointOutPart (CARD8 a, CARD8
 }
 
 /* portion covered by both a and b */
-static INLINE CARD8
+static inline CARD8
 fbCombineConjointInPart (CARD8 a, CARD8 b)
 {
     /* min (1,b/a) */
diff --git a/pixman/src/fbedge.c b/pixman/src/fbedge.c
index e06ed20..cf8c7fc 100644
--- a/pixman/src/fbedge.c
+++ b/pixman/src/fbedge.c
@@ -20,6 +20,10 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <string.h>
 #include "pixman-xserver-compat.h"
 
@@ -77,14 +81,14 @@
  * 8 bit alpha
  */
 
-static INLINE CARD8
+static inline CARD8
 clip255 (int x)
 {
     if (x > 255) return 255;
     return x;
 }
 
-static INLINE void
+static inline void
 add_saturate_8 (CARD8 *buf, int value, int length)
 {
     while (length--)
diff --git a/pixman/src/fbmmx.c b/pixman/src/fbmmx.c
index 387d4b4..0287e79 100644
--- a/pixman/src/fbmmx.c
+++ b/pixman/src/fbmmx.c
@@ -147,7 +147,8 @@ static const MMXData c =
 };
 
 #ifdef _MSC_VER
-#define __inline__ __forceinline
+#undef inline
+#define inline __forceinline
 #endif
 
 #ifdef __GNUC__
@@ -162,7 +163,7 @@ static const MMXData c =
  */
 #define M64(x) (*(__m64*)(void*)(&x))
 
-static __inline__ __m64
+static inline __m64
 shift (__m64 v, int s)
 {
     if (s > 0)
@@ -173,13 +174,13 @@ shift (__m64 v, int s)
 	return v;
 }
 
-static __inline__ __m64
+static inline __m64
 negate (__m64 mask)
 {
     return _mm_xor_si64 (mask, MC(4x00ff));
 }
 
-static __inline__ __m64
+static inline __m64
 pix_multiply (__m64 a, __m64 b)
 {
     __m64 res;
@@ -192,7 +193,7 @@ pix_multiply (__m64 a, __m64 b)
     return res;
 }
 
-static __inline__ __m64
+static inline __m64
 pix_add (__m64 a, __m64 b)
 {
     return  _mm_adds_pu8 (a, b);
@@ -200,19 +201,19 @@ pix_add (__m64 a, __m64 b)
 
 #ifdef USE_SSE
 
-static __inline__ __m64
+static inline __m64
 expand_alpha (__m64 pixel)
 {
     return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 3, 3, 3));
 }
 
-static __inline__ __m64
+static inline __m64
 expand_alpha_rev (__m64 pixel)
 {
     return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(0, 0, 0, 0));
 }
 
-static __inline__ __m64
+static inline __m64
 invert_colors (__m64 pixel)
 {
     return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 0, 1, 2));
@@ -220,7 +221,7 @@ invert_colors (__m64 pixel)
 
 #else
 
-static __inline__ __m64
+static inline __m64
 expand_alpha (__m64 pixel)
 {
     __m64 t1, t2;
@@ -234,7 +235,7 @@ expand_alpha (__m64 pixel)
     return t1;
 }
 
-static __inline__ __m64
+static inline __m64
 expand_alpha_rev (__m64 pixel)
 {
     __m64 t1, t2;
@@ -251,7 +252,7 @@ expand_alpha_rev (__m64 pixel)
     return t1;
 }
 
-static __inline__ __m64
+static inline __m64
 invert_colors (__m64 pixel)
 {
     __m64 x, y, z;
@@ -273,13 +274,13 @@ invert_colors (__m64 pixel)
 
 #endif
 
-static __inline__ __m64
+static inline __m64
 over (__m64 src, __m64 srca, __m64 dest)
 {
     return  _mm_adds_pu8 (src, pix_multiply(dest, negate(srca)));
 }
 
-static __inline__ __m64
+static inline __m64
 over_rev_non_pre (__m64 src, __m64 dest)
 {
     __m64 srca = expand_alpha (src);
@@ -288,7 +289,7 @@ over_rev_non_pre (__m64 src, __m64 dest)
     return over(pix_multiply(invert_colors(src), srcfaaa), srca, dest);
 }
 
-static __inline__ __m64
+static inline __m64
 in (__m64 src,
     __m64 mask)
 {
@@ -296,7 +297,7 @@ in (__m64 src,
 }
 
 #ifndef _MSC_VER
-static __inline__ __m64
+static inline __m64
 in_over (__m64 src,
 	 __m64 srca,
 	 __m64 mask,
@@ -308,19 +309,19 @@ in_over (__m64 src,
 #define in_over(src, srca, mask, dest) over(in(src, mask), pix_multiply(srca, mask), dest)
 #endif
 
-static __inline__ __m64
+static inline __m64
 load8888 (CARD32 v)
 {
     return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (v), _mm_setzero_si64());
 }
 
-static __inline__ __m64
+static inline __m64
 pack8888 (__m64 lo, __m64 hi)
 {
     return _mm_packs_pu16 (lo, hi);
 }
 
-static __inline__ CARD32
+static inline CARD32
 store8888 (__m64 v)
 {
     return _mm_cvtsi64_si32(pack8888(v, _mm_setzero_si64()));
@@ -340,7 +341,7 @@ store8888 (__m64 v)
  * Note the trick here - the top word is shifted by another nibble to
  * avoid it bumping into the middle word
  */
-static __inline__ __m64
+static inline __m64
 expand565 (__m64 pixel, int pos)
 {
     __m64 p = pixel;
@@ -360,7 +361,7 @@ expand565 (__m64 pixel, int pos)
     return _mm_srli_pi16 (pixel, 8);
 }
 
-static __inline__ __m64
+static inline __m64
 expand8888 (__m64 in, int pos)
 {
     if (pos == 0)
@@ -369,7 +370,7 @@ expand8888 (__m64 in, int pos)
 	return _mm_unpackhi_pi8 (in, _mm_setzero_si64());
 }
 
-static __inline__ __m64
+static inline __m64
 pack565 (__m64 pixel, __m64 target, int pos)
 {
     __m64 p = pixel;
@@ -400,7 +401,7 @@ pack565 (__m64 pixel, __m64 target, int 
 }
 
 #ifndef _MSC_VER
-static __inline__ __m64
+static inline __m64
 pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
 {
     x = _mm_mullo_pi16 (x, a);
diff --git a/pixman/src/fbpict.h b/pixman/src/fbpict.h
index 0ff0c11..79bd9f5 100644
--- a/pixman/src/fbpict.h
+++ b/pixman/src/fbpict.h
@@ -327,12 +327,6 @@
 #define FASTCALL
 #endif
 
-#if defined(__GNUC__)
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-
 typedef struct _FbComposeData {
     CARD8	op;
     PicturePtr	src;
diff --git a/pixman/src/icimage.c b/pixman/src/icimage.c
index 4d957a0..7227dd6 100644
--- a/pixman/src/icimage.c
+++ b/pixman/src/icimage.c
@@ -21,6 +21,10 @@
  * Author:  Keith Packard, SuSE, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "pixman-xserver-compat.h"
 
 pixman_image_t *
@@ -552,7 +556,7 @@ pixman_image_set_clip_region (pixman_ima
 
 #define BOUND(v)	(int16_t) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
 
-static __inline int
+static inline int
 FbClipImageReg (pixman_region16_t	*region,
 		pixman_region16_t	*clip,
 		int		dx,
@@ -588,7 +592,7 @@ FbClipImageReg (pixman_region16_t	*regio
     return 1;
 }
 
-static __inline int
+static inline int
 FbClipImageSrc (pixman_region16_t	*region,
 		pixman_image_t		*image,
 		int		dx,
diff --git a/pixman/src/icint.h b/pixman/src/icint.h
index 47a2220..0dc82aa 100644
--- a/pixman/src/icint.h
+++ b/pixman/src/icint.h
@@ -33,16 +33,6 @@
 #include <string.h>
 #include <limits.h>
 
-#ifndef __GNUC__
-#define __inline
-#endif
-
-#if defined(__GNUC__)
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-
 #undef MIN
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #undef MAX
@@ -804,7 +794,7 @@ fbRasterizeTrapezoid (pixman_image_t		*p
    in libgcc in case a target does not have one, which should be just as
    good as the static function below.  */
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-static INLINE int
+static inline int
 _FbOnes(unsigned int mask)
 {
 	return __builtin_popcount(mask);
diff --git a/pixman/src/pixregion.c b/pixman/src/pixregion.c
index 0404dff..e948c19 100644
--- a/pixman/src/pixregion.c
+++ b/pixman/src/pixregion.c
@@ -45,18 +45,16 @@ SOFTWARE.
 
 ******************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <limits.h>
 #include <string.h>
 
 #include "pixregionint.h"
 
-#if defined (__GNUC__) && !defined (NO_INLINES)
-#define INLINE	__inline
-#else
-#define INLINE
-#endif
-
 #undef assert
 #ifdef DEBUG_PIXREGION
 #define assert(expr) {if (!(expr)) \
@@ -469,7 +467,7 @@ pixman_region_copy(pixman_region16_t *ds
  *
  *-----------------------------------------------------------------------
  */
-INLINE static int
+static inline int
 pixman_coalesce (
     pixman_region16_t *	region,	    	/* Region to coalesce		     */
     int	    	  	prevStart,  	/* Index of start of previous band   */
@@ -552,7 +550,7 @@ pixman_coalesce (
  *-----------------------------------------------------------------------
  */
 
-INLINE static pixman_region_status_t
+static inline pixman_region_status_t
 pixman_region_appendNonO (
     pixman_region16_t *	region,
     pixman_box16_t *	r,


More information about the cairo-commit mailing list