code cleanup: remove redundant NULL checks

This commit is contained in:
Campbell Barton 2013-07-31 09:18:40 +00:00
parent e129211605
commit 43ab02db14
6 changed files with 10 additions and 16 deletions

@ -590,7 +590,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* never fails */
id_path = RNA_path_full_ID_py(id);
if (ptr->id.data && ptr->data && prop) {
if (ptr->data && prop) {
data_path = RNA_path_from_ID_to_property(ptr, prop);
}
@ -2268,10 +2268,8 @@ uiBlock *ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_
block = uiBeginBlock(C, handle->region, __func__, UI_EMBOSS);
if (but->rnaprop) {
if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
block->color_profile = FALSE;
}
if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
block->color_profile = false;
}
if (but->block) {

@ -1288,7 +1288,7 @@ void UI_view2d_smooth_view(bContext *C, ARegion *ar,
fac = smooth_view_rect_to_fac(&v2d->cur, cur);
}
if (C && U.smooth_viewtx && fac > FLT_EPSILON) {
if (U.smooth_viewtx && fac > FLT_EPSILON) {
int changed = FALSE;
if (BLI_rctf_compare(&sms.new_cur, &v2d->cur, FLT_EPSILON) == FALSE)

@ -469,9 +469,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
WM_event_remove_timer(oglrender->wm, oglrender->win, oglrender->timer);
}
if (oglrender->win) {
WM_cursor_restore(oglrender->win);
}
WM_cursor_restore(oglrender->win);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, oglrender->scene);
@ -560,9 +558,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
}
}
if (oglrender->win) {
WM_cursor_time(oglrender->win, scene->r.cfra);
}
WM_cursor_time(oglrender->win, scene->r.cfra);
BKE_scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));

@ -263,7 +263,7 @@ static void restrictbutton_bone_visibility_cb(bContext *C, void *poin, void *poi
{
bArmature *arm = (bArmature *)poin;
Bone *bone = (Bone *)poin2;
if (bone && (bone->flag & BONE_HIDDEN_P))
if (bone->flag & BONE_HIDDEN_P)
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
if (CTX_wm_window(C)->eventstate->ctrl) {
@ -277,7 +277,7 @@ static void restrictbutton_bone_select_cb(bContext *C, void *poin, void *poin2)
{
bArmature *arm = (bArmature *)poin;
Bone *bone = (Bone *)poin2;
if (bone && (bone->flag & BONE_UNSELECTABLE))
if (bone->flag & BONE_UNSELECTABLE)
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
if (CTX_wm_window(C)->eventstate->ctrl) {

@ -803,7 +803,7 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[4][4], int
totvert= obr->totvert;
/* we now test all vertices, when faces have a normal too much different: they get a new vertex */
for (a=0, asv=asverts; a<totvert; a++, asv++) {
if (asv && asv->totface>1) {
if (asv->totface > 1) {
ver= RE_findOrAddVert(obr, a);
asf= asv->faces.first;

@ -982,7 +982,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
WM_operator_last_properties_init(op);
}
if ((G.debug & G_DEBUG_HANDLERS) && event && event->type != MOUSEMOVE) {
if ((G.debug & G_DEBUG_HANDLERS) && ((event == NULL) || (event->type != MOUSEMOVE))) {
printf("%s: handle evt %d win %d op %s\n",
__func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
}