From 1c15beb6b225826c0a0d83d4df58a0bac7ce0ed5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jul 2013 14:16:59 +0000 Subject: remove NULL checks on fixed size arrays, also was calling BLI_testextensie_glob every time in the file selector with a blank string. --- source/blender/blenloader/intern/versioning_legacy.c | 2 +- source/blender/editors/animation/anim_markers.c | 2 +- source/blender/editors/interface/interface_regions.c | 2 +- source/blender/editors/space_file/filelist.c | 2 +- source/blender/editors/space_sequencer/sequencer_draw.c | 7 +------ source/blender/imbuf/intern/colormanagement.c | 6 +----- source/blender/modifiers/intern/MOD_screw.c | 2 +- 7 files changed, 7 insertions(+), 16 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index c6856d8b71d..82040020ce4 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -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 { diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index f3edb61f487..da76ad8a832 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -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 */ diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 2e915d6357d..9c6a606333d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -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++; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index f1e707f8802..7d7dccdf0e6 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -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; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index af4b4055156..0f4a2d8b4dd 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -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: diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 235c6a0f37e..baaee8cb553 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -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); } diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 5faa1ecdaac..0d098db3203 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -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 { -- cgit v1.2.3