Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-31 18:45:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-31 19:01:00 +0400
commit70f2389f5a9052efab319d0b21999db7bcfc73b0 (patch)
tree8b9cddee8b3fd2d44abbeb7662979a9db3e7208b /source
parent1af6e656ec60b3dcebe722c9c8cf6b133ec0b411 (diff)
Code cleanup: be less vague checking invalid index values
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_fcurve.h4
-rw-r--r--source/blender/blenkernel/intern/customdata.c42
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c4
-rw-r--r--source/blender/blenkernel/intern/tracking.c4
-rw-r--r--source/blender/editors/include/ED_object.h12
-rw-r--r--source/blender/editors/object/object_modifier.c36
-rw-r--r--source/blender/editors/object/object_vgroup.c21
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/transform/transform_conversions.c2
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_key.c2
-rw-r--r--source/blender/makesrna/intern/rna_mask.c2
-rw-r--r--source/blender/makesrna/intern/rna_texture.c3
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c10
14 files changed, 74 insertions, 72 deletions
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index 5ad378bc331..06598a26b30 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -178,13 +178,13 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type);
struct FModifier *add_fmodifier(ListBase *modifiers, int type);
struct FModifier *copy_fmodifier(struct FModifier *src);
void copy_fmodifiers(ListBase *dst, ListBase *src);
-int remove_fmodifier(ListBase *modifiers, struct FModifier *fcm);
+bool remove_fmodifier(ListBase *modifiers, struct FModifier *fcm);
void free_fmodifiers(ListBase *modifiers);
struct FModifier *find_active_fmodifier(ListBase *modifiers);
void set_active_fmodifier(ListBase *modifiers, struct FModifier *fcm);
-short list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype);
+bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype);
FModifierStackStorage *evaluate_fmodifiers_storage_new(ListBase *modifiers);
void evaluate_fmodifiers_storage_free(FModifierStackStorage *storage);
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index fc123d37a7b..5a5b9f1747f 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1793,7 +1793,7 @@ bool CustomData_free_layer_active(CustomData *data, int type, int totelem)
{
int index = 0;
index = CustomData_get_active_layer_index(data, type);
- if (index < 0) return 0;
+ if (index == -1) return 0;
return CustomData_free_layer(data, type, totelem, index);
}
@@ -1838,7 +1838,7 @@ void *CustomData_duplicate_referenced_layer(struct CustomData *data, const int t
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
layer = &data->layers[layer_index];
@@ -1871,7 +1871,7 @@ void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
/* get the layer index of the desired layer */
layer_index = CustomData_get_named_layer_index(data, type, name);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
layer = &data->layers[layer_index];
@@ -1903,7 +1903,7 @@ bool CustomData_is_referenced_layer(struct CustomData *data, int type)
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return 0;
+ if (layer_index == -1) return 0;
layer = &data->layers[layer_index];
@@ -2007,7 +2007,7 @@ void CustomData_copy_data_named(const CustomData *source, CustomData *dest,
dest_i = CustomData_get_named_layer_index(dest, source->layers[src_i].type, source->layers[src_i].name);
/* if we found a matching layer, copy the data */
- if (dest_i > -1) {
+ if (dest_i != -1) {
CustomData_copy_data_layer(source, dest, src_i, dest_i, source_index, dest_index, count);
}
}
@@ -2148,7 +2148,7 @@ void *CustomData_get(const CustomData *data, int index, int type)
/* get the layer index of the active layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
/* get the offset of the desired element */
offset = layerType_getInfo(type)->size * index;
@@ -2165,7 +2165,7 @@ void *CustomData_get_n(const CustomData *data, int type, int index, int n)
/* get the layer index of the first layer of type */
layer_index = data->typemap[type];
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
offset = layerType_getInfo(type)->size * index;
return (char *)data->layers[layer_index + n].data + offset;
@@ -2175,7 +2175,7 @@ void *CustomData_get_layer(const CustomData *data, int type)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
return data->layers[layer_index].data;
}
@@ -2184,7 +2184,7 @@ void *CustomData_get_layer_n(const CustomData *data, int type, int n)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
return data->layers[layer_index].data;
}
@@ -2193,7 +2193,7 @@ void *CustomData_get_layer_named(const struct CustomData *data, int type,
const char *name)
{
int layer_index = CustomData_get_named_layer_index(data, type, name);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
return data->layers[layer_index].data;
}
@@ -2202,7 +2202,7 @@ int CustomData_get_offset(const CustomData *data, int type)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return -1;
+ if (layer_index == -1) return -1;
return data->layers[layer_index].offset;
}
@@ -2211,7 +2211,7 @@ int CustomData_get_n_offset(const CustomData *data, int type, int n)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if (layer_index < 0) return -1;
+ if (layer_index == -1) return -1;
return data->layers[layer_index].offset;
}
@@ -2221,7 +2221,7 @@ bool CustomData_set_layer_name(const CustomData *data, int type, int n, const ch
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if (layer_index < 0) return false;
+ if (layer_index == -1) return false;
if (!name) return false;
BLI_strncpy(data->layers[layer_index].name, name, sizeof(data->layers[layer_index].name));
@@ -2234,7 +2234,7 @@ void *CustomData_set_layer(const CustomData *data, int type, void *ptr)
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
data->layers[layer_index].data = ptr;
@@ -2245,7 +2245,7 @@ void *CustomData_set_layer_n(const struct CustomData *data, int type, int n, voi
{
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
data->layers[layer_index].data = ptr;
@@ -2614,7 +2614,7 @@ void *CustomData_bmesh_get(const CustomData *data, void *block, int type)
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
return (char *)block + data->layers[layer_index].offset;
}
@@ -2625,7 +2625,7 @@ void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int
/* get the layer index of the first layer of type */
layer_index = CustomData_get_layer_index(data, type);
- if (layer_index < 0) return NULL;
+ if (layer_index == -1) return NULL;
return (char *)block + data->layers[layer_index + n].offset;
}
@@ -3070,7 +3070,7 @@ void CustomData_validate_layer_name(const CustomData *data, int type, const char
if (name[0])
index = CustomData_get_named_layer_index(data, type, name);
- if (index < 0) {
+ if (index == -1) {
/* either no layer was specified, or the layer we want has been
* deleted, so assign the active layer to name
*/
@@ -3319,7 +3319,7 @@ void CustomData_external_add(CustomData *data, ID *UNUSED(id), int type, int UNU
int layer_index;
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return;
+ if (layer_index == -1) return;
layer = &data->layers[layer_index];
@@ -3343,7 +3343,7 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem)
int layer_index; // i, remove_file;
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return;
+ if (layer_index == -1) return;
layer = &data->layers[layer_index];
@@ -3377,7 +3377,7 @@ bool CustomData_external_test(CustomData *data, int type)
int layer_index;
layer_index = CustomData_get_active_layer_index(data, type);
- if (layer_index < 0) return false;
+ if (layer_index == -1) return false;
layer = &data->layers[layer_index];
return (layer->flag & CD_FLAG_EXTERNAL) != 0;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 3436728254b..325a26d7a16 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -1165,7 +1165,7 @@ void copy_fmodifiers(ListBase *dst, ListBase *src)
}
/* Remove and free the given F-Modifier from the given stack */
-int remove_fmodifier(ListBase *modifiers, FModifier *fcm)
+bool remove_fmodifier(ListBase *modifiers, FModifier *fcm)
{
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
@@ -1252,7 +1252,7 @@ void set_active_fmodifier(ListBase *modifiers, FModifier *fcm)
* - mtype - type of modifier (if 0, doesn't matter)
* - acttype - type of action to perform (if -1, doesn't matter)
*/
-short list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
+bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
{
FModifier *fcm;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index ab314d8b148..fbca675e5ee 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -769,7 +769,7 @@ MovieTrackingTrack *BKE_tracking_track_get_active(MovieTracking *tracking)
tracksbase = BKE_tracking_get_active_tracks(tracking);
/* check that active track is in current tracks list */
- if (BLI_findindex(tracksbase, tracking->act_track) >= 0)
+ if (BLI_findindex(tracksbase, tracking->act_track) != -1)
return tracking->act_track;
return NULL;
@@ -1284,7 +1284,7 @@ MovieTrackingPlaneTrack *BKE_tracking_plane_track_get_active(struct MovieTrackin
plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
/* Check that active track is in current plane tracks list */
- if (BLI_findindex(plane_tracks_base, tracking->act_plane_track) >= 0) {
+ if (BLI_findindex(plane_tracks_base, tracking->act_plane_track) != -1) {
return tracking->act_plane_track;
}
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 973023227f0..dae53213afb 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -187,8 +187,8 @@ enum {
struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
struct Object *ob, const char *name, int type);
-int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain,
- struct Object *ob, struct ModifierData *md);
+bool ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain,
+ struct Object *ob, struct ModifierData *md);
void ED_object_modifier_clear(struct Main *bmain, struct Object *ob);
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
@@ -198,11 +198,11 @@ int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene,
struct Object *ob, struct ModifierData *md, int mode);
int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
-int ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, const bool include_orig,
- int (*callback)(struct Object *ob, void *callback_data),
- void *callback_data);
+bool ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, const bool include_orig,
+ bool (*callback)(struct Object *ob, void *callback_data),
+ void *callback_data);
-int ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v);
+bool ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v);
/* object_select.c */
void ED_object_select_linked_by_id(struct bContext *C, struct ID *id);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 92775b250b1..50d708bb49e 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -177,8 +177,8 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
/* Return TRUE if the object has a modifier of type 'type' other than
* the modifier pointed to be 'exclude', otherwise returns FALSE. */
-static int object_has_modifier(const Object *ob, const ModifierData *exclude,
- ModifierType type)
+static bool object_has_modifier(const Object *ob, const ModifierData *exclude,
+ ModifierType type)
{
ModifierData *md;
@@ -198,9 +198,9 @@ static int object_has_modifier(const Object *ob, const ModifierData *exclude,
* If the callback ever returns TRUE, iteration will stop and the
* function value will be TRUE. Otherwise the function returns FALSE.
*/
-int ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig,
- int (*callback)(Object *ob, void *callback_data),
- void *callback_data)
+bool ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig,
+ bool (*callback)(Object *ob, void *callback_data),
+ void *callback_data)
{
ID *ob_data_id = orig_ob->data;
int users = ob_data_id->us;
@@ -233,7 +233,7 @@ int ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig,
return FALSE;
}
-static int object_has_modifier_cb(Object *ob, void *data)
+static bool object_has_modifier_cb(Object *ob, void *data)
{
ModifierType type = *((ModifierType *)data);
@@ -243,7 +243,7 @@ static int object_has_modifier_cb(Object *ob, void *data)
/* Use with ED_object_iter_other(). Sets the total number of levels
* for any multires modifiers on the object to the int pointed to by
* callback_data. */
-int ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v)
+bool ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v)
{
ModifierData *md;
int totlevel = *((int *)totlevel_v);
@@ -258,17 +258,17 @@ int ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v)
}
/* Return TRUE if no modifier of type 'type' other than 'exclude' */
-static int object_modifier_safe_to_delete(Main *bmain, Object *ob,
- ModifierData *exclude,
- ModifierType type)
+static bool object_modifier_safe_to_delete(Main *bmain, Object *ob,
+ ModifierData *exclude,
+ ModifierType type)
{
return (!object_has_modifier(ob, exclude, type) &&
!ED_object_iter_other(bmain, ob, FALSE,
object_has_modifier_cb, &type));
}
-static int object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
- int *sort_depsgraph)
+static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
+ bool *r_sort_depsgraph)
{
/* It seems on rapid delete it is possible to
* get called twice on same modifier, so make
@@ -296,10 +296,10 @@ static int object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
if (ob->pd)
ob->pd->deflect = 0;
- *sort_depsgraph = 1;
+ *r_sort_depsgraph = true;
}
else if (md->type == eModifierType_Surface) {
- *sort_depsgraph = 1;
+ *r_sort_depsgraph = true;
}
else if (md->type == eModifierType_Multires) {
/* Delete MDisps layer if not used by another multires modifier */
@@ -324,10 +324,10 @@ static int object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
return 1;
}
-int ED_object_modifier_remove(ReportList *reports, Main *bmain, Object *ob, ModifierData *md)
+bool ED_object_modifier_remove(ReportList *reports, Main *bmain, Object *ob, ModifierData *md)
{
- int sort_depsgraph = 0;
- int ok;
+ bool sort_depsgraph = false;
+ bool ok;
ok = object_modifier_remove(bmain, ob, md, &sort_depsgraph);
@@ -345,7 +345,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Object *ob, Modi
void ED_object_modifier_clear(Main *bmain, Object *ob)
{
ModifierData *md = ob->modifiers.first;
- int sort_depsgraph = 0;
+ bool sort_depsgraph = false;
if (!md)
return;
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index a14a4213d92..66884d75f36 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -1251,16 +1251,17 @@ void ED_vgroup_vert_add(Object *ob, bDeformGroup *dg, int vertnum, float weight,
/* get the deform group number, exit if
* it can't be found
*/
- if (def_nr < 0) return;
+ if (def_nr != -1) {
- /* if there's no deform verts then create some,
- */
- if (ED_vgroup_array_get(ob->data, &dv, &tot) && dv == NULL)
- ED_vgroup_data_create(ob->data);
+ /* if there's no deform verts then create some,
+ */
+ if (ED_vgroup_array_get(ob->data, &dv, &tot) && dv == NULL)
+ ED_vgroup_data_create(ob->data);
- /* call another function to do the work
- */
- ED_vgroup_nr_vert_add(ob, def_nr, vertnum, weight, assignmode);
+ /* call another function to do the work
+ */
+ ED_vgroup_nr_vert_add(ob, def_nr, vertnum, weight, assignmode);
+ }
}
/* mesh object mode, lattice can be in editmode */
@@ -2778,7 +2779,7 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
int dvert_tot = 0;
const int def_nr = BLI_findindex(&ob->defbase, dg);
- assert(def_nr > -1);
+ BLI_assert(def_nr != -1);
ED_vgroup_array_get(ob->data, &dvert_array, &dvert_tot);
@@ -2908,7 +2909,7 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
int i;
const int dg_index = BLI_findindex(&ob->defbase, dg);
- assert(dg_index > -1);
+ BLI_assert(dg_index != -1);
/* Make sure that no verts are using this group */
if (vgroup_active_remove_verts(ob, true, dg) == false) {
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 25b6f241d9b..3bec60008e6 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1557,7 +1557,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
BLI_SMALLSTACK_DECLARE(pt_stack, PanelType *);
- if (contextnr >= 0)
+ if (contextnr != -1)
is_context_new = UI_view2d_tab_set(v2d, contextnr);
/* before setting the view */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 9be83bffc5b..3163e8ffce4 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2232,7 +2232,7 @@ static void createTransEditVerts(TransInfo *t)
}
/* detect CrazySpace [tm] */
- if (modifiers_getCageIndex(t->scene, t->obedit, NULL, 1) >= 0) {
+ if (modifiers_getCageIndex(t->scene, t->obedit, NULL, 1) != -1) {
int totleft = -1;
if (modifiers_isCorrectableDeformed(t->scene, t->obedit)) {
/* check if we can use deform matrices for modifier from the
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index de19622148e..cfbf0193649 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -228,7 +228,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
prop = RNA_struct_find_property(&ramp_ptr, "elements"); \
if (prop) { \
index = RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
- if (index >= 0) { \
+ if (index != -1) { \
char *texture_path = rna_ColorRamp_path(&ramp_ptr); \
path = BLI_sprintfN("%s.elements[%d]", texture_path, index); \
MEM_freeN(texture_path); \
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 68e132f3207..950c369f22f 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -171,7 +171,7 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
if (key) {
int a = BLI_findindex(&key->block, value.data);
- if (a >= 0) return a;
+ if (a != -1) return a;
}
return current;
diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c
index f47579cdb82..16cfbbd5ea6 100644
--- a/source/blender/makesrna/intern/rna_mask.c
+++ b/source/blender/makesrna/intern/rna_mask.c
@@ -232,7 +232,7 @@ static void rna_MaskLayer_active_spline_set(PointerRNA *ptr, PointerRNA value)
MaskSpline *spline = (MaskSpline *)value.data;
int index = BLI_findindex(&masklay->splines, spline);
- if (index >= 0)
+ if (index != -1)
masklay->act_spline = spline;
else
masklay->act_spline = NULL;
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 37a0ee0da8e..b0e1ed04790 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -304,8 +304,9 @@ char *rna_TextureSlot_path(PointerRNA *ptr)
if (prop) {
int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
- if (index >= 0)
+ if (index != -1) {
return BLI_sprintfN("texture_slots[%d]", index);
+ }
}
}
}
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;
}