remove NULL checks on fixed size arrays, also was calling BLI_testextensie_glob every time in the file selector with a blank string.

This commit is contained in:
Campbell Barton 2013-07-13 14:16:59 +00:00
parent 0ea078ad03
commit 1c15beb6b2
7 changed files with 7 additions and 16 deletions

@ -354,7 +354,7 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
ma = NULL;
for (b = 0; ma && b < MAX_MTEX; b++)
if (ma->mtex && ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA)
if (ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA)
texalpha = 1;
}
else {

@ -401,7 +401,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
glDisable(GL_BLEND);
/* and the marker name too, shifted slightly to the top-right */
if (marker->name && marker->name[0]) {
if (marker->name[0]) {
float x, y;
/* minimal y coordinate which wouldn't be occluded by scroll */

@ -524,7 +524,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if (but->rnapoin.id.data) {
ID *id = but->rnapoin.id.data;
if (id->lib && id->lib->name) {
if (id->lib) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Library: %s"), id->lib->name);
data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;

@ -847,7 +847,7 @@ static void filelist_setfiletypes(struct FileList *filelist)
}
file->flags = file_extension_type(file->relname);
if (filelist->filter_glob &&
if (filelist->filter_glob[0] &&
BLI_testextensie_glob(file->relname, filelist->filter_glob))
{
file->flags = OPERATORFILE;

@ -162,12 +162,7 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
break;
case SEQ_TYPE_COLOR:
if (colvars->col) {
rgb_float_to_uchar(col, colvars->col);
}
else {
col[0] = col[1] = col[2] = 128;
}
rgb_float_to_uchar(col, colvars->col);
break;
case SEQ_TYPE_SOUND_RAM:

@ -2448,11 +2448,7 @@ void IMB_colormanagement_colorspace_items_add(EnumPropertyItem **items, int *tot
item.name = colorspace->name;
item.identifier = colorspace->name;
item.icon = 0;
if (colorspace->description)
item.description = colorspace->description;
else
item.description = "";
item.description = colorspace->description;
RNA_enum_item_add(items, totitem, &item);
}

@ -636,7 +636,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
*
* Use the edge order to make the subtraction, flip the normal the right way
* edge should be there but check just in case... */
if (vc->e && vc->e[0]->v1 == i) {
if (vc->e[0]->v1 == i) {
sub_v3_v3(tmp_vec1, tmp_vec2);
}
else {