diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-31 18:45:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-31 19:01:00 +0400 |
commit | 70f2389f5a9052efab319d0b21999db7bcfc73b0 (patch) | |
tree | 8b9cddee8b3fd2d44abbeb7662979a9db3e7208b /source/blender/makesrna/intern/rna_tracking.c | |
parent | 1af6e656ec60b3dcebe722c9c8cf6b133ec0b411 (diff) |
Code cleanup: be less vague checking invalid index values
Diffstat (limited to 'source/blender/makesrna/intern/rna_tracking.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_tracking.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index c82de1dd782..87b7aa11c98 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -148,7 +148,7 @@ static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value) ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); int index = BLI_findindex(tracksbase, track); - if (index >= 0) + if (index != -1) clip->tracking.act_track = track; else clip->tracking.act_track = NULL; @@ -169,7 +169,7 @@ static void rna_tracking_active_plane_track_set(PointerRNA *ptr, PointerRNA valu ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); int index = BLI_findindex(plane_tracks_base, plane_track); - if (index >= 0) + if (index != -1) clip->tracking.act_plane_track = plane_track; else clip->tracking.act_plane_track = NULL; @@ -187,7 +187,7 @@ static void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value) /* TODO: it's a bit difficult to find list track came from knowing just * movie clip ID and MovieTracking structure, so keep this naive * search for a while */ - if (BLI_findindex(tracksbase, track) < 0) { + if (BLI_findindex(tracksbase, track) == -1) { MovieTrackingObject *object = tracking->objects.first; while (object) { @@ -285,7 +285,7 @@ static void rna_trackingPlaneTrack_name_set(PointerRNA *ptr, const char *value) /* TODO: it's a bit difficult to find list track came from knowing just * movie clip ID and MovieTracking structure, so keep this naive * search for a while */ - if (BLI_findindex(plane_tracks_base, plane_track) < 0) { + if (BLI_findindex(plane_tracks_base, plane_track) == -1) { MovieTrackingObject *object = tracking->objects.first; while (object) { @@ -441,7 +441,7 @@ static void rna_tracking_active_object_set(PointerRNA *ptr, PointerRNA value) MovieTrackingObject *object = (MovieTrackingObject *)value.data; int index = BLI_findindex(&clip->tracking.objects, object); - if (index >= 0) clip->tracking.objectnr = index; + if (index != -1) clip->tracking.objectnr = index; else clip->tracking.objectnr = 0; } |