Code cleanup: quiet warning, 'else' would always crash (& never occurred)

also quiet waning clamping
This commit is contained in:
2014-03-13 11:59:11 +11:00
parent 37cf28b341
commit c17acf1d6e
2 changed files with 5 additions and 5 deletions

View File

@@ -172,16 +172,14 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr,
if (!is_boolean) if (!is_boolean)
uiItemL(col, name, ICON_NONE); uiItemL(col, name, ICON_NONE);
} }
else if (label_align == 'H') { else { /* (label_align == 'H') */
BLI_assert(label_align == 'H');
split = uiLayoutSplit(layout, 0.5f, false); split = uiLayoutSplit(layout, 0.5f, false);
col = uiLayoutColumn(split, false); col = uiLayoutColumn(split, false);
uiItemL(col, (is_boolean) ? "" : name, ICON_NONE); uiItemL(col, (is_boolean) ? "" : name, ICON_NONE);
col = uiLayoutColumn(split, false); col = uiLayoutColumn(split, false);
} }
else {
col = NULL;
}
/* may meed to add more cases here. /* may meed to add more cases here.
* don't override enum flag names */ * don't override enum flag names */

View File

@@ -294,7 +294,9 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous
cdc.lofs = -BLF_descender(mono); cdc.lofs = -BLF_descender(mono);
/* note, scroll bar must be already subtracted () */ /* note, scroll bar must be already subtracted () */
cdc.console_width = (tvc->winx - (CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth; cdc.console_width = (tvc->winx - (CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth;
CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ /* avoid divide by zero on small windows */
if (cdc.console_width < 1)
cdc.console_width = 1;
cdc.winx = tvc->winx - CONSOLE_DRAW_MARGIN; cdc.winx = tvc->winx - CONSOLE_DRAW_MARGIN;
cdc.ymin = tvc->ymin; cdc.ymin = tvc->ymin;
cdc.ymax = tvc->ymax; cdc.ymax = tvc->ymax;