Commit: 107566ebf1cf7d563a00f64615410c2b7d443c00
Author: Campbell Barton
Date:   Mon Feb 3 18:59:36 2014 +1100
https://developer.blender.org/rB107566ebf1cf7d563a00f64615410c2b7d443c00

Code cleanup: check -1 for error return explicitly

===================================================================

M       source/blender/editors/screen/screen_edit.c
M       source/blender/editors/screen/screen_ops.c

===================================================================

diff --git a/source/blender/editors/screen/screen_edit.c 
b/source/blender/editors/screen/screen_edit.c
index fa7fd62..4674a5b 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -580,7 +580,7 @@ int screen_area_join(bContext *C, bScreen *scr, ScrArea 
*sa1, ScrArea *sa2)
        dir = area_getorientation(sa1, sa2);
        /*printf("dir is : %i\n", dir);*/
        
-       if (dir < 0) {
+       if (dir == -1) {
                if (sa1) sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
                if (sa2) sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
                return 0;
@@ -1142,7 +1142,7 @@ void ED_screen_draw(wmWindow *win)
        /* blended join arrow */
        if (sa1 && sa2) {
                dir = area_getorientation(sa1, sa2);
-               if (dir >= 0) {
+               if (dir != -1) {
                        switch (dir) {
                                case 0: /* W */
                                        dir = 'r';
diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index ae1b7cc..53a1f4f 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2516,7 +2516,7 @@ static int area_join_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
                        if (sa) {
                                if (jd->sa1 != sa) {
                                        dir = area_getorientation(jd->sa1, sa);
-                                       if (dir >= 0) {
+                                       if (dir != -1) {
                                                if (jd->sa2) jd->sa2->flag &= 
~AREA_FLAG_DRAWJOINTO;
                                                jd->sa2 = sa;
                                                jd->sa2->flag |= 
AREA_FLAG_DRAWJOINTO;
@@ -2527,7 +2527,7 @@ static int area_join_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
                                                 * in this case we can swap 
areas.
                                                 */
                                                dir = area_getorientation(sa, 
jd->sa2);
-                                               if (dir >= 0) {
+                                               if (dir != -1) {
                                                        if (jd->sa1) 
jd->sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
                                                        if (jd->sa2) 
jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
                                                        jd->sa1 = jd->sa2;
@@ -2553,13 +2553,13 @@ static int area_join_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
                                                if (jd->sa1) jd->sa1->flag |= 
AREA_FLAG_DRAWJOINFROM;
                                                if (jd->sa2) jd->sa2->flag |= 
AREA_FLAG_DRAWJOINTO;
                                                dir = 
area_getorientation(jd->sa1, jd->sa2);
-                                               if (dir < 0) {
+                                               if (dir == -1) {
                                                        printf("oops, didn't 
expect that!\n");
                                                }
                                        }
                                        else {
                                                dir = 
area_getorientation(jd->sa1, sa);
-                                               if (dir >= 0) {
+                                               if (dir != -1) {
                                                        if (jd->sa2) 
jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
                                                        jd->sa2 = sa;
                                                        jd->sa2->flag |= 
AREA_FLAG_DRAWJOINTO;

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

Reply via email to