diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 11:59:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 12:35:44 +0400 |
commit | 107566ebf1cf7d563a00f64615410c2b7d443c00 (patch) | |
tree | d10365de620ea16485b82034ee13df2231a5ea4c /source/blender/editors | |
parent | d900f5be55d0812eb5c7dfd3ea47020c3edafd41 (diff) |
Code cleanup: check -1 for error return explicitly
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index fa7fd62231b..4674a5b36a3 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 ae1b7cc937f..53a1f4fc8ca 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; |