[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49332] trunk/blender/intern/raskter/ raskter.c: Blender now compiles with recent clang

Sergey Sharybin sergey.vfx at gmail.com
Sat Jul 28 19:35:10 CEST 2012


Revision: 49332
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49332
Author:   nazgul
Date:     2012-07-28 17:35:09 +0000 (Sat, 28 Jul 2012)
Log Message:
-----------
Blender now compiles with recent clang

Modified Paths:
--------------
    trunk/blender/intern/raskter/raskter.c

Modified: trunk/blender/intern/raskter/raskter.c
===================================================================
--- trunk/blender/intern/raskter/raskter.c	2012-07-28 17:22:35 UTC (rev 49331)
+++ trunk/blender/intern/raskter/raskter.c	2012-07-28 17:35:09 UTC (rev 49332)
@@ -37,7 +37,16 @@
 #endif
 
 
+// this is needed for inlining behavior
+#if defined _WIN32
+#   define DO_INLINE __inline
+#elif defined (__sun) || defined (__sun__)
+#   define DO_INLINE
+#else
+#   define DO_INLINE static inline
+#endif
 
+
 /*
  * Sort all the edges of the input polygon by Y, then by X, of the "first" vertex encountered.
  * This will ensure we can scan convert the entire poly in one pass.
@@ -814,14 +823,14 @@
     return (int)((normalized_value * (float)(max_value)) + 0.5f);
 }
 
-__inline float get_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y) {
+DO_INLINE float get_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y) {
     if(pos_x < 0 || pos_x >= buf_x || pos_y < 0 || pos_y >= buf_y) {
         return 0.0f;
     }
     return buf[(pos_y * buf_x) + pos_x];
 }
 
-__inline float get_pixel_intensity_bilinear(float *buf, int buf_x, int buf_y, float u, float v) {
+DO_INLINE float get_pixel_intensity_bilinear(float *buf, int buf_x, int buf_y, float u, float v) {
     int a;
     int b;
     int a_plus_1;
@@ -847,7 +856,7 @@
 
 }
 
-__inline void set_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y, float intensity) {
+DO_INLINE void set_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y, float intensity) {
     if(pos_x < 0 || pos_x >= buf_x || pos_y < 0 || pos_y >= buf_y) {
         return;
     }




More information about the Bf-blender-cvs mailing list