Revision: 32484
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32484
Author:   campbellbarton
Date:     2010-10-15 07:18:45 +0200 (Fri, 15 Oct 2010)

Log Message:
-----------
replace SIDE_OF_LINE macro with line_point_side_v2() inline function.
made a number of files build without unused warnings.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/displist.c
    trunk/blender/source/blender/blenkernel/intern/library.c
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/BLI_scanfill.h
    trunk/blender/source/blender/blenlib/intern/math_geom.c
    trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
    trunk/blender/source/blender/blenlib/intern/scanfill.c
    trunk/blender/source/blender/editors/mesh/editmesh_add.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/object/object_bake.c
    trunk/blender/source/blender/editors/object/object_constraint.c
    trunk/blender/source/blender/editors/object/object_hook.c
    trunk/blender/source/blender/editors/object/object_shapekey.c
    trunk/blender/source/blender/editors/object/object_vgroup.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_utils.c
    trunk/blender/source/blender/ikplugin/intern/iksolver_plugin.c
    trunk/blender/source/blender/windowmanager/intern/wm_gesture.c

Modified: trunk/blender/source/blender/blenkernel/intern/displist.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/displist.c   2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenkernel/intern/displist.c   2010-10-15 
05:18:45 UTC (rev 32484)
@@ -979,7 +979,7 @@
                        dl= dl->next;
                }
                
-               if(totvert && BLI_edgefill(0, 0)) { // XXX (obedit && 
obedit->actcol)?(obedit->actcol-1):0)) {
+               if(totvert && BLI_edgefill(0)) { // XXX (obedit && 
obedit->actcol)?(obedit->actcol-1):0)) {
 
                        /* count faces  */
                        tot= 0;

Modified: trunk/blender/source/blender/blenkernel/intern/library.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/library.c    2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenkernel/intern/library.c    2010-10-15 
05:18:45 UTC (rev 32484)
@@ -71,6 +71,7 @@
 #include "BLI_blenlib.h"
 #include "BLI_dynstr.h"
 
+#include "BKE_utildefines.h"
 #include "BKE_animsys.h"
 #include "BKE_context.h"
 #include "BKE_library.h"
@@ -668,7 +669,7 @@
        return idn;
 }
 
-static void free_library(Library *lib)
+static void free_library(Library *UNUSED(lib))
 {
        /* no freeing needed for libraries yet */
 }
@@ -680,7 +681,7 @@
        free_windowmanager_cb= func;
 }
 
-void animdata_dtar_clear_cb(ID *id, AnimData *adt, void *userdata)
+void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata)
 {
        ChannelDriver *driver;
        FCurve *fcu;

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h      2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h      2010-10-15 
05:18:45 UTC (rev 32484)
@@ -129,6 +129,8 @@
 MINLINE int compare_v4v4(float a[4], float b[4], float limit);
 MINLINE int equals_v4v4(float a[4], float b[4]);
 
+MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const 
float pt[2]);
+
 /********************************** Angles ***********************************/
 /* - angle with 2 arguments is angle between vector                          */
 /* - angle with 3 arguments is angle between 3 points at the middle point    */

Modified: trunk/blender/source/blender/blenlib/BLI_scanfill.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_scanfill.h 2010-10-15 04:27:09 UTC 
(rev 32483)
+++ trunk/blender/source/blender/blenlib/BLI_scanfill.h 2010-10-15 05:18:45 UTC 
(rev 32484)
@@ -50,7 +50,7 @@
 /* scanfill.c: used in displist only... */
 struct EditVert *BLI_addfillvert(float *vec);
 struct EditEdge *BLI_addfilledge(struct EditVert *v1, struct EditVert *v2);
-int BLI_edgefill(int mode, int mat_nr);
+int BLI_edgefill(int mat_nr);
 void BLI_end_edgefill(void);
 
 /* These callbacks are needed to make the lib finction properly */

Modified: trunk/blender/source/blender/blenlib/intern/math_geom.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_geom.c     2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenlib/intern/math_geom.c     2010-10-15 
05:18:45 UTC (rev 32484)
@@ -336,20 +336,19 @@
        return 1; 
 } // end Intersect_Lines
 
-#define SIDE_OF_LINE(pa,pb,pp) 
((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
 /* point in tri */
-// XXX was called IsectPT2Df
+
 int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2])
 {
-       if (SIDE_OF_LINE(v1,v2,pt)>=0.0) {
-               if (SIDE_OF_LINE(v2,v3,pt)>=0.0) {
-                       if (SIDE_OF_LINE(v3,v1,pt)>=0.0) {
+       if (line_point_side_v2(v1,v2,pt)>=0.0) {
+               if (line_point_side_v2(v2,v3,pt)>=0.0) {
+                       if (line_point_side_v2(v3,v1,pt)>=0.0) {
                                return 1;
                        }
                }
        } else {
-               if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0)) {
-                       if (! (SIDE_OF_LINE(v3,v1,pt)>=0.0)) {
+               if (! (line_point_side_v2(v2,v3,pt)>=0.0)) {
+                       if (! (line_point_side_v2(v3,v1,pt)>=0.0)) {
                                return -1;
                        }
                }
@@ -360,18 +359,18 @@
 /* point in quad - only convex quads */
 int isect_point_quad_v2(float pt[2], float v1[2], float v2[2], float v3[2], 
float v4[2])
 {
-       if (SIDE_OF_LINE(v1,v2,pt)>=0.0) {
-               if (SIDE_OF_LINE(v2,v3,pt)>=0.0) {
-                       if (SIDE_OF_LINE(v3,v4,pt)>=0.0) {
-                               if (SIDE_OF_LINE(v4,v1,pt)>=0.0) {
+       if (line_point_side_v2(v1,v2,pt)>=0.0) {
+               if (line_point_side_v2(v2,v3,pt)>=0.0) {
+                       if (line_point_side_v2(v3,v4,pt)>=0.0) {
+                               if (line_point_side_v2(v4,v1,pt)>=0.0) {
                                        return 1;
                                }
                        }
                }
        } else {
-               if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0)) {
-                       if (! (SIDE_OF_LINE(v3,v4,pt)>=0.0)) {
-                               if (! (SIDE_OF_LINE(v4,v1,pt)>=0.0)) {
+               if (! (line_point_side_v2(v2,v3,pt)>=0.0)) {
+                       if (! (line_point_side_v2(v3,v4,pt)>=0.0)) {
+                               if (! (line_point_side_v2(v4,v1,pt)>=0.0)) {
                                        return -1;
                                }
                        }

Modified: trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector_inline.c    
2010-10-15 04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenlib/intern/math_vector_inline.c    
2010-10-15 05:18:45 UTC (rev 32484)
@@ -454,5 +454,11 @@
        return 0;
 }
 
+MINLINE float line_point_side_v2(const float *l1, const float *l2, const float 
*pt)
+{
+       return  ((l1[0]-pt[0]) * (l2[1]-pt[1])) -
+                       ((l2[0]-pt[0]) * (l1[1]-pt[1]));
+}
+
 #endif /* BLI_MATH_VECTOR_INLINE */
 

Modified: trunk/blender/source/blender/blenlib/intern/scanfill.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/scanfill.c      2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/blenlib/intern/scanfill.c      2010-10-15 
05:18:45 UTC (rev 32484)
@@ -747,7 +747,7 @@
 
 
 
-int BLI_edgefill(int mode, int mat_nr)
+int BLI_edgefill(int mat_nr)
 {
        /*
          - fill works with its own lists, so create that first (no faces!)

Modified: trunk/blender/source/blender/editors/mesh/editmesh_add.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_add.c    2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/editors/mesh/editmesh_add.c    2010-10-15 
05:18:45 UTC (rev 32484)
@@ -113,7 +113,6 @@
        EditVert *eve;
        float min[3], max[3];
        int done= 0;
-       int rot_src= RNA_boolean_get(op->ptr, "rotate_source");
        
        em_setup_viewcontext(C, &vc);
        
@@ -130,14 +129,13 @@
 
        /* call extrude? */
        if(done) {
+               int rot_src= RNA_boolean_get(op->ptr, "rotate_source");
                EditEdge *eed;
                float vec[3], cent[3], mat[3][3];
                float nor[3]= {0.0, 0.0, 0.0};
                
                /* 2D normal calc */
                float mval_f[2]= {(float)event->mval[0], (float)event->mval[1]};
-
-#define SIDE_OF_LINE(pa,pb,pp) 
((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
                
                done= 0;
 
@@ -155,7 +153,7 @@
                                 *
                                 * accumulate the screenspace normal in 2D,
                                 * with screenspace edge length weighting the 
result. */
-                               if(SIDE_OF_LINE(co1, co2, mval_f) >= 0.0f) {
+                               if(line_point_side_v2(co1, co2, mval_f) >= 
0.0f) {
                                        nor[0] +=  (co1[1] - co2[1]);
                                        nor[1] += -(co1[0] - co2[0]);
                                }
@@ -167,8 +165,6 @@
                        }
                }
 
-#undef SIDE_OF_LINE
-
                if(done) {
                        float view_vec[3], cross[3];
 

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c  2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c  2010-10-15 
05:18:45 UTC (rev 32484)
@@ -7003,7 +7003,7 @@
                }
        }
 
-       if(BLI_edgefill(0, em->mat_nr)) {
+       if(BLI_edgefill(em->mat_nr)) {
                efa= fillfacebase.first;
                while(efa) {
                        /* normals default pointing up */

Modified: trunk/blender/source/blender/editors/object/object_bake.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_bake.c   2010-10-15 
04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/editors/object/object_bake.c   2010-10-15 
05:18:45 UTC (rev 32484)
@@ -69,7 +69,7 @@
 /* ****************** render BAKING ********************** */
 
 /* threaded break test */
-static int thread_break(void *unused)
+static int thread_break(void *UNUSED(arg))
 {
        return G.afbreek;
 }

Modified: trunk/blender/source/blender/editors/object/object_constraint.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_constraint.c     
2010-10-15 04:27:09 UTC (rev 32483)
+++ trunk/blender/source/blender/editors/object/object_constraint.c     
2010-10-15 05:18:45 UTC (rev 32484)
@@ -511,7 +511,7 @@
        return 0;
 }
 
-static bConstraint *edit_constraint_property_get(bContext *C, wmOperator *op, 
Object *ob, int type)
+static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, 
int type)
 {
        char constraint_name[32];
        int owner = RNA_enum_get(op->ptr, "owner");
@@ -547,7 +547,7 @@
 static int stretchto_reset_exec (bContext *C, wmOperator *op)
 {
        Object *ob = ED_object_active_context(C);
-       bConstraint *con = edit_constraint_property_get(C, op, ob, 
CONSTRAINT_TYPE_STRETCHTO);
+       bConstraint *con = edit_constraint_property_get(op, ob, 
CONSTRAINT_TYPE_STRETCHTO);
        bStretchToConstraint *data= (con) ? (bStretchToConstraint *)con->data : 
NULL;
        
        /* despite 3 layers of checks, we may still not be able to find a 
constraint */
@@ -590,7 +590,7 @@
 static int limitdistance_reset_exec (bContext *C, wmOperator *op)
 {
        Object *ob = ED_object_active_context(C);
-       bConstraint *con = edit_constraint_property_get(C, op, ob, 
CONSTRAINT_TYPE_DISTLIMIT);
+       bConstraint *con = edit_constraint_property_get(op, ob, 
CONSTRAINT_TYPE_DISTLIMIT);
        bDistLimitConstraint *data= (con) ? (bDistLimitConstraint *)con->data : 
NULL;
        
        /* despite 3 layers of checks, we may still not be able to find a 
constraint */
@@ -636,7 +636,7 @@
 {
        Scene *scene= CTX_data_scene(C);
        Object *ob = ED_object_active_context(C);
-       bConstraint *con = edit_constraint_property_get(C, op, ob, 
CONSTRAINT_TYPE_CHILDOF);
+       bConstraint *con = edit_constraint_property_get(op, ob, 
CONSTRAINT_TYPE_CHILDOF);
        bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : 
NULL;
        bPoseChannel *pchan= NULL;
        
@@ -720,7 +720,7 @@

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to